batch renaming ...

hi all,

given a path, for example :
/<pwd>/artist/album/

what i would like to do is to rename the album directory like that :
/<pwd>/artist/artist | album/

and i would like to do the latter for all the "artist" directories
and for all the "album" directories that belong to an artist

i don t really want to mess my music directory, that s why i am asking for your help

thanx

Krename :wink:

thank for the quick reply, but i really would like to know how i can do it with scripting

(You would be best advised to not use a pipe character in a directory name. It won't stop you, but it will give you grief!).

On the original subject, If you have enough disc space it is safer to:
1) Backup the system
2) Copy the directories to the new structure
3) Check thoroughly
4) Move the old directories to a backup area pending later removal

Not recommend to use space in folder's name in unix system, I change to artist_album

cd <PWD>

for i in `find . -type d -name album`
do
  ARTIST=`echo $i |cut -d/ -f2`
  mv $i ./$ARTIST/$ARTIST_album
done