Prints the sizes of all the subdirectories (sorted by size), similar to Treesize utility. https://superuser.com/questions/554319/bash-display-each-sub-directory-size-in-a-list-format-using-1-line-command Show Sample Output
i'm using -x : -x, --one-file-system skip directories on different file systems so mounts points aren't walked trough Show Sample Output
-s summary -h human slightly different : will display side by side the sizes of individual files and of directories in current dir will not display total size of './'
Very useful for finding the largest files and subdirectories at any given point. Any user can run it from current location just when need to know their largest files and subtdirectories from a certain point down as well. Show Sample Output
Thanks for the submit! My alternative produces summaries only for directories. The original post additionally lists all files in the current directory. Sometimes the files, they just clutter up the output. Once the big directory is located, *then* worry about which file(s) are consuming so much space.
first 10 big file
Calculate foldersize for each website on an ISPConfig environment. It doesn't add the jail size. Just the "public_html". Show Sample Output
Show the top file size in human readable form
All folders, human-readable, no subfolder, with a total. Even shorter.
Also shows files as they are found. Only works from a tty.
centos list directories sorted by size Show Sample Output
Other solutions that involve doing
du -sx /*
are incomplete because they will still descend other top-level filesystems are that mounted directly at "/" because the * expands to explicitly include all files and directories in "/", and du will still traverse them even with -x because you asked it to by supplying the directory name as a parameter (indirectly via "*").
Show Sample Output
A simple way using a for loop
This command produces the output of "du -sk testfile" in every 10 seconds. You can change the command to be whatever you want.
commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.
Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.
» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10
Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):
Subscribe to the feed for: