No problem, just execute the following:
find / -type f -size +500000k -exec ls -lh {} \; | awk '{ print $9 ": " $5 }'
In the example above, I am looking for all files over 500MB in size (500000k, where k = kilobytes). The place where I have typed "/" in the above command indicates the path to search in. By selecting "/" I am searching in the entire filesystem; I could easily indicate a specific directory by changing my command as follows:
find /path/to/my/directory -type f -size +500000k -exec ls -lh {} \; | awk '{ print $9 ": " $5 }'
Alternatively, I could search in my current directory by replacing "/" with "." like so:
find . -type f -size +500000k -exec ls -lh {} \; | awk '{ print $9 ": " $5 }'
Easy!
No comments:
Post a Comment