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.
how to find files and move to direc
Name: bryan lee Date: April 7, 2003 at 15:12:00 Pacific OS: windows xp pro CPU/Ram: 256
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 N* -mtime -10
then move into an existing directory
Directory is users/students/280501/kl004358/cprogram/N
this code cannot be use find . -name 'N*' -mtime -10 -exec mv {} N/ \; error message prompt out find: -exec not terminated with ';' by the way,whats the meaning N/\;
Name: David Perry Date: April 7, 2003 at 16:33:51 Pacific
Reply:
find . -name 'N*' -mtime -10 -exec mv {} N/ \
You need to have a space preceeding the \;
-exec mv {} N/
The {} is a substitute for what is returned by the find command. -exec mv {} N/ say to execute the move command on the results and move to the N directory.
0
Response Number 2
Name: bryan lee Date: April 7, 2003 at 22:19:15 Pacific
Reply:
thanks, but i still cannot execute the command. can i have the full command line.
0
Response Number 3
Name: David Perry Date: April 8, 2003 at 09:21:38 Pacific
Reply:
I don't understand. Are you saying you cannot execute "find" because it is not in your path?
0
Response Number 4
Name: bryan lee Date: April 8, 2003 at 09:56:34 Pacific
Reply:
my question is Find all files in my home directory newer than 10 days and with names starting with N and copy these files into a directory called back up the directory name is /users/students/200104/dh006834/backup.
i type your command exactly the same.but this message come out -exec not terminated with ';'
0
Response Number 5
Name: David Perry Date: April 9, 2003 at 05:42:50 Pacific
Reply:
Sorry, I didn't notice how this forum mangled my reponse. Yes, anything other than a simple find needs to end with a backslash then semi-colon. There should have been a ";" at the end of the find command I posted.
Summary: 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...
Summary: Hi, I have to move files older than 4 hours from a directory to another. How to find these file ? The find command with -mtime can't be applied because time is up than 24 hours. Thanks ...
Summary: Hi! I just wonder if anyone can help me. I'm trying to write a shell script, but don't know where to begin exactly. I need to write a script that will go into each directory, even subdirectories and ...