os/Linux

How to check Disk usage and CPU/memory usage

cskimair 2020. 5. 19. 11:58

# top -b -n 1

 

# df -mhT


ardorworx@ardorworx:~$ top -b -n 1 | grep Mem
MiB Mem :  31978.8 total,  21272.6 free,   6024.3 used,   4681.9 buff/cache
MiB Swap:   2048.0 total,   2048.0 free,      0.0 used.  25504.1 avail Mem
ardorworx@ardorworx:~$
ardorworx@ardorworx:~$ df -mhT
Filesystem     Type      Size  Used Avail Use% Mounted on
udev           devtmpfs   16G     0   16G   0% /dev
tmpfs          tmpfs     3.2G  1.8M  3.2G   1% /run
/dev/sda2      ext4      457G   13G  421G   3% /
tmpfs          tmpfs      16G     0   16G   0% /dev/shm
tmpfs          tmpfs     5.0M  4.0K  5.0M   1% /run/lock
tmpfs          tmpfs      16G     0   16G   0% /sys/fs/cgroup
/dev/loop1     squashfs   55M   55M     0 100% /snap/core18/1754
/dev/loop2     squashfs   63M   63M     0 100% /snap/gtk-common-themes/1506
/dev/loop3     squashfs   50M   50M     0 100% /snap/snap-store/433
/dev/loop0     squashfs   55M   55M     0 100% /snap/core18/1705
/dev/loop4     squashfs  241M  241M     0 100% /snap/gnome-3-34-1804/24
/dev/loop5     squashfs  256M  256M     0 100% /snap/gnome-3-34-1804/33
/dev/loop6     squashfs   28M   28M     0 100% /snap/snapd/7264
/dev/sda1      vfat      511M  7.8M  504M   2% /boot/efi
tmpfs          tmpfs     3.2G   24K  3.2G   1% /run/user/1000
tmpfs          tmpfs     3.2G  4.0K  3.2G   1% /run/user/1001
ardorworx@ardorworx:~$ df -mhT | grep sda2
/dev/sda2      ext4      457G   13G  421G   3% /
ardorworx@ardorworx:~$

 

https://askubuntu.com/questions/432836/how-can-i-check-disk-space-used-in-a-partition-using-the-terminal-in-ubuntu-12-0

 

How can I check disk space used in a partition using the terminal in Ubuntu 12.04 LTS?

I am using Ubuntu 12.04 LTS and I was wondering if there is a command that can tell the space used in a partition using the terminal. Like I want to use the su command to change to a user called ad...

askubuntu.com

>

You can also use pydf or discus to get better representation in terminal. You need to install these if you want to use it. Type:

sudo apt-get install pydf 

in terminal to install pydf.

$ pydf

Filesystem Size Used Avail Use% Mounted on

/dev/sda9 22G 16G 4893M 72.7 [#########################.........] /

/dev/sda7 103G 90G 13G 87.2 [##############################....] /media/Data

/dev/sda6 69G 34G 35G 49.3 [#################.................] /media/Movies

/dev/sda5 53G 34G 19G 64.5 [######################............] /media/Songs

/dev/sda1 49G 35G 14G 71.9 [########################..........] /media/guru/0C64A7F864A7E326