[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ale] When a script is necessary, and when a piped command is sufficient ?
- Subject: [ale] When a script is necessary, and when a piped command is sufficient ?
- From: jimpop at yahoo.com (Jim Popovitch)
- Date: Wed, 15 Mar 2006 09:53:53 -0500
- In-reply-to: <[email protected]>
- References: <[email protected]>
Courtney Thomas wrote:
> I've been trying to assemble a sequence of actions, e.g. find, sort, rm,
> etc.... to filter a directory of files and have not yet succeeded.
>
> In particular I need to execute, in the following sequence;
>
> 1-find or ls
> 2-sort [by file date]
> 3-rm [interactively]
>
First, man find and read up on ctime/atime/mtime to see if they will do
for what you need.
find /path/to/somewhere -type f -ctime 4 -exec rm {} \;
or this for non-interactive removes:
find /path/to/somewhere -type f -ctime 4 -exec rm -f {} \;
-Jim P.