|
|
Find anything and open it with one command
Since there are "find" experts here. A while back, I was trying to do a find and move the found files up a level (the parent's directory) but couldn't do it. -exec mv {} .. \; didn't work. Any advice?
Find anything and open it with one command
the following will find all files in the current directory to the directory above the current.
files in directories below the current will not be affected and will print errors. find ./ -type f -exec mv {} ../{} \;---
Find anything and open it with one command
Thank you for trying, but that doesn't solve the problem. That command will move the found files to the parent of the current working directory (./) not the parents of the found files. Example move /dir1/dir2/dir3/file to /dir1/dir2/file
Find anything and open it with one command
find . -type f -execdir mv {} .. \;
Find anything and open it with one command
THANK YOU. I learned about execdir from the man page, but it didn't work for me as expected, your example works perfectly. Gotta remember that. |
SearchFrom our Sponsor...Latest Mountain Lion HintsWhat's New:HintsNo new hintsComments last 2 daysLinks last 2 weeksNo recent new linksWhat's New in the Forums?
Hints by TopicNews from Macworld
From Our Sponsors |
|
Copyright © 2014 IDG Consumer & SMB (Privacy Policy) Contact Us All trademarks and copyrights on this page are owned by their respective owners. |
Visit other IDG sites: |
|
|
|
Created this page in 0.14 seconds |
|