Each folder has a .mkv or .avi file.
E.g:
Sommerferien201308/eins.avi Sommerferien201309/eins.mkv Herbst201401/film.avi Herbst201402/krz.mkv Renaming to:
Sommerferien201308/Sommerferien201308.avi Sommerferien201309/Sommerferien201309.mkv Herbst201401/Herbst201401.avi Herbst201402/Herbst201402.mkv How can I rename the filename to the name of its folder? Of course every foldername is unique. And too much to do it manually for each file/folder.
I Would try with find.
find . -type d -name "" -exec cd "" && mv {} \; But i dont know how to select the folder name and how to make the .avi or .mkv selection and how to store the selected folder name..
findcommand? The output would be Sommerferien2013\Sommerferien2013.mkv