I have several files in the same folder that have one element in common in the names. How do I rename the files so that the common element in the names is deleted?
Asked
Active
Viewed 1,904 times
1
-
2Use one of the text listing commands and copy/paste the text to your question. This will make it easier for us to text the text against the commands provided. you can get a text listing with commands such as `ls` or better `ls -1`. – L. D. James Apr 13 '18 at 20:35
-
1If you google "ubuntu bulk rename", you'll find many other related questions. – wjandrea Apr 13 '18 at 21:06
2 Answers
1
You could use rename
rename -n 's/\(U\)//' *.bin
This will delete the "(U)" part of the file name from all .bin files.
If you are happy with changes that rename will make then take out the "-n" option which is No Action, that only shows what files would have been renamed.
stumblebee
- 2,963
- 3
- 16
- 31
0
The way I always do it: Thunar bulk rename.
Install Thunar:
sudo apt install thunar
Now open bulk rename (if you're using basic 16.04 version, just go to dash home and type bulk: you'll get it.)
Options are pretty obvious from there.
I know, I know, some geek will tell me I should have done it from the command line. And that's doable too, but you'd need to be a bit more specific on exactly what you want to get a specific command.
anonymous2
- 4,268
- 7
- 33
- 61
