LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 06-27-2006, 04:20 PM   #1
mago
Member
 
Registered: Apr 2004
Location: Costa Rica
Distribution: slack current with 2.6.16.18 (still off the hook)
Posts: 284

Rep: Reputation: 33
remove folder that stats with a "special" character


This might be a retarded question but it just happend to me and honestly cannot figure it out. 10 to 1 is exremely simple but well...


I created by mistake a folder that starts with a dash (-) and I cannot delete it. I tried rmdir (since it is empty) with a \ to escape the - and nothing I tried to move it but every time it reads the folder as a flag and I cannot get rid of it.

Is not a big thing but is driveing me bananas, I'm not even sure how I did it since I tried to reproduce it.



Thanks a lot.
 
Old 06-27-2006, 04:25 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
try
Code:
rm -- -filename
 
Old 06-27-2006, 04:32 PM   #3
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Or:
Code:
rm -r ./-folder
 
Old 06-27-2006, 04:40 PM   #4
mago
Member
 
Registered: Apr 2004
Location: Costa Rica
Distribution: slack current with 2.6.16.18 (still off the hook)
Posts: 284

Original Poster
Rep: Reputation: 33
Thanks a bunch, I knew that will be easy enough but if you don't know how...
I even read the man for rm and rmdir, I might be blind.


Well thanks a lot.
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
"rm -rf /tmp", now Evolution shows "(no folder displayed" Ed-MtnBiker Linux - Software 7 04-10-2006 04:05 PM
kmail "could not remove folder" errors GoBillsBN Linux - Software 1 08-03-2005 07:58 PM
i want to install new gnome/kde in special folder and be able to remove, ??any idea? roadorange Linux - Software 3 03-30-2004 02:56 PM
remove "special" text out of a file tearinox Linux - General 1 03-15-2004 08:43 PM
need help, on how to access quickly to special characters like "ñ" or "á"? Motaro Linux - Newbie 1 12-31-2003 11:53 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 06:33 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