bash rename files in directory code example
Example 1: bash how to change all filenames in a directory
rename filename_search_expression replacement_text file_search
this_is_an_example_filename.txt
example_filename_this_is.txt
rename example_filename other_filename *.txt
this_is_an_other_filename.txt
other_filename_this_is.txt
Example 2: bash rename multiple files
rename search_string replacement_string files
badly_name_file_1.txt
badly_named_file_1.txt
badly_named_file_2.txt
badly_named_file_3.png
rename txt png *txt
badly_name_file_1.png
badly_named_file_1.png
badly_named_file_2.png
badly_named_file_3.png
rename named speled badly*
badly_name_file_1.txt
badly_speled_file_1.txt
badly_speled_file_2.txt
badly_speled_file_3.png