Computing.Net > Forums > Unix > Find, copy and move into directory

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Find, copy and move into directory

Reply to Message Icon

Name: Neo
Date: January 19, 2003 at 11:54:52 Pacific
OS: Unix
CPU/Ram: Unix
Comment:

How do you find files, then copy the files into an existing directory. I am to find files starting with N which is not more than 10 days old, then copy the N files into an existing N directory. All in single command. The problem now is I don't know how to move the files into an existing directory.

find t* -mtime -10

Directory is users/students/280501/kl004358/cprogram/N



Sponsored Link
Ads by Google

Response Number 1
Name: Neo
Date: January 19, 2003 at 11:56:07 Pacific
Reply:

Oops... I mean

find N* -mtime -10

then move into an existing directory


0

Response Number 2
Name: David Perry
Date: January 19, 2003 at 15:37:47 Pacific
Reply:

find . -name 'N*' -mtime -10 -exec mv {} N/ \;


0

Response Number 3
Name: David Perry
Date: January 19, 2003 at 16:01:30 Pacific
Reply:

or more generically,

for init in A B C D E F G H I J K L M N O P Q R S T U V W X Y Z ; do find . -name "$INIT*' -mtime -10 -exec mv {} $INIT/ \; done


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home


Sponsored links

Ads by Google


Results for: Find, copy and move into directory

how to find files and move to direc www.computing.net/answers/unix/how-to-find-files-and-move-to-direc/4822.html

Delete files, then copy and rename www.computing.net/answers/unix/delete-files-then-copy-and-rename/8286.html

Using find -exec and grep possible? www.computing.net/answers/unix/using-find-exec-and-grep-possible/5745.html