If you want to display the biggest file sizes only, then run the following command:
# find -type f -exec du -Sh {} + | sort -rh | head -n 5
To find the largest files in a particular location, just include the path besides the find command:
# find /home/tecmint/Downloads/ -type f -exec du -Sh {} + | sort -rh | head -n 5
OR
# find /home/tecmint/Downloads/ -type f -printf "%s %p\n" | sort -rn | head -n 5
The above command will display the largest file from /home/tecmint/Downloads directory.
# find -type f -exec du -Sh {} + | sort -rh | head -n 5
To find the largest files in a particular location, just include the path besides the find command:
# find /home/tecmint/Downloads/ -type f -exec du -Sh {} + | sort -rh | head -n 5
OR
# find /home/tecmint/Downloads/ -type f -printf "%s %p\n" | sort -rn | head -n 5
The above command will display the largest file from /home/tecmint/Downloads directory.
No comments:
Post a Comment