[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Deleting weird-named files



Ed Curtis <ed@homes2see.com> writes:

> I recently tried to tar a directory and used the --exclude= tag. I wound
> up making a file called --exclude=*.jpg. I can't seem to delete this file
> even using '--exclude=*.jpg'. It keeps trying to take the -- as a command
> option. How can I delete this file?

rm -- --exclude=\*.jpg
rm -- '--exclude=*.jpg'
rm -- "--exclude=*.jpg"
rm ./--exclude=\*.jpg
rm './--exclude=*.jpg'
rm "./--exclude=*.jpg"

(Why rm '--exclude=*.jpg' doesn't work: The shell expands
'--exclude=*.jpg' to --exclude=*.jpg, so the rm program still
sees an argument beginning with -- .)

Martin



Reply to: