We often receive questions from our VPS users. my VPS does not have any new things. Why is my hard disk less used ?, This is mostly because of the long-term accumulation of various logs on the system, such as nginx, apache, and other access log information left behind for a long time, and the access traffic is large... information & n
We often receive questions from our VPS users, "my VPS is not equipped with new things. why is the harder the hard disk is to be used ?", This is mostly because of the long-term accumulation of various logs on the system, such as nginx, the access log information left behind by apache is not cleared for a long time, and the access traffic is large, it will easily expand to GB. sometimes the logs of some application programs are hidden in the depths of the file system, and it is hard to find out; sometimes I copy some large files and put them somewhere for a long time. In Linux, how does one find these files that occupy hard disk space? First, we can count the hard disk usage of each directory in the root directory and find the directory that occupies the most disk: region # du-sh/* 6.2 M/bin17M/boot136K/dev97M/region/home584M/lib16M/lib6416K/lost + region/media12K/mnt252K/opt0/proc1.7G/root28M/region/ selinux3.1M/srv0/sys20K/tmp1.9G/usr748M/var from the above we can see that/home occupies the most disk, let's see which users occupy the most space in/home: www.2cto.com # du-sh/home/* 4.0 K/home/bakw.m/home/cos28K/home/guest16K/home/lost + found105 G/home/vpsee33G/home/somebody8.2G/home/ abc
We can see that the user vpsee and his home directory/home/vpsee used the most hard drive (105 GB). let's see which files in/home/vpsee occupy space, run the following command to find out the files in a directory (/home/vpsee) with a size greater than 500 MB (print the first 40 rows and sort them in the ascending order of MB ): # find/home/vpsee-printf "% k % p \ n" | sort-g-k 1,1 | \ awk '{if ($1> 500000) print $1/1024 "MB" "$2} '| tail-n 40 647.68 MB/home/vpsee/linux/debian-504-amd64-CD-1.iso675.664MB/home/vpsee/linux/Fedora-13-i686-Live.iso677.656MB/home/vpsee/ unix/osol-0906-x86.iso678.172MB/home/vpsee/linux/ubuntu-10.04-server-amd64.iso700.133MB/home/vpsee/linux/ubuntu-10.04-desktop-i386.iso1304.64MB/home/vpsee/mac/MacTeX.mpkg.zip www.2cto.com
You can see that/home/vpsee is an iso favorites craze, and a bunch of Linxu ISO installation files have been collected. in the past, everyone liked to collect some software and tools stored on hard disks in the dial-up Internet era, now that the network is so developed, these old habits are no longer necessary, and ISO files are dispensable. when necessary, we will go to the next latest one. we don't need to keep it by ourselves. The network is our hard disk.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.