Quantcast
Channel: openSUSE Planet - Global
Viewing all articles
Browse latest Browse all 23310

Felix-Nicolai Müller: How to quickly identify the ten largest folders in Linux

$
0
0

If you quickly want to get an overview of which folders and / or files use up the most space in a certain folder there is a really easy pipe of commands you can use, that should come with basically all of the linux distributions – no installation required therefore.

  1. The first part will list all the files in a human readable format and their respective space consumption in the folder /tmp:
    “du -hsc /tmp/*”
  2. This output will be sorted from largest to smallest files / folders using the sort command:
    “sort -nr”
  3. This output can be reduced to the top ten entries by using the head command

By piping these commands together, you get a nice, little, quick overview:
“du -hsc /tmp/* | sort -nr |head”

UPDATE:

After Mikes’ comment, I now recommend to use the following command. See the comments section for details:
“du -hsc /* | sort -nr | head”


Viewing all articles
Browse latest Browse all 23310


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>