Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the commands related to disk space and file size under Linux

2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly explains the "Linux and disk space and file size-related commands are", the article explains the content is simple and clear, easy to learn and understand, the following please follow the editor's ideas slowly in depth, together to study and learn "Linux and disk space and file size-related commands have" it!

Ls-al

This command is all too familiar, you can display the details of all the files and directories in the current directory, and you can directly see which files in the current directory take up more disk space. Well, it tastes better if you add the-h option.

Stat

The stat command can display more detailed information about a specified file / directory, including size, block, inode, creation / access / modification time, and so on.

Df

The df command is an abbreviation for the word disk free and is used to show the free space of the current disk. Several common options are:

Df-h: displays the free disk space in a user-friendly manner.

Df-a: shows the full disk usage, including those disk areas where free space is 0.

Df-T: shows disk usage by file system type, such as xfs, ext2, ext3, btrfs, and so on.

Df-I: displays used and idle inodes.

In addition to using the command line, you can also use a graphical tool called disks. Using this tool, you can see the usage of the disk visually.

Du

Du is the abbreviation of the English phrase disk useage, which shows the use of files, directories, and other elements on disk. The common uses are as follows:

Du-h: displays the usage of all directories and subdirectories in a format that is easy for humans to read

Du-a: displays the disk usage of all files in the current directory

Du-s: only the totals are displayed and only the last plus values are listed. (used to display the size of the directory)

Fdisk-l

Fdisk is a program that creates and maintains partition tables that are compatible with partition tables of type DOS or disk lists of type BSD or SUN. The fdisk-l command can display all kinds of information about disk partitions.

Friends who are messing around with the excessive area table should be familiar with this step, and then there are operations related to partition creation, deletion, modification, and so on. But here, we just use the-l option to take a look at the current partition and take no further action.

As a friendly reminder, if you do not know how to operate zoning, do not use other options of fdisk at will, it may bring devastating harm, and it may be too late to run away.

Thank you for your reading, the above is the "Linux and disk space and file size-related commands have" of the content, after the study of this article, I believe you on the Linux and disk space and file size-related commands have a more profound understanding of this problem, the specific use of the need for you to practice and verify. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

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: 205

*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.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report