Re: mv files by date



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 script up one directory?

Curtis

On 31.08.2006, at 13:16, 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 . <paramters to select appropriate files> \
while read FILE ; do mv $FILE other-directory/$(basename $FILE)
done

Read find(info), bash(1), and mv(1) for more details.

Best,

Matěj

--
GPG Finger: 89EF 4BC6 288A BF43 1BAB 25C3 E09F EF25 D964 84AC
http://www.ceplovi.cz/matej/blog/, Jabber: ceplma@xxxxxxxxx
23 Marion St. #3, (617) 876-1259, ICQ 132822213

There are lies, damned lies, and quotes from literary icons.



--
To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx
with a subject of "unsubscribe". Trouble? Contact listmaster@xxxxxxxxxxxxxxxx




Relevant Pages

  • Re: mv files by date
    ... now it's the next part that scares me. ... in order to move the files found in the script up one directory? ... To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx with a subject of "unsubscribe". ...
    (Debian-User)
  • Re: Mail Issues (pt 2 )
    ... My setup, postfix - spamassasin, ... to either a spam folder or to /var/mail. ... To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx ...
    (Debian-User)
  • RE: htaccess woes
    ... Apologies - I am VERY new to Linux and am learning ... > Make sure your file .htaccess got the correct access rights. ... > to protect the phpMyAdmin folder with .htaccess. ...
    (RedHat)
  • Re: Beep question of Icedove
    ... receiving and telling you about new mail. ... I have a filter sending all d-u mail to a folder. ... submitted a bug report. ... To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx ...
    (Debian-User)
  • Re: My own emails
    ... It does get sent to you but gmail sees it as a dupe and dumps it. ... and so use the option to "keep replies in this folder". ... Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org ... To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx ...
    (Debian-User)