Bang hộiTiền mặt: 0 Xu Trò chơiHộp quà giáng sinhThứ Sáu, 03:12:46 - 29/03/2024
Chia sẻ kiến thức sử dụng VPS (máy chủ ảo) - Server (máy chủ riêng)

Các điều hành viên: Mod, SMod, Admin

Các lệnh dùng để kiểm tra dung lượng ổ đĩa trên VPS Linux

Các lệnh dùng để kiểm tra dung lượng ổ đĩa trên VPS Linux

#1 » Gửi bài gửi bởi nghiatichxanh1992 » 21/09/2016 00:12 » @452601

Trên internet bạn có thể tìm được rất nhiều công cụ kiểm tra dung lượng ổ cứng trên linux. Tuy nhiên, Linux được tích hợp một công cụ mạnh mẽ để thực hiện công việc này đó là “df”. Lệnh “df” viết tắt của “disk filesystem“, nó được dùng để lấy toàn bộ thông tin về lượng ổ cứng khả dụng và lượng ổ cứng đã dùng của các file hệ thống trên linux.

Các lệnh dùng để kiểm tra dung lượng ổ đĩa trên VPS Linux

Việc sử dụng “-h” trong lệnh “df -h” cho ta một cái nhìn trực quan hơn khi đọc các thông số ở chế độ chi tiết : bytes, mega bytes and giga bytes.

Sau đây là những lệnh “df” hay sử dụng khi quản trị hệ thống linux.


1. Kiểm tra dung lượng ổ cứng mà các file hệ thống sử dụng.
Mã: Chọn tất cả
[root@vultr ~]# df
Filesystem     1K-blocks     Used Available Use% Mounted on
/dev/vda1       41283904 13990256  25196548  36% /
tmpfs            1962396      232   1962164   1% /dev/shm



2. Hiện thị thông tin ổ đĩa các file hệ thống sử dụng
Mã: Chọn tất cả
[root@vultr ~]# df -a
Filesystem       1K-blocks     Used Available Use% Mounted on
/dev/vda1         41283904 13991596  25195208  36% /
proc                     0        0         0    - /proc
sysfs                    0        0         0    - /sys
devpts                   0        0         0    - /dev/pts
tmpfs              1962396      232   1962164   1% /dev/shm
none                     0        0         0    - /proc/sys/fs/binfmt_misc
gvfs-fuse-daemon         0        0         0    - /root/.gvfs



3. Hiện thị thông tin về thư mục Home
Mã: Chọn tất cả
[root@vultr ~]# df -hT /home
Filesystem     Type  Size  Used Avail Use% Mounted on
/dev/vda1      ext4   40G   14G   25G  36% /



4. Hiển thị thông tin về các file hệ thống theo bytes
Mã: Chọn tất cả
[root@vultr ~]# df -k
Filesystem     1K-blocks     Used Available Use% Mounted on
/dev/vda1       41283904 13994420  25192384  36% /
tmpfs            1962396      232   1962164   1% /dev/shm



5. Xem thông tin file hệ thống ở MB
Mã: Chọn tất cả
[root@vultr ~]# df -m
Filesystem     1M-blocks  Used Available Use% Mounted on
/dev/vda1          40317 13666     24603  36% /
tmpfs               1917     1      1917   1% /dev/shm



6. Xem thông tin file hệ thống ở GB
Mã: Chọn tất cả
[root@vultr ~]# df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/vda1        40G   14G   25G  36% /
tmpfs           1,9G  232K  1,9G   1% /dev/shm



7. Xem thông tin Inodes
Mã: Chọn tất cả
[root@vultr ~]# df -i
Filesystem      Inodes  IUsed   IFree IUse% Mounted on
/dev/vda1      2621440 150862 2470578    6% /
tmpfs           490599      7  490592    1% /dev/shm



8. Hiển thị thông tin định dạng file hệ thống
Mã: Chọn tất cả
[root@vultr ~]# df -T
Filesystem     Type  1K-blocks     Used Available Use% Mounted on
/dev/vda1      ext4   41283904 13994384  25192420  36% /
tmpfs          tmpfs   1962396      232   1962164   1% /dev/shm



9. Xem các lệnh df
Mã: Chọn tất cả
[root@vultr ~]#  df --help
Usage: df [OPTION]... [FILE]...
Show information about the file system on which each FILE resides,
or all file systems by default.
 
Mandatory arguments to long options are mandatory for short options too.
  -a, --all             include dummy file systems
  -B, --block-size=SIZE  use SIZE-byte blocks
      --direct          show statistics for a file instead of mount point
      --total           produce a grand total
  -h, --human-readable  print sizes in human readable format (e.g., 1K 234M 2G)
  -H, --si              likewise, but use powers of 1000 not 1024
  -i, --inodes          list inode information instead of block usage
  -k                    like --block-size=1K
  -l, --local           limit listing to local file systems
      --no-sync         do not invoke sync before getting usage info (default)
  -P, --portability     use the POSIX output format
      --sync            invoke sync before getting usage info
  -t, --type=TYPE       limit listing to file systems of type TYPE
  -T, --print-type      print file system type
  -x, --exclude-type=TYPE   limit listing to file systems not of type TYPE
  -v                    (ignored)
      --help     display this help and exit
      --version  output version information and exit
 
Display values are in units of the first available SIZE from --block-size,
and the DF_BLOCK_SIZE, BLOCK_SIZE and BLOCKSIZE environment variables.
Otherwise, units default to 1024 bytes (or 512 if POSIXLY_CORRECT is set).
 
SIZE may be (or may be an integer optionally followed by) one of following:
KB 1000, K 1024, MB 1000*1000, M 1024*1024, and so on for G, T, P, E, Z, Y.
 
Report df bugs to bug-coreutils@gnu.org
GNU coreutils home page: <http://www.gnu.org/software/coreutils/>
General help using GNU software: <http://www.gnu.org/gethelp/>
For complete documentation, run: info coreutils 'df invocation'



Trên đây là các lệnh “df” thường dùng.

Chúc các bạn thành công.

Nguồn: hostingaz.vn
nghiatichxanh1992 ✅
Hình đại diện của thành viên
Rank: ☀️2/30☀️
Cấp độ:
Tu luyện:
Like:
Online:
Bang hội: Tiếu Ngạo
Xếp hạng Bang hội: ⚡5/60⚡
Level:
Chủ đề đã tạo: 🩸4142/4142🩸
Tiền mặt:
Ngân hàng:
Nhóm:
Danh hiệu: ⚝Truyền Thuyết⚝
Giới tính:
Ngày tham gia:
Đến từ:
Thiết bị:
Số điện thoại:
(Cốc Cốc 56.3.120)


Quay về VPS - Server

 


  • Chủ đề tương tự
    Trả lời
    Xem
    Bài viết mới nhất