Re: mv files by date

2006-09-03 Thread Jean-Rene David
* Curtis Vaughan [2006.08.31 16:00]: > Can someone tell me the correct command line for moving a bunch of > files between directories that are, say, older than yesterday while > preserving their time stamps? With Z shell: mv *(.m+2) /dest/dir -- JR -- To UNSUBSCRIBE, email to [EMAIL PROT

Re: mv files by date

2006-09-01 Thread Matej Cepl
Ron Johnson wrote: > Shift key? That's what Caps Lock is for. It has been remapped to couple of months ago ;-). Matěj -- GPG Finger: 89EF 4BC6 288A BF43 1BAB 25C3 E09F EF25 D964 84AC http://www.ceplovi.cz/matej/blog/, Jabber: [EMAIL PROTECTED] 23 Marion St. #3, (617) 876-1259, ICQ 132822213

Re: mv files by date

2006-08-31 Thread Ron Johnson
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Miles Bader wrote: > Ron Johnson <[EMAIL PROTECTED]> writes: >> Or, explicitly: >> $ RENAME/LOG/BEFORE=YESTERDAY *.LOG;* [.NEW_DIR] > > I was gonna try that, but my shift key wore out before I reached the end > of the command. Shift key? That's what

Re: mv files by date

2006-08-31 Thread Matej Cepl
T wrote: > Why not something like (please test before use): > > find ./ -type f ! -mtime -2 -exec mv {} ../ \; Of course, that's the best. Silly me. Matěj -- GPG Finger: 89EF 4BC6 288A BF43 1BAB 25C3 E09F EF25 D964 84AC http://www.ceplovi.cz/matej/blog/, Jabber: [EMAIL PROTECTED] 23 Marion St

Re: mv files by date

2006-08-31 Thread Miles Bader
Ron Johnson <[EMAIL PROTECTED]> writes: > Or, explicitly: > $ RENAME/LOG/BEFORE=YESTERDAY *.LOG;* [.NEW_DIR] I was gonna try that, but my shift key wore out before I reached the end of the command. -Miles -- (\(\ (^.^) (")") *This is the cute bunny virus, please copy this into your sig so it can

Re: mv files by date

2006-08-31 Thread T
On Thu, 31 Aug 2006 13:51:44 -0700, Curtis Vaughan wrote: > find ./ -type f ! -mtime -2 -exec ls -al {} \; | xargs mv ../ > > in order to move the files found in the script up one directory? Why use xargs? find -exec deals with file one at a time. Why not something like (please test before use

Re: mv files by date

2006-08-31 Thread Jeff D
Curtis Vaughan wrote: Ok the following line finds all the files that I want to move out the folder: find ./ -type f ! -mtime -2 -exec ls -al {} \; So, now it's the next part that scares me. Should I do this? find ./ -type f ! -mtime -2 -exec ls -al {} \; | xargs mv ../ in order to move the

Re: mv files by date

2006-08-31 Thread Matej Cepl
Curtis Vaughan wrote: > Should I do this? > > find ./ -type f ! -mtime -2 -exec ls -al {} \; | xargs mv ../ You can but you are doing it too much complicated -- find by default prints on stdout found filename. And concerning xargs -- I don't use it that much (it always confuses me to no end), but

Re: mv files by date

2006-08-31 Thread Ron Johnson
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Matej Cepl wrote: > Curtis Vaughan wrote: > >> Can someone tell me the correct command line for moving a bunch of >> files between directories that are, say, older than yesterday while >> preserving their time stamps? > > find . \ > while re

Re: mv files by date

2006-08-31 Thread Curtis Vaughan
Ok the following line finds all the files that I want to move out the folder: find ./ -type f ! -mtime -2 -exec ls -al {} \; So, now it's the next part that scares me. Should I do this? find ./ -type f ! -mtime -2 -exec ls -al {} \; | xargs mv ../ in order to move the files found in the scr

Re: mv files by date

2006-08-31 Thread Matej Cepl
Curtis Vaughan wrote: > Can someone tell me the correct command line for moving a bunch of > files between directories that are, say, older than yesterday while > preserving their time stamps? find . \ while read FILE ; do mv $FILE other-directory/$(basename $FILE) done Read fi