On Wed, Nov 30, 2011 at 07:49:26PM -0600, Dale wrote: > I ran into a problem. I been downloading a lot of TV shows. I forgot > to put a sort of important part in the names. This is what I have with > the full path: > > /data/Movies/TV_Series/Person of Interest/Season 1, Episode 1 - Pilot.mp4 > > This is what I need it to be: > > /data/Movies/TV_Series/Person of Interest/Person of Interest - Season 1, > Episode 1 - Pilot.mp4 > > Basically, I need to add the name of the show to the name of the file. > They will all be added to the front of the names. They also almost all > contain spaces, which means some fancy footwork with the \. > > Is there a way to do this? I have room to copy them to another > directory if needed. I would sort of actually prefer it that way since > if it messes up, I got the originals at least. > > Sorry I'm not real good at gawk, sed and all those things. I suspect > those will be used tho. I am familiar with | and grep tho. ;-) > > Thoughts?
I can’t remember right now what graphical environment you use, but for KDE there is KRename. But if you want it quick and efficient, I suggest renameutils. You give it a list of files and it opens $EDITOR containing two columns with the list. The first is the old name, and in the second you can enter the new name. It’s basically a mass renamer for the console, powered by your favorite features of your favorite editor. With the recursive flag -R you can even do what you want for many dirs at once and then insert the Series name using search and replace with regular expressions. But your particular example could be done simply with: cd "/data/Movies/TV_Series/Person of Interest" for i in *.mp4; do mv -n "$i" "Person of Interest - $i"; done -- Gruß | Greetings | Qapla' I forbid any use of my email addresses with Facebook services. The advantage of smartness is that one can pretend to be stupid. The opposite is far more difficult.
pgpWw8AuFv2mi.pgp
Description: PGP signature