I'm trying to remove a file I made by mistake using --exclude with tar. I ended up making a tar file named --exclude=*.tar Now I want to delete it but I'd like to rename it first. How do I escape it correctly?
Asked
Active
Viewed 164 times
2
Gilles 'SO- stop being evil'
- 829,060
Monty
- 225
- 2
- 6
2 Answers
2
There are two straightforward ways to do this using just rm:
rm -- --exclude=*.tar
or
rm ./--exclude=*.tar
ire_and_curses
- 12,362
0
I just used mv ./--exclude=*.tar deleteThisFile and that worked fine.
Monty
- 225
- 2
- 6
-
I think the only things you ever need to escape are spaces (if you don't quote) or quotes (if you do quote). – goldilocks Nov 15 '13 at 19:10