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
🙂
Recent Comments