How to Rename Multiple File Extensions in Linux
At times, you may need to rename the file extension of multiple files in order to open them all with a different program. Within the Linux operating system, you can accomplish this task by accessing the terminal and using a single command. You won't need to know any programming languages, only how to copy and paste a few lines of text. So, don't waste time altering each file individually; you'll be surprised at how quickly you can get the job done.
Instructions
-
-
1
Open the Linux terminal. Although every distribution of Linux is a little different, you can usually access the terminal by selecting "Main Menu" and then "System Tools."
-
2
Type "$ ls" in the terminal to list the contents of your current directory. Then type "$ cd folder" where "folder" is the name of the directory containing the multiple files of which you want to change the extensions.
-
-
3
Type "or old in *.wma; do cp $old `basename $old .wma`.mp3; done" where ".wma" is the current file extension and ".mp3" is the extension to which you want to change.
-
4
Hit the "Return" key, and the loop of code will locate and change each of the specified file extensions.
-
1
References
- Photo Credit file folders image by Kathy Burns from Fotolia.com