ubuntu:file:rename_replace_all_occurrences_of_string_within_a_filename
This is an old revision of the document!
Table of Contents
Ubuntu - File - Rename replace all occurrences of string within a filename
Rename all files which contain the old sub-string, replacing it with the replacement sub-string
rename old_value replacement_value directory/filename
Rename all files which contain the sub-string 'foo', replacing it with 'bar'
for i in ./*foo*;do mv -- "$i" "${i//foo/bar}";done
Using perl
ubuntu/file/rename_replace_all_occurrences_of_string_within_a_filename.1655120812.txt.gz ยท Last modified: 2022/06/13 11:46 by peter