More Unix questions - Unix

This is a discussion on More Unix questions - Unix ; Hello again, I have two more questions: 1. How can I remove a file whose name starts with a dash? Example, "-error" ? 2. How can I delete an unusually named file using its i-node value? Many thanks in advance ...

+ Reply to Thread
Results 1 to 4 of 4

Thread: More Unix questions

  1. More Unix questions

    Hello again,

    I have two more questions:

    1. How can I remove a file whose name starts with a dash? Example,
    "-error" ?

    2. How can I delete an unusually named file using its i-node value?

    Many thanks in advance

    Regards
    Herbert


  2. Re: More Unix questions

    Herbert wrote:
    > 1. How can I remove a file whose name starts with a dash? Example,
    > "-error" ?


    rm -- -error

    --
    reply to usenet only

  3. Re: More Unix questions

    On 9 Sep 2005 08:17:08 -0700, Herbert wrote:
    > Hello again,
    >
    > I have two more questions:
    >
    > 1. How can I remove a file whose name starts with a dash? Example,
    > "-error" ?


    Are you doing homework? Sure smells like it. Please google for the
    FAQ, it will save us all some time.

    > 2. How can I delete an unusually named file using its i-node value?



  4. Re: More Unix questions

    Herbert wrote:
    > I have two more questions:


    Please give your posts a more descriptive subject. Just about every
    post here is a unix question.


    > 1. How can I remove a file whose name starts with a dash? Example,
    > "-error" ?


    rm ./-error
    People will suggest other methods, but this is the most universally
    applicable.


    > 2. How can I delete an unusually named file using its i-node value?


    Assuming the inode is 12345,
    find . -inum 12345 -exec rm {}\;

    --
    Oh to have a lodge in some vast wilderness. Where rumors of oppression
    and deceit, of unsuccessful and successful wars may never reach me
    anymore.
    -- William Cowper

+ Reply to Thread