-2

How do I remove files, with specific names.. For example, my file name is

This File Example (England).txt
This File Example (US).txt

I want to remove all the files with (England) in the name.

So I tried,

rm -f "*(Eng*"

But it doesn't work. Is there something needed for special chars?

iBug
  • 35,554
  • 7
  • 89
  • 134
Borg357
  • 1
  • 2
  • 4
    This Q is not about programming as defined for StackOverflow. It **may** be more appropriate on http://superuser.com or another StackExchange site. Use the `flag` link at the bottom of your Q and ask the moderator to move it. Please don't post the same Q on 2 different sites. ***Please*** read https://stackoverflow.com/help/on-topic , https://stackoverflow.com/help/how-to-ask , https://stackoverflow.com/help/dont-ask and https://stackoverflow.com/help/mcve before posting more Qs here. GoodLuck – shellter Nov 26 '17 at 04:54

2 Answers2

0

This should do it:

rm -f ./*'(England)'*
Jesin
  • 1,009
  • 9
  • 12
0

Escape the special ones:

rm -f *\(Eng*
       ^

Or use single quotes for literal parts:

rm -f *'(Eng'*
       ^    ^
iBug
  • 35,554
  • 7
  • 89
  • 134