I want Rename mp4 files in my Subfolders, the filename should be same as the folder Name after renaming...
This is my Command:
ls */*.mp4 | awk -F'/' '{print "mv " $0 " ./" $1 "_" $2 }' | bash
FolderA/MovieA.mp4 >>> FolderA.mp4
FolderB/MovieB.mp4 >>> FolderB.mp4
FolderC/MovieC.mp4 >>> FolderC.mp4
But it does not work if the folder or filesnames got a Bracket or Space or other special chars, what can i do?
Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230
Renaming files based on Folder Names
Re: Renaming files based on Folder Names
bash:
(not tested. needs to be run inside the folder containign the videos)
Code: Select all
for i in *.mp4; do
mv "$i" "${PWD##*/}_$i"
done