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

Re: Deleting Files beginning with -



On Thu, 8 May 2003, Kay-Michael Voit wrote:

> Hi,
> I have a file beginning with "-". If I try to delete ist, rm says
> "invalid option". Same thing when I set " or '. How can I delete it?

use -i to ask rm to confirm it before it deletes something you didnt want
to have deleted

use the leading 2 chars "./" to tell rm only do it in this directory

add/subtract \ ' " as needed 

rm -i ./-sillyfile.with.nospaces

rm -i ./-"silly file with spaces"

rm -i "more files with spaces"
rm -i 'more files here too'

rm -i ./-"john's documents"
-or-
rm -i ./-"john\'s documents"

... endless whacky combinations of all the 255 "Characters" ...

when doing wierd stuff...  do it safely ...

if yoou do an ooops.. hope you made backups first, before deleting whacky
stuff

c ya
alvin



Reply to: