Results 1 to 10 of 11
Greetings,
I work IT for a school whose mail server died shortly after I started working. Alot of the emails were originally set up as IMAP accounts which meant when ...
- 10-18-2007 #1Just Joined!
- Join Date
- Oct 2007
- Posts
- 3
Massive File rename to remove commas
Greetings,
I work IT for a school whose mail server died shortly after I started working. Alot of the emails were originally set up as IMAP accounts which meant when the server died, the users lost the links to their accounts. I have gotten to the files I need to copy over but here's the problem.
all of the filenames have commas in them. So when I go to copy these emails to my usb drive, i get the error message "too many arguments"
So I need a script (or anything) that will run through ALL of these directories, and remove the commas from the filenames. But I have no scripting experience in linux and I am short on time! PLEASE HELP!
- 10-18-2007 #2Code:
[xxx@xxx project1]$ touch 'this,that' [xxx@xxx project1]$ touch 'that,this' [xxx@xxx project1]$ ls -l -rw-rw-r-- 1 xxx xxx 0 Oct 18 16:05 that,this -rw-rw-r-- 1 xxx xxx 0 Oct 18 16:05 this,that [xxx@xxx project1]$ rename ',' '' *','* [xxx@xxx project1]$ ls -l -rw-rw-r-- 1 xxx xxx 0 Oct 18 16:05 thatthis -rw-rw-r-- 1 xxx xxx 0 Oct 18 16:05 thisthat
- 10-19-2007 #3
It doesn't seem to me that removing commas from filenames would get rid of an error message like "too many arguments" on a cp command.
walkblind, did likwid's solution do the trick for you, or does the problem remain?
- 10-19-2007 #4
- 10-19-2007 #5Linux Newbie
- Join Date
- Sep 2007
- Posts
- 161
hi, i also agree with the two posters before me.
i would archive the files before moving them to the usb drive, e.g. using "zip -r" or "tar" on the directory tree, to take care of the error message concerning "too many arguments".
kai
- 10-19-2007 #6I hope you're reading the replies on this thread before messing with any file names. Consensus so far is that your speculation about cause and effect is questionable...
Originally Posted by walkblind
I'd tar up the files and then move them.
- 10-19-2007 #7Linux Guru
- Join Date
- Nov 2004
- Posts
- 6,110
Didn't we have a thread before about a limit on the number of files that could be passed to cp?
- 10-19-2007 #8
I don't remember such a thread for cp exactly, but there is this.
- 10-21-2007 #9Just Joined!
- Join Date
- Oct 2007
- Posts
- 3
compression
tar solution sounds viable. I'll give it a shot monday morning and post results. Thank you for suggestions.
- 10-26-2007 #10Just Joined!
- Join Date
- Oct 2007
- Posts
- 3
Success!
It worked! I was able to recover the old emails and be the IT hero for about 10 minutes. Thank you for the ideas!


Reply With Quote
