Home » Infrastructure » Linux » command (linux ES4)
command [message #296836] Tue, 29 January 2008 03:51 Go to next message
rajesh_hv
Messages: 13
Registered: January 2008
Location: bangalore
Junior Member
how to find the files and mv that files on single command

[Updated on: Tue, 29 January 2008 03:55]

Report message to a moderator

Re: command [message #296841 is a reply to message #296836] Tue, 29 January 2008 04:15 Go to previous messageGo to next message
varu123
Messages: 754
Registered: October 2007
Senior Member
This should work.
find filename | grep filename > /dir/filename
command [message #296847 is a reply to message #296841] Tue, 29 January 2008 04:55 Go to previous message
rajesh_hv
Messages: 13
Registered: January 2008
Location: bangalore
Junior Member

hi.,

Using find with the -exec flag is a convenient way to copy, move, print, and even delete groups of files that may be scattered across many different directories. A word of caution, though: If you're going to apply some potentially dangerous command (like rm) to your files, use the -ok flag instead of -exec. It works the same way, except it prompts you to confirm each command before executing it. Here's an example:


find . -name "*.txt" -ok mv {} junkdir \;
mv sample1.txt junkdir ok? (y/n)
mv sample2.txt junkdir ok? (y/n)
Previous Topic: XVNC / PDF Creation Issue
Next Topic: run "emctl start dbconsole" error
Goto Forum:
  


Current Time: Fri Dec 13 06:54:27 CST 2024