See the file size, file size, and other details (Du and DF) using commands under Linux

Source: Internet
Author: User
Tags readable disk usage

First, view the file as the disk size generally use the du or DF command

DF Command: used to display the available disk space on a disk partition . The default display unit is KB. You can use this command to get information about how much space the hard disk is taking up, and how much space is left.

du command: Look at the space used, but unlike the DF command, the linux du command is a view of the space used by the file and directory disks , or some difference from the DF command.  

DF Command: Displays the available disk space on the disk partition.

df[options [Parameters]
Options:
1 -A or -- All: Contains all the file systems;2 --block-size=< block size > : Displays the number of chunks in the specified chunk size;3 - H or--human- readable: Display information in a more readable manner;4 - H or --si andThe h parameter is the same, but it is calculated with the Bytes as the conversion unit rather than the Bytes;5 - I. or -- inodes: Displays the Inode information and displays the usage status;6 - k or -- kilobytes: Specifies a chunk size of 1024 bytes;7 - L or -- Local: Displays only the file system on the native side;8 - m or -- Megabytes: Specifies a chunk size of 1048576 bytes;9 --no-sync: Do not perform sync instructions before obtaining disk usage information, this is a preset value;Ten - P or -- Portability: Using the POSIX output format; One --sync: Perform the sync instruction before obtaining the disk usage information; A - T< file system type > or --type=< file system type >: Displays only disk information for the specified file system type; - - t or --print- Type: Displays the types of file systems; - -x< file System type > or --exclude-type=< file system type >: Do not display disk information for the specified file system type; the -- Help: Display assistance; - --version: Displays version information.

Parameters:
file: Specifies the file on the file system.

1[[Email Protected]_zh ~]#df-h#使用-The h option is displayed in units above KB, and is highly readable2Filesystem Size used Avail use%mounted on3/dev/mapper/vg_vm-lv_root 18G8.5G7.9G the% /4Tmpfs 494M 80K 494M1%/dev/SHM5/DEV/SDA1 477M 55M 397M -% /Boot
6[[Email Protected]_zh ~]#DF#查看系统磁盘设备, the default is KB7Filesystem 1k-blocks used Available use%mounted on8/dev/mapper/vg_vm-lv_root18003272 8864096 8217988 the% /9Tmpfs505724 the 505644 1%/dev/SHMTen/dev/sda1487652 56051 406001 -% /Boot
One[[Email Protected]_zh ~]#df-h#使用-The h option is displayed in units above KB, and is highly readable AFilesystem Size used Avail use%mounted on -/dev/mapper/vg_vm-lv_root 18G8.5G7.9G the% / -Tmpfs 494M 80K 494M1%/dev/SHM the/DEV/SDA1 477M 55M 397M -% /Boot
-[[Email Protected]_zh ~]#DF- a #查看所有文件系统 -Filesystem 1k-blocks used Available use%mounted on -/dev/mapper/vg_vm-lv_root18003272 8864096 8217988 the% / +Proc0 0 0- /proc -Sysfs0 0 0- /SYS +Devpts0 0 0-/dev/pts ATmpfs505724 the 505644 1%/dev/SHM at/dev/sda1487652 56051 406001 -% /Boot -None0 0 0-/proc/sys/fs/Binfmt_misc -Gvfs-fuse-daemon0 0 0-/root/. Gvfs

du command: to view the space used, thedu command is a view of the space used by the file and directory disks.

du [Options] [file]
1 - H or --human- readable: To improve the readability of the information in the K,M,G unit. 2 -B or - bytes: When displaying a directory or file size, in bytes. 3 - H or --siandThe h parameter is the same, but the k,m,g is converted to 1000 units. 4 - s or --separate- dirs: When displaying the size of an individual directory, it does not contain the size of its subdirectories. 5 -  k or --  kilobytes: Output in kilobytes (1024bytes). 6 -  m or --  Megabytes: output in megabytes. 7   -A or - All  : Displays the size of individual files in the directory. 8 -  C or --  Total: Displays the sum of all directories or files in addition to the size of individual directories or files. 9 -  s or --  Summarize: Displays totals only, listing the last plus total values only. Ten -  x or --one-file-  xystem: The file system at the beginning of processing, if encountered in other different file system directory is skipped.  One -  L< Symbolic links > or --dereference< Symbolic links >:Displays the source file size of the symbolic link specified in the options.  A -  x< files > or --exclude-from=< files >: In < files >specifies a directory or file.  -  --exclude=< directories or files >:Skips over the specified directory or file.  - -  D or --dereference-  args: Displays the size of the source file for the specified symbolic link.  the -  l or --count-links : Duplicate the hardware linked file.

See the file size, file size, and other details (Du and DF) using commands under Linux

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.