{"id":773,"date":"2010-01-22T05:33:30","date_gmt":"2010-01-22T10:33:30","guid":{"rendered":"http:\/\/www.gamescheat.ca\/?p=773"},"modified":"2019-09-04T19:57:39","modified_gmt":"2019-09-05T00:57:39","slug":"how-to-delete-a-file-or-directory-with-special-characters-using-the-inode-in-unix-or-linux","status":"publish","type":"post","link":"http:\/\/www.gamescheat.ca\/?p=773","title":{"rendered":"How to delete a file or directory with special characters using the inode in Unix or Linux"},"content":{"rendered":"<p>My fat fingers inadvertently created a directory on my unix server with special characters.  I could not access this directory nor could I delete it.  When I listed the directory using the command ls \u2013b, I could see all the funny characters.<\/p>\n<div style=\"float: left;\"><div style=\"margin: 15px 15px 15px 15px\";><script type=\"text\/javascript\"><!--\ngoogle_ad_client = \"pub-3319935785736004\";\ngoogle_alternate_color = \"FFFFFF\";\ngoogle_ad_width = 468;\ngoogle_ad_height = 60;\ngoogle_ad_format = \"468x60_as\";\ngoogle_ad_type = \"text_image\";\ngoogle_ad_channel =\"\";\ngoogle_color_border = \"cccccc\";\ngoogle_color_link = \"cc0000\";\ngoogle_color_bg = \"ffffff\";\ngoogle_color_text = \"000000\";\ngoogle_color_url = \"008000\";\n\/\/--><\/script>\n<script type=\"text\/javascript\"\n  src=\"http:\/\/pagead2.googlesyndication.com\/pagead\/show_ads.js\">\n<\/script><\/div><\/div><p>ls \u2013b<br \/>\nscritps010\/010\/010\/010<\/p>\n<p>I tried every command I could think of, rmdir \u201cscripts\u201d, rmdir \u201cscripts010\/010\/010\/010\u201d.  The only way to remove this directory was to delete it using the inode number.<\/p>\n<p>To determine the inode use the  -i option with the ls command.<br \/>\nls \u2013i<br \/>\n184538 scritps<\/p>\n<p>Below is the command syntax to delete the directory.<br \/>\nfind . \u2013inum 184538 \u2013exec rmdir {} \\;<\/p>\n<p>If you wanted to delete a stubborn file then simply substitute rmdir with rm.<br \/>\nfind . \u2013inum 184538 \u2013exec rm {} \\;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>My fat fingers inadvertently created a directory on my unix server with special characters. I could not access this directory nor could I delete it. When I listed the directory using the command ls \u2013b, I could see all the&hellip;<\/p>\n<p class=\"more-link-p\"><a class=\"more-link\" href=\"http:\/\/www.gamescheat.ca\/?p=773\">Read more &rarr;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[19],"tags":[21,55,64,35],"_links":{"self":[{"href":"http:\/\/www.gamescheat.ca\/index.php?rest_route=\/wp\/v2\/posts\/773"}],"collection":[{"href":"http:\/\/www.gamescheat.ca\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.gamescheat.ca\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.gamescheat.ca\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.gamescheat.ca\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=773"}],"version-history":[{"count":2,"href":"http:\/\/www.gamescheat.ca\/index.php?rest_route=\/wp\/v2\/posts\/773\/revisions"}],"predecessor-version":[{"id":775,"href":"http:\/\/www.gamescheat.ca\/index.php?rest_route=\/wp\/v2\/posts\/773\/revisions\/775"}],"wp:attachment":[{"href":"http:\/\/www.gamescheat.ca\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=773"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.gamescheat.ca\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=773"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.gamescheat.ca\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=773"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}