How can I delete all files containing -20
in the filename in the current directory?
I have
ls | grep "-20" | rm -rf
But that does not work. Ideas?
Thanks.
greplinux
How can I delete all files containing -20
in the filename in the current directory?
I have
ls | grep "-20" | rm -rf
But that does not work. Ideas?
Thanks.
Best Answer
The -- stops -20 being treated as an argument to rm if the file -20 exists.