[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

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@jabber.cz
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@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org




Reply to: