Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
A Different Kind of Cruft
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
lousyd
Apprentice
Apprentice


Joined: 15 Mar 2003
Posts: 166
Location: Des Moines

PostPosted: Sat Nov 19, 2005 4:27 pm    Post subject: A Different Kind of Cruft Reply with quote

All the cruft scripts out there find unused files and old stuff. What they don't find is your personal files that you really don't need anymore. Well, neither does this tip/trick. But I do have a first step. When I need to delete files to make space, I use this following incantation. It recursively searches the current working directory, compiling disk usage statistics, and then tells you where the disk hogs are. For example, I have movies on my disk that I would like to keep there, but I'm willing to delete (or move off-disk) one or two to get myself a couple gigs of space. This utile one-liner lets me focus my consideration on the stuff that will count.

Code:
alias ducks='du -ckxs * |sort -rn |head -n 11'


Code:
lousyd@bigboss ~/movies/feature $ ducks
4615637 total
1016444 rambo3.vob
794059  nobody-needs-to-know/
741163  The Cyberpunk Educator.avi
691879  The Man in the White Suit (1951).avi
666110  Ghost In The Shell 2 - Innocence.avi
460665  field-trip-west-siberia-avi/
244615  blue-a-short-film/
704     Cleopatra.avi


I got this ducks trick from the fine folks over at O'Reilly, who got it from somebody else. It's in the book called Linux Server Hacks, which I own and like very much. Can you improve on it? Part of the beauty of this method is that it fits on one line, but maybe some more usefulness can be got from it if we shell-script it?
_________________
Minds are like parachutes... Most people will do their damnedest to avoid having to use one.
Back to top
View user's profile Send private message
wget
n00b
n00b


Joined: 12 Dec 2004
Posts: 13

PostPosted: Sat Nov 19, 2005 8:56 pm    Post subject: Reply with quote

That's a great little script. However, if you use a GUI, Filelight is an awesome program that does basically the same thing (but makes it easier to read).
Back to top
View user's profile Send private message
lousyd
Apprentice
Apprentice


Joined: 15 Mar 2003
Posts: 166
Location: Des Moines

PostPosted: Sun Nov 20, 2005 2:34 am    Post subject: Reply with quote

Thanks for the reference. Filelight looks interesting, and it's in portage! I also discovered today, by a coincidental chain of events, that Konqueror has a graphical file size viewer when it's in file manager mode.
_________________
Minds are like parachutes... Most people will do their damnedest to avoid having to use one.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum