Maze Posted January 25, 2017 Share Posted January 25, 2017 good day dear php-freaks i need to rename files in _ one _ directory - more than 50 files are in this..folder: the files are named like so:01020304...4950each file has got a number as a file name.each file should get a character- like so: r01, r02, r03, r04 and so on . .... r50how can we do this on commandline Quote Link to comment https://forums.phpfreaks.com/topic/303028-how-to-rename-files-in-one-folder-with-commandline/ Share on other sites More sharing options...
benanamen Posted January 25, 2017 Share Posted January 25, 2017 Command line of what? Are you on Windows or Linux? Quote Link to comment https://forums.phpfreaks.com/topic/303028-how-to-rename-files-in-one-folder-with-commandline/#findComment-1541991 Share on other sites More sharing options...
ignace Posted January 26, 2017 Share Posted January 26, 2017 Right off the bat, something like: for file in $(ls -A); do mv $file 'r'$file; done; Quote Link to comment https://forums.phpfreaks.com/topic/303028-how-to-rename-files-in-one-folder-with-commandline/#findComment-1542026 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.