Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

small query about rm'ing files

  • 09-01-2003 12:09PM
    #1
    Banned (with Prison Access) Posts: 23,555 ✭✭✭✭


    I have a file on a linux account called "--remove-files" ... created after a rather silly mistake using tar :)


    anyway. I can't figure out how to delete it.. when I try a simple rm I get
    <mordeth@frink> [~] $ rm --remove-files
    rm: unrecognized option `--remove-files'
    Try `rm --help' for more information.


    same problem with I try "--remove-files"

    when I try rm *remove* I get the same error too.. I even tried ls *remove* and got this

    <mordeth@frink> [~] $ ls *remove*
    ls: unrecognized option `--remove-files'
    Try `ls --help' for more information.


    any ideas? it's not incredibly important but still.. it's annoying having it there


Comments

  • Registered Users, Registered Users 2 Posts: 6,265 ✭✭✭MiCr0


    use the full path
    so if its in /blah/blah
    # rm /blah/blah/--remove-files


  • Banned (with Prison Access) Posts: 23,555 ✭✭✭✭Sir Digby Chicken Caesar


    *mutter*

    5 seconds after posting this I remember all about #unix.ie

    thx Micr0 for the help :)

    for anyonte interested all I had to do was use the full path of the file

    rm /blah/blah/--remove-files

    and that worked :)


  • Closed Accounts Posts: 741 ✭✭✭longword


    Alternative method, and this works for nearly all the command line utilities, is to use -- to denote the end of all command line options (but not parameters). i.e.

    rm -- --remove-files

    Also handy if for example you're trying to grep for -v in a bunch of files. grep -v * isn't gonna work. grep -- -v * will bring much happiness and satisfaction.


Advertisement