Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Slackware This Forum is for the discussion of Slackware Linux.


  Search this Thread
Old 12-16-2004, 06:29 AM   #1
Registered: Jan 2004
Location: Cebu City, Philippines
Distribution: Slackware 10,Gentoo 2005.1,LFS
Posts: 92

Rep: Reputation: 15
Cleaning up Harddisk

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.
Old 12-16-2004, 06:42 AM   #2
Senior Member
Registered: Jul 2004
Distribution: Ubuntu 7.04
Posts: 1,991

Rep: Reputation: 76
The ls command has options to sort files by size and by name. See
man ls
You might want to pipe its output through head if you're just interested in the biggest/oldest files:
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.
Old 12-16-2004, 07:43 AM   #3
Senior Member
Registered: Sep 2003
Location: Egypt
Distribution: Arch
Posts: 1,528

Rep: Reputation: 47
u could also delete old logs from /var

and if u use swaret then u could delete its cache
Old 12-16-2004, 09:27 PM   #4
Senior Member
Registered: Jan 2003
Location: Malaysia
Distribution: Fedora Core, Slackware, Mac OS X, Debian, OpenSUSE
Posts: 1,210
Blog Entries: 4

Rep: Reputation: 45
du -h [filename]

will give you the disk usage of the file in -human readable (not super engineer/comp science numbers) size.
Old 12-16-2004, 09:37 PM   #5
Registered: May 2004
Distribution: Ubuntu
Posts: 583

Rep: Reputation: 33
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
Old 12-16-2004, 10:30 PM   #6
Senior Member
Registered: Nov 2002
Location: Stockton, CA
Distribution: Slackware 11 - kernel - Dropline Gnome 2.16.2
Posts: 1,132

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

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.
Old 12-16-2004, 11:11 PM   #7
Registered: May 2003
Distribution: Slackware
Posts: 209

Rep: Reputation: 141Reputation: 141
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 )


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Cleaning up an old PC Merlyn Linux - Hardware 8 10-25-2005 07:33 AM
cleaning up the mess Shade00 Linux - Newbie 3 05-10-2004 01:20 AM
Low Harddisk space. Can I just transfer the entire Linux to a bigger harddisk? davidas Linux - Newbie 12 04-13-2004 03:03 AM
cleaning up? phonecian Linux - Software 1 10-19-2003 07:27 AM
house cleaning adam_boz Linux - General 3 08-10-2002 06:49 PM > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 12:45 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration