LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Cleaning up Harddisk (https://www.linuxquestions.org/questions/slackware-14/cleaning-up-harddisk-266973/)

d00msweek 12-16-2004 05:29 AM

Cleaning up Harddisk
 
Hello,
Any tips on how to/ what to delete from my harddisk ? Any command that can list the file that has the biggest size ? Any command that can list the file that is rarely accessed ? Thanks.

rjlee 12-16-2004 05:42 AM

The ls command has options to sort files by size and by name. See
Code:

man ls
You might want to pipe its output through head if you're just interested in the biggest/oldest files:
Code:

ls -lS | head
In general, anything under /tmp can be deleted if it's not being used (i.e. if you physically can delete it). You might also want to look at mounting a tmpfs partition on /tmp to save disk space if you can tolerate putting your temporary files in RAM.

gzexe will reduce the size of an executable file, at the cost of it taking longer to start up.

heema 12-16-2004 06:43 AM

u could also delete old logs from /var

and if u use swaret then u could delete its cache

carboncopy 12-16-2004 08:27 PM

du -h [filename]

will give you the disk usage of the file in -human readable (not super engineer/comp science numbers) size.

ror 12-16-2004 08:37 PM

If you want a gui app there's a great little app called filelight, which is a recursive pie-chart type thing so you can quickly find rogue huge files or folders you'd forgotten about (such as ISOs you'd forgotten about).

Alternatively just browse through /var/log/packages and see which you might not want

shilo 12-16-2004 09:30 PM

Code:

du -S | sort -n
This will list all your directories, smallest to largest. Not exactly what you were looking for, but handy, nonetheless.

Code:

cd /
ls -lR | sort +4n

This will give you by individual file. Both are handy. For instance, if you look only at individual files, you may not realize how large your thumbnail directory is.

magicm 12-16-2004 10:11 PM

This will recursively travel your directory tree from wherever you enter it,
listing all the files, and sort them by size with the largest ones first

find . -type f -ls | sort -n -r -k 7,7

you may want to pipe the output to a file (or more or less).
'man find' should give you hints on how to modify it for this to deal with finding files rarely accessed ( which would probably mean 'man sort' to change that part )


All times are GMT -5. The time now is 05:52 PM.