Home > Linux/Unix/Solaris, Shell scripting, Unix administration > Unix delete or rename a file starting with hyphen or junk character
Post to Twitter Post to Digg Printable version of this Post Printable version of this Post

Unix delete or rename a file starting with hyphen or junk character

Many a times we face a problem wherein mistakenly some files get created in a directory which are hard to rename or remove especially when working with putty terminal, by mistake if you paste come content on command prompt then it will create junk files with hyphen, tilde or any junk character in beginning.

For example “-abc”, “~abc” etc.

Solution:

In this case “rm -abc” or “rm ~abc” etc will not work. Simple solution is to use “rm ./-abc” or “rm./~abc” etc

:)

  • Share/Bookmark

Did this post solve your problem? If not, please open a FREE Support Ticket and we will help you FREE of cost.
  1. No comments yet.
  1. No trackbacks yet.