Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 06-10-2015, 07:04 PM   #1
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, 07:05 PM   #2
LQ Guru
Registered: May 2005
Location: boston, usa
Distribution: fc-15/ fc-20-live-usb/ aix
Posts: 5,145

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

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

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

From man bash
       --        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-10-2015, 11:14 PM   #5
Senior Member
Registered: Dec 2009
Location: New Jersey, USA
Distribution: Debian, Arch
Posts: 1,163
Blog Entries: 7

Rep: Reputation: 331Reputation: 331Reputation: 331Reputation: 331
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.


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 06:41 PM
remove "Suspend" and "Hibernate" from the "Shut Down" applet cccc Debian 2 05-02-2011 10:05 AM
[SOLVED] Remove "Wine core exe" in "Open with" menu (Ubuntu) tranduyhung Linux - Software 3 01-13-2011 07:21 PM
Qt "cannot call constructor for""a function-style cast remove the redundant ::QBrush" Peterius Linux - Software 4 11-24-2010 04: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 08:16 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:58 PM.

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