{"id":235,"date":"2010-04-27T16:52:56","date_gmt":"2010-04-27T11:22:56","guid":{"rendered":"http:\/\/www.oratraining.com\/blog\/?p=235"},"modified":"2010-04-27T16:52:56","modified_gmt":"2010-04-27T11:22:56","slug":"unix-delete-or-rename-a-file-starting-with-hyphen-or-junk-character","status":"publish","type":"post","link":"https:\/\/www.oratraining.com\/blog\/2010\/04\/unix-delete-or-rename-a-file-starting-with-hyphen-or-junk-character\/","title":{"rendered":"Unix delete or rename a file starting with hyphen or junk character"},"content":{"rendered":"<p>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.<\/p>\n<p>For example <span style=\"color: #0000ff;\">&#8220;-abc&#8221;<\/span>, <span style=\"color: #0000ff;\">&#8220;~abc&#8221;<\/span> etc.<\/p>\n<p><strong>Solution:<\/strong><\/p>\n<p>In this case &#8220;<span style=\"color: #0000ff;\">rm -abc<\/span>&#8221; or &#8220;<span style=\"color: #0000ff;\">rm ~abc<\/span>&#8221; etc will not work. Simple solution is to use &#8220;<span style=\"color: #0000ff;\">rm .\/-abc<\/span>&#8221; or &#8220;<span style=\"color: #0000ff;\">rm.\/~abc<\/span>&#8221; etc<\/p>\n<p>\ud83d\ude42<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[3,18,19],"tags":[58,63,92,96,110,122,127,141],"class_list":["post-235","post","type-post","status-publish","format-standard","hentry","category-linuxunixsolaris","category-shell-scripting","category-unix-administration-linuxunixsolaris","tag-delete","tag-file","tag-junk-character","tag-linux","tag-putty","tag-rename","tag-solaris","tag-unix"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.oratraining.com\/blog\/wp-json\/wp\/v2\/posts\/235","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.oratraining.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.oratraining.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.oratraining.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.oratraining.com\/blog\/wp-json\/wp\/v2\/comments?post=235"}],"version-history":[{"count":0,"href":"https:\/\/www.oratraining.com\/blog\/wp-json\/wp\/v2\/posts\/235\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.oratraining.com\/blog\/wp-json\/wp\/v2\/media?parent=235"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.oratraining.com\/blog\/wp-json\/wp\/v2\/categories?post=235"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.oratraining.com\/blog\/wp-json\/wp\/v2\/tags?post=235"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}