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

How to use du and df commands in linux

2025-01-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

Editor to share with you how to use the du and df commands in linux, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!

Du command

Du (short for disk usage) is a command used to find disk usage of files and directories. The du command provides results in multiple formats when used with various options.

Here are some examples:

1. Get the disk usage overview of all subdirectories under a directory $du / home

Du command

The output of this command displays all files and directories in / home, as well as the block size.

2. Display the file / directory size $du-h / home in human-readable format such as kb, mb, etc.

Du command

3. The total disk size of the directory $du-s / home

Du command

It is the total size of the / home directory

Df command

Df (short for disk filesystem) is used to display the disk utilization of the Linux system. LCTT translation note: df may be the abbreviation of disk free. )

Here are some examples.

1. Displays the device name, total number of blocks, total disk space, used disk space, available disk space, and mount points on the file system. $df

Df command

2. Information in human readable format $df-h

Df command

The above command displays information in a human-readable format.

3. Display the information of a specific partition $df-hT / etc

Df command

-hT plus the target directory will display the information of / etc in a readable format.

The above is all the contents of this article entitled "how to use du and df commands in linux". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

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.

Share To

Servers

Wechat

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

12
Report