LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-10-2015, 08:04 PM   #1
dthims
Member
 
Registered: Mar 2003
Posts: 48

Rep: Reputation: 1
can't remove file "-r"


have been trying to get rid of that file, its in the home directory. permission for that file is 644. tried rm -f "-r" did not work.
 
Old 06-10-2015, 08:05 PM   #2
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fc-15/ fc-20-live-usb/ aix
Posts: 5,027

Rep: Reputation: 845Reputation: 845Reputation: 845Reputation: 845Reputation: 845Reputation: 845Reputation: 845
Code:
rm ./-r
 
1 members found this post helpful.
Old 06-10-2015, 08:09 PM   #3
dthims
Member
 
Registered: Mar 2003
Posts: 48

Original Poster
Rep: Reputation: 1
thnx for the quick reply. it worked
 
Old 06-10-2015, 11:26 PM   #4
Sefyir
Member
 
Registered: Mar 2015
Distribution: Linux Mint
Posts: 385

Rep: Reputation: 158Reputation: 158
-- is used to say "there are no more options after this"
So while this means recursively remove filea
Code:
rm -r filea
This means remove the file -r and remove the file filea
Code:
rm -- -r filea

From man bash
Code:
       --        A -- signals the end of options and disables  further  option
                 processing.   Any arguments after the -- are treated as file‐
                 names and arguments.  An argument of - is equivalent to --.
 
3 members found this post helpful.
Old 06-11-2015, 12:14 AM   #5
goumba
Senior Member
 
Registered: Dec 2009
Location: New Jersey, USA
Distribution: Debian Sid. Arch. In the process of converting to and learning FreeBSD
Posts: 1,023
Blog Entries: 6

Rep: Reputation: 237Reputation: 237Reputation: 237
Quote:
Originally Posted by Sefyir View Post
-- is used to say "there are no more options after this"
It is useful to note that this applies to all of your base utilities - cp, mv, &c.
 
  


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
unpredictable "delete" "move to trash" or "cut" file menu option dorianrenato Linux - General 3 11-28-2011 07:41 PM
remove "Suspend" and "Hibernate" from the "Shut Down" applet cccc Debian 2 05-02-2011 11:05 AM
[SOLVED] Remove "Wine core exe" in "Open with" menu (Ubuntu) tranduyhung Linux - Software 3 01-13-2011 08:21 PM
Qt "cannot call constructor for""a function-style cast remove the redundant ::QBrush" Peterius Linux - Software 4 11-24-2010 05:57 PM
[SOLVED] Script to remove lines in a file with more than "x" instances of any character ? pissed_budgie Programming 12 10-08-2010 09:16 PM


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