Wednesday, February 2, 2011

7) Listing files by size

If you want to have a listing of the files sorted by size, you can use the following command(s), it will list the files in decrease order. if you need to do the same thing recursively, you could use the second one.

ls -l | grep ^- | sort -nr -k 5 | more

ls -lR | grep ^- | sort -nr -k 5 | more

No comments:

Post a Comment