{"id":277,"date":"2025-01-05T11:22:56","date_gmt":"2025-01-05T16:22:56","guid":{"rendered":"https:\/\/triosdevelopers.com\/J.Smith\/rjeffsmith.ca\/wordpress\/?p=277"},"modified":"2025-01-05T11:22:56","modified_gmt":"2025-01-05T16:22:56","slug":"remove-invalid-files-by-inode","status":"publish","type":"post","link":"https:\/\/triosdevelopers.com\/J.Smith\/rjeffsmith.ca\/wordpress\/?p=277","title":{"rendered":"Remove invalid files by inode"},"content":{"rendered":"\n<p>This is for when you find files with invalid names that regular &#8216;rm&#8217; won&#8217;t touch, eg.:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>387090 drwx------ 3 root root 4.0K Aug 4 17:14 ''$'\\033''&#91;?25h'$'\\033''&#91;?7h'\/<\/code><\/pre>\n\n\n\n<p>First you need to get the inode, using:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><code>ls -il<\/code><\/code><\/pre>\n\n\n\n<p>this will show the inode at the left.<\/p>\n\n\n\n<p>To remove the file, use the &#8216;find&#8217; command.  First we&#8217;ll see what &#8216;find&#8217; can see:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>find . -inum (inode number from before)<\/code><\/pre>\n\n\n\n<p>You should see just your invalid file.  Remove it with:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>find . -inum (inode number from before)  -exec rm -rf {} \\;<\/code><\/pre>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This is for when you find files with invalid names that regular &#8216;rm&#8217; won&#8217;t touch, eg.: First you need to get the inode, using: this will show the inode at the left. To remove the file, use the &#8216;find&#8217; command. First we&#8217;ll see what &#8216;find&#8217; can see: You should see just your invalid file. Remove [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[15,10],"tags":[],"class_list":["post-277","post","type-post","status-publish","format-standard","hentry","category-file-management","category-raspberry-pi"],"_links":{"self":[{"href":"https:\/\/triosdevelopers.com\/J.Smith\/rjeffsmith.ca\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/277","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/triosdevelopers.com\/J.Smith\/rjeffsmith.ca\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/triosdevelopers.com\/J.Smith\/rjeffsmith.ca\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/triosdevelopers.com\/J.Smith\/rjeffsmith.ca\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/triosdevelopers.com\/J.Smith\/rjeffsmith.ca\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=277"}],"version-history":[{"count":1,"href":"https:\/\/triosdevelopers.com\/J.Smith\/rjeffsmith.ca\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/277\/revisions"}],"predecessor-version":[{"id":278,"href":"https:\/\/triosdevelopers.com\/J.Smith\/rjeffsmith.ca\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/277\/revisions\/278"}],"wp:attachment":[{"href":"https:\/\/triosdevelopers.com\/J.Smith\/rjeffsmith.ca\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=277"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/triosdevelopers.com\/J.Smith\/rjeffsmith.ca\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=277"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/triosdevelopers.com\/J.Smith\/rjeffsmith.ca\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=277"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}