S
S
Sergey Burduzha2018-01-27 23:45:11
ubuntu
Sergey Burduzha, 2018-01-27 23:45:11

Why doesn't prename work?

I have the following files

total 10592
drwxrwxr-x 2 serii serii    4096 Jan 27 22:35 ./
drwxrwxr-x 3 serii serii    4096 Jan 27 22:27 ../
-rw-rw-r-- 1 serii serii 1167574 Jan 27 22:33 1_Desktop Wallpapers  HD Part (120).jpg
-rw-rw-r-- 1 serii serii 1664576 Jan 27 22:33 2_Desktop Wallpapers  HD Part (120).jpg
-rw-rw-r-- 1 serii serii 1099326 Jan 27 22:33 3_Desktop Wallpapers  HD Part (120).jpg
-rw-rw-r-- 1 serii serii 1810369 Jan 27 22:33 4_Desktop Wallpapers  HD Part (120).jpg
-rw-rw-r-- 1 serii serii 1503772 Jan 27 22:33 5_Desktop Wallpapers  HD Part (120).jpg
-rw-rw-r-- 1 serii serii  879733 Jan 27 22:33 6_Desktop Wallpapers  HD Part (120).jpg
-rw-rw-r-- 1 serii serii  838817 Jan 27 22:33 7_Desktop Wallpapers  HD Part (120).jpg
-rw-rw-r-- 1 serii serii  892155 Jan 27 22:33 8_Desktop Wallpapers  HD Part (120).jpg
-rw-rw-r-- 1 serii serii  963443 Jan 27 22:33 9_Desktop Wallpapers  HD Part (120).jpg

I want to remove all characters in a name up to a number, and for this I use prename
prename -n 's/_Desktop\ Wallpapers\ \ HD\ Part\ (120)//'

But it doesn't work for me, I mean because of the gaps.
What should I do? How to solve the problem, it will be a lesson for the future.
Thanks in advance for your help.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Burduzha, 2018-01-27
@serii81

I hurried a little, you need to put the g flag, otherwise it only applies to the first space.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question