Shows space used by each directory of the root filesystem excluding mountpoints/external filesystems (and sort the output)

find / -maxdepth 1 -type d | xargs -I {} sh -c "mountpoint -q {} || du -sk {}" | sort -n
Useful to see at glance which directory under the root file is using most space
Sample Output
[root@server ~]# df -h
Filesystem               Size  Used Avail Use% Mounted on
/dev/mapper/vm-root       18G  7.8G   11G  44% /
devtmpfs                 1.3G     0  1.3G   0% /dev
tmpfs                    1.3G     0  1.3G   0% /dev/shm
tmpfs                    1.3G  9.5M  1.3G   1% /run
tmpfs                    1.3G     0  1.3G   0% /sys/fs/cgroup
/dev/sda1               1014M  287M  728M  29% /boot

[root@server ~]# find / -maxdepth 1 -type d | xargs -I {} sh -c "mountpoint -q {} || du -sk {}" | sort -n
0       /mnt
0       /srv
0       /vbox_share
212     /tmp
256     /root
48856   /etc
72692   /media
177668  /opt
933676  /home
2238568 /var
4586604 /usr

By: acavagni
2019-03-04 11:59:10

2 Alternatives + Submit Alt

What Others Think

So I can say I am happy I was forced over here at gunpoint by Albanian women I do like this blog.........
krakcker · 96 weeks and 1 day ago
I think this is good work. Through this website, I have learned many new things. It cleared my academic writing service USA all concepts. It is a very helpful website, especially for beginners.
monicajesvina · 94 weeks ago
The root catalog which is alluded to as/(a cut) is the highest degree of the License Renewal In Dubai framework drive while the Home registry which is/Users/ (additionally alluded to as ~) goes under the root index.
lizaaajamesss · 46 weeks and 3 days ago
The root registry is a catalog in Unix-like working frameworks that contain any remaining indexes and">Trading Software Companies in UAE records on a framework and is set apart by a slice (/). The record framework is the progressive system of catalogs used to arrange documents on a PC.
abdullhashaikh · 46 weeks and 2 days ago
wow! tnx for this job. i do not now about this
waylanmarx · 44 weeks and 3 days ago
very creative creative funding
geebranz · 29 weeks ago
Upload every other disk to the server, and mount it in region of a directory this is closely used on the whole filesystem. That is a submit-installation repartitioning method Online Payroll Software Companies In Pakistan. /dev/sda2 / (root) - that is the filesystem this is complete. In this example the /var listing is taking over an excessive amount of space.
shaikhaliict · 25 weeks and 2 days ago
As soon as the report gadget is attached, the mount point turns into the basis directory of the established document gadget. As an example, to mount the /dev/sdb1 report machine to the">Inventory Software in Dubai /mnt/media listing you would use: usually when mounting a device with a commonplace record device consisting of ext4 or xfs the mount command will auto-detect the report machine type.
abdullhashaikh · 25 weeks and 1 day ago
Additionally, you can locate the quantity of disk space taken up by means of consumer bills ... shows the size of each listing you specify, along with each subdirectory.">Get Your Assignment Done If your difficult power is fuller than it needs to be, you in all likelihood have to manually test the size of each folder on your drives.
jhonselvick · 25 weeks and 1 day ago
The contents of the foundation filesystem need to be good enough to boot, repair, get better, and/or repair the [url=]HR Software Companies in UAE[/url] gadget. Besides a machine, sufficient need to be gift on the foundation partition to mount other filesystems.
abdullhashaikh · 25 weeks ago
????? ???? ?????????
tomday · 3 weeks and 1 day ago
Google Play Google Play Apk google play
tomday · 3 weeks and 1 day ago
Do you enjoy games that are action-packed and entertaining? The slope game is a challenging running game that will test your abilities. On a randomized slope, speed down. The faster your ball travels, the further you go. This game may appear simple, but it will provide you with a high level of adrenaline. Just remember to stay away from the red blocks and obstacles. Always aim for a high score, and you might find yourself on the leaderboard.
stephen645 · 2 weeks and 5 days ago

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this? is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands

Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.


Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: