LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   how to ls/cat/rm a file named "--help" (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-ls-cat-rm-a-file-named-help-730560/)

manoj_isi 06-03-2009 11:26 PM

how to ls/cat/rm a file named "--help"
 
I was wondering how to "ls" or "cat" or "rm" a file whose name is "--help" ???

Wim Sturkenboom 06-03-2009 11:46 PM

Code:

rm -- --help
From the man pages for rm:
Code:

POSIX OPTIONS
      -f    Do not prompt for confirmation. Do not write diagnostic messages.  Do not produce an error return status
              if the only errors were nonexisting files.

      -i    Prompt for confirmation.  (In case both -f and -i are given, the last one given takes effect.)

      -r or -R
              Recursively remove directory trees.

      --    Terminate option list.


ArfaSmif 06-04-2009 01:45 AM

rm -i ./--help

also works


All times are GMT -5. The time now is 12:04 PM.