Domain, hosting, vps giá rẻ
Kết quả 1 đến 1 của 1

Chủ đề: Các lệnh kiểm tra dung lượng ổ đĩa trên VPS Linux

  1. #1
    nghiatichxanh1992's Avatar
    Bài viết
    5,038
    Cấp độ
    Bang hội
    Tiếu Ngạo
    Tu luyện
    Độ kiếp Hư Thần
    Giới tính
    Con trai
    Join Date
    Jun 2012
    Đến từ
    Hà Giang
    Tuổi
    31
    Danh vọng
    10
    Điện thoại
    0367790762

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

    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.


    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ã:
    [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ã:
    [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ã:
    [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ã:
    [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ã:
    [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ã:
    [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ã:
    [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ã:
    [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ã:
    [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
    Lần sửa cuối bởi nghiatichxanh1992, ngày 21/09/2016 lúc 0:10.
    Diễn đàn chia sẻ kiến thức điện thoại: http://chiase123.com
    Click vào Hiện ra để xem chữ ký của mình

Thông tin về chủ đề này

Users Browsing this Thread

Có 1 người đang xem chủ đề. (0 thành viên và 1 khách)

Các Chủ đề tương tự

  1. Trả lời: 0
    Bài viết cuối: 27/12/2013, 12:01
  2. Trả lời: 0
    Bài viết cuối: 04/08/2013, 17:52
  3. [VPS Linux] Hướng dẫn cài cPanel 11 & WHM trên VPS Linux
    Bởi nghiatichxanh1992 trong diễn đàn PHP & MySQL
    Trả lời: 0
    Bài viết cuối: 01/10/2012, 20:13
  4. [VPS linux] Hướng dẫn cài cpanel Kloxo trên VPS linux Centos
    Bởi nghiatichxanh1992 trong diễn đàn PHP & MySQL
    Trả lời: 0
    Bài viết cuối: 01/10/2012, 20:07
  5. [VPS linux] Hướng dẫn cài cpanel Direct Admin trên VPS linux Centos
    Bởi nghiatichxanh1992 trong diễn đàn PHP & MySQL
    Trả lời: 0
    Bài viết cuối: 01/10/2012, 20:04

Tag của Chủ đề này

Quyền viết bài

  • Bạn Không thể gửi Chủ đề mới
  • Bạn Không thể Gửi trả lời
  • Bạn Không thể Gửi file đính kèm
  • Bạn Không thể Sửa bài viết của mình
  •