Results 1 to 5 of 5
I have a bunch of files named Invoice # xxxx.PDF that I would like to change to be Invoice xxxx.PDF. Does anyone know how to do that with a bash ...
- 07-24-2007 #1Just Joined!
- Join Date
- Jul 2007
- Posts
- 2
Batch File Rename
I have a bunch of files named Invoice # xxxx.PDF that I would like to change to be Invoice xxxx.PDF. Does anyone know how to do that with a bash script? So far I have been thwarted in every attempt.
Captainquack
- 07-24-2007 #2Linux Enthusiast
- Join Date
- Aug 2006
- Posts
- 631
Hi,
Supposing you want to remove "# " from the filenames:
RegardsCode:ls *.pdf|sed 's/\(.*\)# \(.*\)/mv "\1# \2" "\1\2"/' | sh
- 07-24-2007 #3Linux User
- Join Date
- Jun 2007
- Posts
- 318
Franklin52,
I'd tweek your example to look only for the files with the right filename syntax:
Code:ls Invoice\ #\ ????.PDF |sed 's/\(.*\)# \(.*\)/mv "\1# \2" "\1\2"/' | sh
- 07-24-2007 #4Just Joined!
- Join Date
- Jul 2007
- Posts
- 2
Thank you very much.
- 05-18-2008 #5Just Joined!
- Join Date
- May 2008
- Posts
- 1
I use InnoRename to rename my huge picture files from my photo and my mp3 files too.
Great program to try (find it there www.innoplanet.com).
It can be programed and you can do a lot of combination easily.
Try it.


Reply With Quote