In Linux and UNIX Environments often times there may be need to clean up filesystem space as it is full. So you will have to identify the files which are huge in size which needs to be checked and them cleaned. For finding the large files which in the file system below command can be used.
Above command will search for all files inside /tmp which are over 50kb in size and then sort them by size and display.
You can change the /tmp to any directory where you want to search for the large files. In case you want to search inside all the directories / filesystems you can specify /. For e.g. as shown below.
All Linux and UNIX Environments.
find /tmp -type f -size +50k -exec ls -lh {} \; | sort -n -r
Above command will search for all files inside /tmp which are over 50kb in size and then sort them by size and display.
You can change the /tmp to any directory where you want to search for the large files. In case you want to search inside all the directories / filesystems you can specify /. For e.g. as shown below.
find /-type f -size +50k -exec ls -lh {} \; | sort -n -r
Products to which Article Applies
tarun boyella
No comments:
Post a Comment