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:
Find top 5 big files
There is 1 alternative - vote for the best!
zsh: list of files sorted by size, greater than 100mb, head the top 5. '**/*' is recursive, and the glob qualifiers provide '.' = regular file, 'L' size, which is followed by 'm' = 'megabyte', and finally '+100' = a value of 100
This command is more robust because it handles spaces, newlines and control characters in filenames. It uses printf, not ls, to determine file size.
If you can do better, submit your command here.
You must be signed in to comment.