Feedback

type to search

How to clean up unnecessary files

Asked by

Please suggest me any particular unnecessary file that I can clean to back everything to normal condition(temporarily). (i.e. any log or archieve or anything ). My var/log has only 40MB and Home directory has 3GB of space(so I believe that’s not a problem). Other than that what I can clean up to make space.


    [user@host]$ df -h
    Filesystem            Size  Used Avail Use% Mounted on
    /dev/mapper/vginamivm-lvroot
                           18G   17G     0 100% /
    tmpfs                 1.9G     0  1.9G   0% /dev/shm
    /dev/sda1             485M   71M  389M  16% /boot

or Cancel

4 answers

1

tuxedoar from Buenos Aires, Argentina

If you are unsure whether files eating your disk space still exist, try the following command:


find / -size +100M


This example will find files whose size is greater than 100MB. By the way, ncdu is a very nice CLI tool to find which files are filling your disk space.

Another thing to check is whether a process is still holding a file that was being used at the time of removal. You can check this by using lsof command.

If none of these work, check the root filesystem. It could be broken!.

Cheers!.    


or Cancel
0

burkhardpranke from Unknown

40MB for /var/log is indeed not too much of space. the log files are very good if you want to figure what your system is doing, esp if something goes wrong. on the other hand your system does not need them. you could delete them, if you want (actually you might want to copy them somewhere else, to your home directory, or wherever you have space).


another tool to figure where your space is gone to is filelight.

if your ../cache/apt directory is on the same partition, then your best option might be to go with aptitude autoclean (as descibed above). /var/cache/apt usually takes up much more space than /var/log (on my system: /var/log 25 MB, /var/cache/apt: 1GB)
NN comments
or Cancel
0

tictacbum

you can use du to find which are the big directories

    du -sh /
    du -sh /var/

    …

then depending where it is used you can decide what to do

also you can find which packages take more space and uninstall them if you are not using them, you can list installed packages, sorted by disk usage with

   

dpkg-query -W —showformat=‘${Installed-Size;10}\t${Package}\n’ | sort -k1,1n

   
or Cancel

Your answer

You need to join Debian to complete this action, click here to do so.