1. Introduction to Commands
du (disk usage) calculates the disk usage for each file, and the directory takes the total amount.
2. Usage
Usage:du [options] ... [File] ... Or:du [options] ...--files0-from=f
3. Options
4. Example 1: Show the size of a single file (k by default)
Du4 sendim.py
Example 2: Displaying file sizes in a humane way
du -4. 0K sendim.py
Example 3:-k display file size in units
du -4 sendim.py
Example 4:-s option sum sum
du -sh ./1.6M ./
Example 5: Output the space used by each subdirectory under the current directory
[Email protected] ~]#du--max-depth=14./Templates -./. GCONFD -./. Gnome24./Image284./. gconf4./Document4./of public4./Dir14./Music4./. ABRT4./Video384./.gstreamer-0.10 -./. Gnote184./. Cache -./. GnuPG4./Download148./. Pulse +./. config A./. Dbus -./study148./. Local4./. Gvfs4./. Nautilus8./.SSH A./Desktop1620.
One Linux command per day: Du