_file1.txtHow do I remove the first character from a file name:
_foo1.txt
_2424.txt
_bar10000.txt
file1.txt
foo1.txt
2424.txt
bar10000.txt
You can use the rename command as described in our previous faq. The syntax is as follows:
To remove _ first character and rename all *.txt files, enter:
rename "s/regex-rule/replace/g" *.files
Use the ls command to verify the same:
rename -v "s/^_//g" *.txt
$ ls -l
No comments:
Post a Comment