You are not logged in.

#1 2009-12-20 20:22:21

Dieter@be
Forum Fellow
From: Belgium
Registered: 2006-11-05
Posts: 2,001
Website

anyone knows a script to help you clean out directories?

As misc files and directories always find their way into my $HOME and other dirs, I regurarly feel the need to clean them up.
my approach now is very time-consuming: `svn status` or `ls -alh` (depending on whether the dir is under version control or not), and then manually invoke diff, meld, .. for text files, or the appropriate programs for others (image viewers, mplayer etc) to find out if i still need stuff, and then i often just rm or mv it.

I've been thinking on making this a bit more automatic, so I want a script that:
- iterates over all files (or all "dirty" files for git/svn managed directories) in a given directory.
- ordered by atime/ctime or size (with threshold : "older then", or "bigger then" depending on sort order)
and for each item ask me if i want to:
- skip
- rm
- mv
- custom action
- view (be smart here: less for textfiles, qiv/gqview for images, uzbl for html, ... maybe just rely on xdg-open?)

sounds like a quite simple script but I don't feel like writing it myself.  does something like this exist already? if not, anyone feels like writing it?


< Daenyth> and he works prolifically
4 8 15 16 23 42

Offline

#2 2009-12-27 21:17:29

Dieter@be
Forum Fellow
From: Belgium
Registered: 2006-11-05
Posts: 2,001
Website

Re: anyone knows a script to help you clean out directories?

okay so I started working on it.
a basic version works already and i find it already quite useful.
http://github.com/Dieterbe/dclean/


< Daenyth> and he works prolifically
4 8 15 16 23 42

Offline

Board footer

Powered by FluxBB