{"id":578,"date":"2011-09-01T16:16:54","date_gmt":"2011-09-01T23:16:54","guid":{"rendered":"http:\/\/www.coastalvectors.com\/blog\/?p=578"},"modified":"2012-02-20T00:14:48","modified_gmt":"2012-02-20T07:14:48","slug":"never-type-this-as-root","status":"publish","type":"post","link":"https:\/\/www.coastalvectors.com\/blog\/2011\/09\/never-type-this-as-root\/","title":{"rendered":"Never Type This As Root"},"content":{"rendered":"<p><a href=\"http:\/\/www.coastalvectors.com\/blog\/wp-content\/uploads\/2011\/09\/terminal.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-593\" title=\"terminal\" src=\"http:\/\/www.coastalvectors.com\/blog\/wp-content\/uploads\/2011\/09\/terminal-300x300.jpg\" alt=\"\" width=\"300\" height=\"300\" srcset=\"https:\/\/www.coastalvectors.com\/blog\/wp-content\/uploads\/2011\/09\/terminal-300x300.jpg 300w, https:\/\/www.coastalvectors.com\/blog\/wp-content\/uploads\/2011\/09\/terminal-150x150.jpg 150w, https:\/\/www.coastalvectors.com\/blog\/wp-content\/uploads\/2011\/09\/terminal.jpg 400w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>I was working on a shell script this morning to make my life easier on some trivial task. The last few lines looked a little like this.<br \/>\n<br \/>\n<code>somedir=\/mnt\/tmp<br \/>\nmv $somedir\/*.txt ~<br \/>\nrm -rf $somdir\/*<\/code><br \/>\nObviously I meant to remove all the files in the directory, however a typo in the variable name led to the deletion of \/. I caught it before it got to the home folder, but bin and dev were gone resulting in a broken system that needed to be reinstalled.<\/p>\n<p>Never delete * as root unless you are sure you know what you are doing&#8230;.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I was working on a shell script this morning to make my life easier on some trivial task. The last few lines looked a little like this. somedir=\/mnt\/tmp mv $somedir\/*.txt ~ rm -rf $somdir\/* Obviously I meant to remove all the files in the directory, however a typo in the variable name led to the &hellip; <a href=\"https:\/\/www.coastalvectors.com\/blog\/2011\/09\/never-type-this-as-root\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Never Type This As Root<\/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":[8],"tags":[],"class_list":["post-578","post","type-post","status-publish","format-standard","hentry","category-programming"],"_links":{"self":[{"href":"https:\/\/www.coastalvectors.com\/blog\/wp-json\/wp\/v2\/posts\/578","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.coastalvectors.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.coastalvectors.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.coastalvectors.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.coastalvectors.com\/blog\/wp-json\/wp\/v2\/comments?post=578"}],"version-history":[{"count":7,"href":"https:\/\/www.coastalvectors.com\/blog\/wp-json\/wp\/v2\/posts\/578\/revisions"}],"predecessor-version":[{"id":605,"href":"https:\/\/www.coastalvectors.com\/blog\/wp-json\/wp\/v2\/posts\/578\/revisions\/605"}],"wp:attachment":[{"href":"https:\/\/www.coastalvectors.com\/blog\/wp-json\/wp\/v2\/media?parent=578"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.coastalvectors.com\/blog\/wp-json\/wp\/v2\/categories?post=578"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.coastalvectors.com\/blog\/wp-json\/wp\/v2\/tags?post=578"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}