LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   How to remove this file? (https://www.linuxquestions.org/questions/slackware-14/how-to-remove-this-file-452565/)

cqmyg5 06-07-2006 06:50 PM

How to remove this file?
 
There's a file named "-X", I can not remove it, please help!

I already tried these:

rm -rf -X
rm -rf "-X"
rm -rf \-X
rm -rf "-"X
rm -rf /-\X
rm -rf /-/X

cqmyg5 06-07-2006 06:53 PM

Oh, I get it,
rm -- -X

drkstr 06-07-2006 06:54 PM

'rm *X' maybe?

regards,
...drkstr

soulestream 06-07-2006 09:56 PM

yeah, rm -- -X
is the way

soule

Randux 06-08-2006 12:56 PM

The other classic is the files that Emacs creates when you exit in a hurry:

#myfile#

Those are fun to try to delete :p

dennisk 06-08-2006 01:54 PM

Quote:

Originally Posted by Randux
The other classic is the files that Emacs creates when you exit in a hurry:

#myfile#

Those are fun to try to delete :p

Actually I did that yesterday and typing

rm # (tab)

immediately gave this

rm \#

Dennisk

Randux 06-09-2006 12:45 AM

Yeah, ain't Bash completion grand? :p

tronayne 06-10-2006 11:36 AM

You can usually -- usually! -- remove files like that with

rm ./-X

Now, that's sh and ksh but it ought to work in any sh-like shell...

Nylex 06-10-2006 12:31 PM

Quote:

Originally Posted by Randux
The other classic is the files that Emacs creates when you exit in a hurry:

#myfile#

Those are fun to try to delete :p

You can also delete these by encasing the filename in double quotes, i.e.

$ rm "#myfile#".

evilDagmar 06-11-2006 12:18 AM

Quote:

Originally Posted by cqmyg5
Oh, I get it,
rm -- -X

You have to be the first person I've ever seen to figure this out on their own. Kudos to you. :)

kodon 06-11-2006 12:38 AM

really?

the man page says it quite plainly


All times are GMT -5. The time now is 10:06 PM.