Difference between revisions of "Du"

From Linuxintro
imported>ThorstenStaerk
(New page: The command du allows you to find out the '''d'''isk space '''u'''sed by a file: # du -csh * 1.2M CMakeFiles 4.0K CMakeLists.txt 8.0K CMakeTmp 4.0K browser.cpp 4....)
 
imported>ThorstenStaerk
Line 16: Line 16:
  
 
= See also =
 
= See also =
 +
* [[df]] - disk free space
 +
* [[ls]] - list files
 +
* [[commands]] - other commands
 
* [http://man-wiki.net/index.php/Du The du man page]
 
* [http://man-wiki.net/index.php/Du The du man page]

Revision as of 06:53, 1 April 2009

The command du allows you to find out the disk space used by a file:

# du -csh *
1.2M    CMakeFiles
4.0K    CMakeLists.txt
8.0K    CMakeTmp
4.0K    browser.cpp
4.0K    browser.h
4.0K    main.cpp
1.3M    total

The difference to ls -l is that you can get a total and that directories are also shown with the correct size.

# ls -ld CMakeFiles/
drwxr-xr-x 7 root root 4096 Feb 14 10:12 CMakeFiles/
# du -csh CMakeFiles/
1.2M    CMakeFiles/
1.2M    total

See also