Removing Troublesome Files

  • Removing Files with a space in them - for example remove the file called Classification Scheme.to

    Put single quotes round the filename to hide the space from the shell, you could escape the space withg \ if you prefer. For files which begin with odd characters you may also want to start with ./ to prevent them being treated specially (esp the - char!).

    e.g.
    
     rm -i 'Classification scheme.do'
    
    or
    
     rm -i Classification\ scheme.do
    

    You may find that your shell will auto-complete to one of these if you start typing the name and hit TAB.

  • No such file or directory

    I have a file called .saves-28994-declaim.amt that I would like to delete. I tried rm -i '.saves-28994-declaim.amt'
    rm: cannot remove .saves-28994-declaim.amt: No such file or directory
    but as you can see I failed.

    The name seems to have been truncated for you. Press tab to ask the shell to auto-complete the filename for you.


Please email any suggestions, corrections, broken links, or errors to itweb [itweb@damtp.cam.ac.uk]