commandlinefu.com is the place to record those command-line gems that you return to again and again.
You can sign-in using OpenID credentials, or register a traditional username and password.
Subscribe to the feed for:
Parsing the output of ls is never a good idea for any reason. Using find this way:
- works with files that have spaces in their names.
- actually lists "sub folders" and not of all files and folders.
- does not break if there are a huge number of files in the current directory.
There are 2 alternatives - vote for the best!
This allows the output to be sorted from largest to smallest in human readable format.
If you can do better, submit your command here.
You must be signed in to comment.