Show information of directory or disk

There are so many commands of Ubuntu, we just need to know useful and high-frequency commands. I have collected a little common commands which may be  useful for you in the future.

Check the size of directory

sudo df -h #show the current info of partitions
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda2        40G  2.9G   35G   8% /
udev            2.0G  4.0K  2.0G   1% /dev
tmpfs           790M  864K  789M   1% /run
none            5.0M     0  5.0M   0% /run/lock
none            2.0G  152K  2.0G   1% /run/shm
none            100M   40K  100M   1% /run/user
sudo du
/home/pinxiong/ --max-depth=1 -h #show the first-level sub-directory info in directory '/home/pinxiong' 4.0K /home/pinxiong/Templates 43M /home/pinxiong/.mozilla 4.0K /home/pinxiong/Pictures 32K /home/pinxiong/.gconf 32K /home/pinxiong/.pulse 4.0K /home/pinxiong/Downloads 12K /home/pinxiong/.mission-control 444K /home/pinxiong/.local 120K /home/pinxiong/.config 4.0K /home/pinxiong/Public 4.0K /home/pinxiong/Videos 4.0K /home/pinxiong/Documents 12K /home/pinxiong/.dbus 716K /home/pinxiong/.cache 4.0K /home/pinxiong/Music 4.0K /home/pinxiong/Desktop 8.0K /home/pinxiong/.gnome2 44M /home/pinxiong/
sudo du
/home/pinxiong/ -sh #show the size of directory '/home/pinxiong' 44M /home/pinxiong/
原文地址:https://www.cnblogs.com/pinxiong/p/3690174.html