A
A
artloveyou2021-12-08 22:08:58
linux
artloveyou, 2021-12-08 22:08:58

How to massively remove a word from a file name in Linux using a mask?

There are files in the same directory:
file CLEAR.test
file1 CLEAR.test
file2 CLEAR.test
...

How to turn them in the terminal into:
file.test
file1.test
file2.test

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergei Nazarenko, 2021-12-08
@artloveyou

Klats and
Klats
Like this

user:TEST/ $ ls -1
#-- output--
file CLEAR.test
file1 CLEAR.test
file2 CLEAR.test

user:TEST/ $ rename 's/ CLEAR//g' *.test
                           
user:TEST/ $ ls -1                                                
#--output--
file.test
file1.test
file2.test

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question