Unix/Linux Go Back    

Shell Programming and Scripting BSD, Linux, and UNIX shell scripting — Post awk, bash, csh, ksh, perl, php, python, sed, sh, shell scripts, and other shell scripting languages questions here.

Find and Rename files using (find mv and sed)

Shell Programming and Scripting

Thread Tools Search this Thread Display Modes
Old Unix and Linux 10-12-2010
rupert160 rupert160 is offline
Registered User
Join Date: Oct 2010
Last Activity: 18 November 2010, 9:20 PM EST
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Find and Rename files using (find mv and sed)

In response to a closed thread for degraff63 at

the following command
might do it as some shells spit it without the "exec bash -c " part:

Find . -name "*.model" -exec bash -c "mv {} \`echo {} | sed -e  's/[^A-Za-z0-9_./]/_/g'\`" \;

the earlier command he wrote was.

Find . -name "*.model" -exec mv "{}" `echo "{}" | sed 's/[^A-Za-z0-9_./]/_/g'` \;

Last edited by jim mcnamara; 10-13-2010 at 03:45 AM.. Reason: url tags
Sponsored Links

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Linux More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Find last updated files and rename ramse8pc Shell Programming and Scripting 3 05-17-2010 10:47 PM
Find and rename Legend986 Shell Programming and Scripting 2 09-29-2008 03:19 AM
Little bit weired : Find files in UNIX w/o using find or where command jatin.jain Shell Programming and Scripting 10 09-19-2007 06:47 AM
Find, Append, Move & Rename Multiple Files Trapper Shell Programming and Scripting 5 08-30-2007 07:39 AM
Find and rename all folders with name X. mkingrey UNIX for Dummies Questions & Answers 6 06-06-2007 04:49 PM

All times are GMT -4. The time now is 04:23 AM.