LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 06-07-2006, 06:50 PM   #1
cqmyg5
LQ Newbie
 
Registered: Apr 2005
Posts: 29

Rep: Reputation: 15
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

Last edited by cqmyg5; 06-07-2006 at 06:52 PM.
 
Old 06-07-2006, 06:53 PM   #2
cqmyg5
LQ Newbie
 
Registered: Apr 2005
Posts: 29

Original Poster
Rep: Reputation: 15
Oh, I get it,
rm -- -X
 
Old 06-07-2006, 06:54 PM   #3
drkstr
Senior Member
 
Registered: Feb 2006
Location: Seattle, WA: USA
Distribution: Slackware 11.0
Posts: 1,191

Rep: Reputation: 45
'rm *X' maybe?

regards,
...drkstr
 
Old 06-07-2006, 09:56 PM   #4
soulestream
Member
 
Registered: Nov 2005
Posts: 183

Rep: Reputation: 30
yeah, rm -- -X
is the way

soule
 
Old 06-08-2006, 12:56 PM   #5
Randux
Senior Member
 
Registered: Feb 2006
Location: Siberia
Distribution: Slackware & Slamd64. What else is there?
Posts: 1,705

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

#myfile#

Those are fun to try to delete
 
Old 06-08-2006, 01:54 PM   #6
dennisk
Member
 
Registered: May 2004
Location: Southwestern USA
Distribution: CentOS
Posts: 279

Rep: Reputation: 30
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
Actually I did that yesterday and typing

rm # (tab)

immediately gave this

rm \#

Dennisk
 
Old 06-09-2006, 12:45 AM   #7
Randux
Senior Member
 
Registered: Feb 2006
Location: Siberia
Distribution: Slackware & Slamd64. What else is there?
Posts: 1,705

Rep: Reputation: 55
Yeah, ain't Bash completion grand?
 
Old 06-10-2006, 11:36 AM   #8
tronayne
Senior Member
 
Registered: Oct 2003
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,541

Rep: Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065
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...
 
Old 06-10-2006, 12:31 PM   #9
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
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
You can also delete these by encasing the filename in double quotes, i.e.

$ rm "#myfile#".
 
Old 06-11-2006, 12:18 AM   #10
evilDagmar
Member
 
Registered: Mar 2005
Location: Right behind you.
Distribution: NBG, then randomed.
Posts: 480

Rep: Reputation: 31
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.
 
Old 06-11-2006, 12:38 AM   #11
kodon
Member
 
Registered: Jul 2004
Location: [jax][fl][usa]
Distribution: Slackware64-current
Posts: 796

Rep: Reputation: 31
really?

the man page says it quite plainly
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to remove certain types of file? heislyc Linux - General 5 02-17-2006 12:21 PM
how to remove file -T odious1 Linux - General 1 08-11-2005 12:29 PM
Remove folder and file os2 Programming 1 03-12-2005 02:12 PM
remove * from file nameS zchoyt Linux - Newbie 1 02-13-2005 04:33 PM
c++ file processing -- how to remove a record from a file sharonyiisl Programming 4 09-26-2004 03:54 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration