Re: HELP - Moving Files By Date Range
From: Christoph Schuch (christoph.schuch_at_gmx.at)
Date: 11/19/03
- Previous message: Frank Cusack: "Re: Listing absolute path of file"
- In reply to: Jeff: "HELP - Moving Files By Date Range"
- Next in thread: phn_at_icke-reklam.ipsec.nu: "Re: HELP - Moving Files By Date Range"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 19 Nov 2003 11:24:18 +0100
**** Post for FREE via your newsreader at post.usenet.com ****
> Is there are command or utility that will let me specify files by date
> range to move?
you can achive your date-based move with the following commands. (But
beware, find reports also files in subdirectories, which will cause possible
problems with the mv command)
touch -t 10010000 limit_begin
touch -t 10312359 limit_end
find . -newer limit_begin -a ! -newer limit_end -a -type f -exec mv {}
/otherdir \;
if you have many subdirs you could use sed to handle your task. In this case
the strings limit_begin and limit_end must be unique in the output of
ll -tr.
for file in `ll -tr | sed -n '/limit_begin/,/limit_end/p' | sed -n '/^-/p' |
awk '{ print $9}'`
do
mv $file /otherdir
done
christoph
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
*** Usenet.com - The #1 Usenet Newsgroup Service on The Planet! ***
http://www.usenet.com
Unlimited Download - 19 Seperate Servers - 90,000 groups - Uncensored
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
- Previous message: Frank Cusack: "Re: Listing absolute path of file"
- In reply to: Jeff: "HELP - Moving Files By Date Range"
- Next in thread: phn_at_icke-reklam.ipsec.nu: "Re: HELP - Moving Files By Date Range"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|