LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices



Reply
 
Search this Thread
Old 09-06-2006, 02:15 AM   #16
derek11
LQ Newbie
 
Registered: Sep 2006
Posts: 6

Rep: Reputation: 0

thanks RedNovember, i'm afraid i did not installed KDE/GNOME on the server, and server is located in remote location.
 
Old 10-04-2006, 01:56 AM   #17
adds2one
Member
 
Registered: Aug 2005
Location: Vancouver, BC
Distribution: Ubuntu 6.06
Posts: 154

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by rhoekstra
You could try it like this:

Code:
for i in `find . -name .folder.jpg`;do mv $i ${i/.folder.jpg/folder.jpg};done
This works great when the directory names are one word but doesn't work for most of my directories which are album titles such as:

To Bring You My Love which Linux sees as:

To\ Bring\ You\ My\ Love/

Your script seems to try to go into folder To\ then Bring\ then You\ etc....

Here is an example of the message I get:

mv: cannot stat `./Murray': No such file or directory
mv: cannot stat `Street/.folder.jpg': No such file or directory
mv: cannot stat `./Daydream': No such file or directory
mv: cannot stat `Nation/.folder.jpg': No such file or directory

Thanks so much for your help.
 
Old 10-04-2006, 05:08 AM   #18
doc.nice
Member
 
Registered: Oct 2004
Location: Germany
Distribution: Debian
Posts: 274

Rep: Reputation: 34
Code:
for i in `find . -name .folder.jpg`;do mv "$i" "${i/.folder.jpg/folder.jpg}";done
some litte dashes should help
 
Old 10-04-2006, 03:19 PM   #19
rhoekstra
Member
 
Registered: Aug 2004
Location: The Netherlands
Distribution: RedHat 2, 3, 4, 5, Fedora, SuSE, Gentoo
Posts: 360

Rep: Reputation: 41
Quote:
Originally Posted by derek11
hi rhoekstra, thank you, it works nicely on files in deep directories, but would not replace illegal characters in directory names thou.
It should rename directories as well, but this line:
Code:
$newfile=~ s/[,& '\(\)]/_/g; #Search for ',', '&', ' ', "'", '(', ')' in filenames and replace them with underscores.
takes care of identifying which characters to change with underscores...
between the '[' and ']' add additional 'illegal' characters in order to get them replaced with underscores.

A bit more advanced is to determine if the name consists of 'any' character that is not between a-z,A-Z,0-9,_,-, etc... That could be done instead of the above line perhaps... I'm figuring out how to do so.. in this case you can tell what characters ARE valid, rendering all remaining characters invalid without naming them specifically...

Last edited by rhoekstra; 10-04-2006 at 03:21 PM.
 
Old 10-05-2006, 01:22 AM   #20
adds2one
Member
 
Registered: Aug 2005
Location: Vancouver, BC
Distribution: Ubuntu 6.06
Posts: 154

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by doc.nice
Code:
for i in `find . -name .folder.jpg`;do mv "$i" "${i/.folder.jpg/folder.jpg}";done
some litte dashes should help
thanks for the suggestion but this results in the exact same problem.
 
  


Reply

Tags
file, rename, renamescript


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with Bash Script - Rename Multiple Files embsupafly Programming 16 04-02-2010 04:50 AM
How to rename multiple files? Rostfrei Linux - Newbie 3 07-11-2006 07:06 AM
Samba can create new files and folders but access denied in any new folders k.king Linux - Networking 2 01-15-2006 07:14 AM
Copying files from multiple folders into one aardwolf64 Linux - General 4 01-03-2006 12:53 AM
Multiple file rename jrdioko Linux - Newbie 10 11-07-2004 06:25 PM


All times are GMT -5. The time now is 06:43 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration