In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
This article is to share with you about what commands are used by linux to view disk space. The editor thought it was very practical, so I shared it with you as a reference. Let's follow the editor and have a look.
In linux, you can use the df command to view disk space. The df command can be used to check disk footprint, or disk usage, in the Linux file system.
Grammar
Df [options]... [FILE]...
Command parameters:
●-a,-- all contains all systems with 0 Blocks
●-- block-size= {SIZE} uses a Blocks of {SIZE} size
●-h,-- human-readable uses a human-readable format (the default value is not added with this option.)
●-H,-- si is a lot like-h, but in units of 1000 instead of 1024
●-I,-- inodes lists inode information, not block used
●-k,-- kilobytes is like-- block-size=1024.
●-l,-- local restricts the file structures listed
●-m,-- megabytes is like-- block-size=1048576
●-- no-sync does not sync before obtaining information (default)
●-P,-- portability uses the POSIX output format
●-- sync sync before obtaining the information
●-t,-- type=TYPE limits the TYPE that lists the file system
●-T,-- print-type displays the form of the file system
●-x,-- exclude-type=TYPE restricts listing file systems and does not display TYPE
●-v (ignore)
●-- help shows the helper and leaves
●-- version outputs version information and leaves
How do I use the df command to view disk space?
"if used without any parameters, the df command displays information about all mounted file systems:"
# df
Output:
Filesystem 1K-blocks Used Available Use% Mounted ondev 8172848 0 8172848 / devrun 8218640 1696 8216944 1% / run/dev/nvme0n1p3 222284728 183057872 27865672 87% / tmpfs 8218640 150256 80683842 / dev/shm/dev/nvme0n1p1 523248 107912 415336 21% / boot/dev/sda1 480588496 172832632 283320260 38% / data
Each line includes information about the file system name (Filesystem), size (1K-blocks), used space (Used), free space (Available), percentage of used space (Use%), and information about the directory in it that the file system is mounted (Mounted on).
By default, the df command displays disk space in 1 KB and the amount of used and available disk space in kilobytes. This is very inconvenient, how to display disk space usage in human-readable formats (megabytes and gigabytes)?
To view information in human-readable formats (megabytes and gigabytes), you need to pass the following-h option:
# df-h
Output:
Filesystem 1K-blocks Used Available Use% Mounted onFilesystem Size Used Avail Use% Mounted ondev 7.8G 0 7.8G 0% / devrun 7.9G 1.8m 7.9G 1% / run/dev/nvme0n1p3 212G 176G 27G 88% / tmpfs 7.9G 145m 7.7G 2% / dev/shm/dev/nvme0n1p1 511M 106M 406M 21% / boot/dev/sda1 459G 165G 271G 38% / data Thank you for your reading! This is the end of the command on how to view disk space in linux. I hope the above can be helpful to you, so that you can learn more knowledge. If you think the article is good, you can share it and let more people see it.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.