How to check your disk space usage if it is near full?

timothykiko

Member
Registered
Joined
Dec 23, 2016
Messages
25
Points
1
How can I check my disk space storage if it is near full via SSH with commands? I am afraid my disk on my VPS hosting will be full soon because I upload too many files to it today.
 

ZenHosting

Member
Registered
Joined
Apr 26, 2016
Messages
64
Points
8
Hi timothykiko,

If you run the command "df -h", you'll see how much space you have used.

You could also download and use a disk usage analyser package like Ncdu.

It's relatively easy to install and is user-friendly.
 

LJSHost

Well-known member
Hosting Provider
Registered
Joined
Jul 5, 2016
Messages
1,031
Points
63
I agree with ZenHosting Ncdu is a excellent but if you want to dig down in as much detail as possible I would suggest you try the find command also.

You can use find piped into various commands to achieve the same thing, here is a nice little example of using find to display all files larger on / than a certain file ordered by file size.

Code:
 find / -size +1M | xargs ls -lh | sort -k 5 -n -r | awk '{ $1="";$2="";$3="";$4="";$6="";$7="";$8="";print}'
output

Code:
    128M    /sys/devices/pci0000:00/0000:00:02.0/resource0_wc
    128M    /sys/devices/pci0000:00/0000:00:02.0/resource0
    128T    /proc/kcore
    33M    /var/lib/apt/lists/ftp.uk.debian.org_debian_dists_jessie_main_binary-amd64_Packages
    32M    /var/lib/apt/lists/ftp.uk.debian.org_debian_dists_jessie_main_source_Sources
    23M    /usr/lib/x86_64-linux-gnu/libicudata.so.52.1
    23M    /var/cache/apt/srcpkgcache.bin
    23M    /var/cache/apt/pkgcache.bin
    22M    /var/lib/apt/lists/ftp.uk.debian.org_debian_dists_jessie_main_i18n_Translation-en
    21M    /var/cache/apt/archives/g++-4.9_4.9.2-10_amd64.deb
    18M    /var/lib/mysql/ibdata1
    17M    /usr/lib/gcc/x86_64-linux-gnu/4.9/cc1plus
    16M    /usr/lib/gcc/x86_64-linux-gnu/4.9/cc1
    15M    /usr/lib/gcc/x86_64-linux-gnu/4.9/lto1
    15M    /boot/initrd.img-3.16.0-4-amd64
    15M    /var/log/installer/cdebconf/templates.dat
    12M    /usr/sbin/mysqld
    6.2M    /lib/udev/hwdb.bin
    5.2M    /var/cache/apt/archives/gcc-4.9_4.9.2-10_amd64.deb
    5.1M    /usr/share/doc/gcc-4.9-base/test-summaries/gcc.log.xz
    5.0M    /var/lib/mysql/ib_logfile0
    5.0M    /var/lib/mysql/ib_logfile1
    5.0M    /var/cache/apt/archives/cpp-4.9_4.9.2-10_amd64.deb
    4.9M    /var/cache/apt/archives/vim-runtime_2%3a7.4.488-7+deb8u1_all.deb
    4.7M    /usr/lib/x86_64-linux-gnu/libc.a
    4.4M    /usr/bin/aptitude-curses
    4.4M    /usr/share/doc/gcc-4.9-base/test-summaries/g++.log.xz
    4.3M    /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0.2400.25
    4.0M    /run/log/journal/17683b8ea2354c169d44e88986b5d099/system.journal
    4.0M    /sys/devices/pci0000:00/0000:00:04.0/resource1
    3.8M    /usr/share/GeoIP/GeoIPv6.dat
    3.7M    /usr/bin/python2.7
    3.6M    /usr/bin/mysql_client_test
    3.5M    /usr/bin/mysqltest
    3.5M    /usr/share/i18n/locales/C
    3.4M    /usr/bin/mysql
    3.4M    /var/cache/apt/archives/binutils_2.25-5_amd64.deb
    3.3M    /usr/bin/mysql_upgrade
    3.3M    /usr/bin/mysqldump
    3.3M    /usr/bin/mysqlbinlog
    3.3M    /var/cache/apt/archives/mysql-server-core-5.5_5.5.53-0+deb8u1_amd64.deb
    3.3M    /usr/lib/x86_64-linux-gnu/libmysqlclient.so.18.0.0
    3.2M    /usr/bin/mysqlslap
    3.2M    /usr/bin/mysqlshow
    3.2M    /usr/bin/mysqlimport
    3.2M    /usr/bin/mysqlcheck
    3.2M    /usr/bin/mysqladmin
    3.2M    /usr/bin/myisamchk
    3.2M    /usr/lib/gcc/x86_64-linux-gnu/4.9/libstdc++.a
    3.1M    /usr/bin/myisampack
    3.1M    /usr/bin/myisamlog
    3.1M    /usr/bin/myisam_ftdump
    3.1M    /var/cache/debconf/templates.dat-old
    3.1M    /var/cache/debconf/templates.dat
    3.0M    /boot/vmlinuz-3.16.0-4-amd64
    3.0M    /usr/share/file/magic.mgc
    3.0M    /usr/lib/gcc/x86_64-linux-gnu/4.9/libgcc.a
 
Older Threads
Replies
1
Views
2,027
Replies
14
Views
4,670
Replies
2
Views
1,977
Newer Threads
Recommended Threads

Latest Hosting OffersNew Reviews

Sponsors

Tag Cloud

You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an alternative browser.

Top