{"id":24912,"date":"2017-02-05T03:01:35","date_gmt":"2017-02-04T17:01:35","guid":{"rendered":"http:\/\/www.rjmprogramming.com.au\/ITblog\/?p=24912"},"modified":"2017-02-10T21:54:31","modified_gmt":"2017-02-10T11:54:31","slug":"linux-inode-file-removal-tutorial","status":"publish","type":"post","link":"https:\/\/www.rjmprogramming.com.au\/ITblog\/linux-inode-file-removal-tutorial\/","title":{"rendered":"Linux Inode File Removal Tutorial"},"content":{"rendered":"<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/Linux\/inode_rm.jpg\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"Linux Inode File Removal Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/Linux\/inode_rm.jpg\" title=\"Linux Inode File Removal Tutorial\"  style=\"float:left;\"  \/><\/a><p class=\"wp-caption-text\">Linux Inode File Removal Tutorial<\/p><\/div>\n<p>We think of the Linux and Unix concept of an <a target=_blank title='Inode link' href='http:\/\/www.grymoire.com\/Unix\/Inodes.html'>&#8220;inode&#8221;<\/a> as interesting in terms of an organizational design for a hard disk operating system, but more of a curiosity in most day to day interfacing to Linux.  After all, Windows and DOS don&#8217;t use, or seem to need the concept.  You may want to read more about this at <a title='Linux Inode Primer Tutorial' href='#lipt'>Linux Inode Primer Tutorial<\/a> as shown below.<\/p>\n<p>That is, until, the other day, we accidentally renamed a Linux web server file to contain funny characters, somehow occurring during some FileZilla sftp operations we were doing.  To FileZilla these &#8220;funny characters&#8221; only appear as a small blank left indentation to the filename as show with its GUI interface, but, go to the Linux command line via ssh and you see &#8230;<\/p>\n<p><code><br \/>\n# <a target=_blank title='Linux ls information' href='http:\/\/www.computerhope.com\/unix\/uls.htm'>ls<\/a> -li<br \/>\n...<br \/>\n...<br \/>\n2596915 -rw-r--r--     1 rjmprogr rjmprogr     44578 Sep 11 09:55 \\ \\ map.php<br \/>\n...<br \/>\n#<br \/>\n<\/code><\/p>\n<p> &#8230; and no matter what you try like &#8230;<\/p>\n<p><code><br \/>\n# <a target=_blank title='Linux rm information' href='http:\/\/www.computerhope.com\/unix\/urm.htm'>rm<\/a> -f \"*map.php\"<br \/>\n<\/code><\/p>\n<p> &#8230; or &#8230;<\/p>\n<p><code><br \/>\n# <a target=_blank title='Linux mv information' href='http:\/\/www.computerhope.com\/unix\/umv.htm'>mv<\/a> -i \"*map.php\" xx.xx<br \/>\n<\/code><\/p>\n<p> &#8230; or to attempt a clobber it with a local &#8220;map.php&#8221; via a FileZilla sftp file transfer, you cannot solve it causing problems via these conventional approaches.<\/p>\n<p>We knew there was a way with &#8220;inodes&#8221; but cannot embed it in the memory, for the few times you &#8220;have&#8221; to use it, so looked up Google to arrive at this <a target=_blank title='Useful link, thanks' href='https:\/\/www.linux.com\/blog\/linux-shell-tip-remove-files-names-contains-spaces-and-special-characters-such'>very useful link<\/a>&#8216;s advice (tip #5, starting with <I>ls -li<\/I>), thanks, so that we ended up at the Linux command line of an ssh session, going &#8230;<\/p>\n<p><code><br \/>\n<a target=_blank title='Linux find information' href='http:\/\/www.computerhope.com\/unix\/ufind.htm'>find<\/a> . -inum 2596915 -exec rm -i {} \\;<br \/>\n<\/code><\/p>\n<p> &#8230; to which you get prompted about removing that rogue file from the system, allowing for an orderly FileZilla sftp file transfer of local &#8220;map.php&#8221; to be achieved.  And it is at times like this that I bless the &#8220;inode&#8221; concept.  Please don&#8217;t think that you can&#8217;t get into a similar problem working with Windows (or DOS), because you can, but you&#8217;ll have to discover a method not involving &#8220;inodes&#8221; to get you out of your &#8220;pickle&#8221; there.<\/p>\n<hr>\n<p id='lipt'>Previous relevant <a target=_blank title='Linux Inode Primer Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/linux-inode-primer-tutorial\/'>Linux Inode Primer Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/Linux\/inode.jpg\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"Linux Inode Primer Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/Linux\/inode.jpg\" title=\"Linux Inode Primer Tutorial\"  style=\"float:left;\"  \/><\/a><p class=\"wp-caption-text\">Linux Inode Primer Tutorial<\/p><\/div>\n<p>When you learn Unix or Linux you are taught that a lot of things about how the operating system works are about files.<\/p>\n<p>And with Unix and Linux those files can often be (further) referenced via a number called an <a target=_blank title='Inode link' href='http:\/\/www.grymoire.com\/Unix\/Inodes.html'>inode<\/a> &#8230; to quote &#8230; <\/p>\n<blockquote><p>\n A Unix file is &#8220;stored&#8221; in two different parts of the disk &#8211; the data blocks and the inodes. (I won&#8217;t get into superblocks and other esoteric information.) The data blocks contain the &#8220;contents&#8221; of the file. The information about the file is stored elsewhere &#8211; in the inode.\n<\/p><\/blockquote>\n<p> &#8230; and this <i>inode<\/i> is examinable with the <i>stat<\/i> command to show &#8230; (and to quote again) &#8230;<\/p>\n<ul>\n<li>Mode\/permission (protection)<\/li>\n<li>Owner ID<\/li>\n<li>Group ID<\/li>\n<li>Size of file<\/li>\n<li>Number of hard links to the file<\/li>\n<li>Time last accessed<\/li>\n<li>Time last modified<\/li>\n<li>Time inode last modified<\/li>\n<\/ul>\n<p>Unix and linux operating systems will have a quota of <i>inode<\/i> numbers allowed, information for which can be found with a command like &#8220;df -ih&#8221; relevant to <i>inode<\/i> numbers used relative to quotas for each disk, which we talked about a bit at <a target=_blank href='https:\/\/www.rjmprogramming.com.au\/ITblog\/client-pre-emptive-iframe-crontab-curl-rotated-report-tutorial\/' title='Client Pre-Emptive Iframe Crontab Curl Rotated Report Tutorial'>Client Pre-Emptive Iframe Crontab Curl Rotated Report Tutorial<\/a>.<\/p>\n<p>We show a few <i>inode<\/i> related Linux commands <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/Linux\/inode.jpg\" title='Click picture'>here<\/a>.<\/p>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d19109' onclick='var dv=document.getElementById(\"d19109\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/linux\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d19109' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d24912' onclick='var dv=document.getElementById(\"d24912\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/inode\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d24912' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n","protected":false},"excerpt":{"rendered":"<p>We think of the Linux and Unix concept of an &#8220;inode&#8221; as interesting in terms of an organizational design for a hard disk operating system, but more of a curiosity in most day to day interfacing to Linux. After all, &hellip; <a href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/linux-inode-file-removal-tutorial\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12,29,37],"tags":[234,418,2007,469,1752,707,885,1872,1129,1190,1319,1339,1411],"class_list":["post-24912","post","type-post","status-publish","format-standard","hentry","category-elearning","category-operating-system","category-tutorials","tag-command-line","tag-file","tag-filezilla","tag-ftp","tag-inode","tag-linux","tag-operating-system-2","tag-rename","tag-sftp","tag-ssh","tag-tutorial","tag-unix","tag-web-server"],"_links":{"self":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/24912"}],"collection":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/comments?post=24912"}],"version-history":[{"count":7,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/24912\/revisions"}],"predecessor-version":[{"id":28139,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/24912\/revisions\/28139"}],"wp:attachment":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/media?parent=24912"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/categories?post=24912"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/tags?post=24912"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}