LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-12-2005, 11:13 AM   #1
codec
Member
 
Registered: Sep 2003
Location: mad.es.eu
Distribution: ubuntu 5.04 knoppix Slack91/10 freebsd51 vector4 redhat9
Posts: 304

Rep: Reputation: 30
how to remove the file "-rf"?


I made this file for fun, now that I cannot rename or remove it. What can I do?
 
Old 03-12-2005, 11:16 AM   #2
harken
Member
 
Registered: Jan 2005
Location: Between the chair and the desk
Distribution: Debian Sarge, kernel 2.6.13
Posts: 666

Rep: Reputation: 30
A quick answer (there's probably a better one but I'm in a hurry now):'rm *rf' and answer 'y' only to this file.
 
Old 03-12-2005, 11:38 AM   #3
Komakino
Senior Member
 
Registered: Feb 2004
Location: Somerset, England
Distribution: Slackware 10.2, Slackware 10.0, Ubuntu 9.10
Posts: 1,938

Rep: Reputation: 55
Code:
rm -- -rf
The -- means 'no more parameters to follow, intepret only as files'
 
Old 03-12-2005, 11:55 AM   #4
andrewlkho
Member
 
Registered: Jul 2003
Location: London
Posts: 548

Rep: Reputation: 30
Or simply
Code:
rm ./-rf
 
Old 03-12-2005, 12:26 PM   #5
codec
Member
 
Registered: Sep 2003
Location: mad.es.eu
Distribution: ubuntu 5.04 knoppix Slack91/10 freebsd51 vector4 redhat9
Posts: 304

Original Poster
Rep: Reputation: 30
thanks! the file is removed.

rm *rf does not work because the shell actually do some string transformation with wildcard characters

rm -- -rf
and
rm ./-rf
both work
 
Old 03-12-2005, 12:37 PM   #6
Komakino
Senior Member
 
Registered: Feb 2004
Location: Somerset, England
Distribution: Slackware 10.2, Slackware 10.0, Ubuntu 9.10
Posts: 1,938

Rep: Reputation: 55
Quote:
Originally posted by andrewlkho
Or simply
Code:
rm ./-rf
...which was no simpler than what I said
 
Old 03-12-2005, 01:03 PM   #7
reddazz
LQ Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 75
Quote:
Originally posted by andrewlkho
Or simply
Code:
rm ./-rf
I didn't know this one.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 can i remove this file "-gxxxx" zameer_india Linux - Newbie 6 01-29-2005 03:25 AM
remove a file that has a " | " in it's name disorderly Linux - Security 3 09-27-2004 02:24 PM
remove "-" (dash) from file aurelio26 Linux - Newbie 4 09-16-2004 12:32 PM
How to remove a file called: "-be" zepplin611 AIX 7 08-21-2004 04:37 PM
remove "special" text out of a file tearinox Linux - General 1 03-15-2004 09:43 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 02:26 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration