{"id":1361,"date":"2012-06-21T11:43:10","date_gmt":"2012-06-21T18:43:10","guid":{"rendered":"http:\/\/www.wellgolly.com\/?p=1361"},"modified":"2012-06-21T11:43:10","modified_gmt":"2012-06-21T18:43:10","slug":"osx-difference-from-linux","status":"publish","type":"post","link":"https:\/\/www.wellgolly.com\/?p=1361","title":{"rendered":"OSX difference from Linux"},"content":{"rendered":"<p>If you want to rename a file from the command line you use the mv command. Escape special characters (like spaces, asterisks, quotes, etc.) with a backslash. The backslash character itself is escaped with a backslash. So for example, &#8216;girl w\/ hoop&#8217; would be &#8216;girl\\ w\\\/\\ hoop&#8217;<\/p>\n<p>I tried running this command<br \/>\n<pre><code class=\"preserve-code-formatting\">\nmv GIRL\\ W\\\/HOOP.jpg GIRL\\ WITH\\ HOOP.jpg\n<\/code><\/pre><\/p>\n<p>and got back this error message<br \/>\n<pre><code class=\"preserve-code-formatting\">\nusage: mv [-f | -i | -n] [-v] source target\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mv [-f | -i | -n] [-v] source ... directory\n<\/code><\/pre><\/p>\n<p>You can also put the file name in quotes like so<br \/>\n<pre><code class=\"preserve-code-formatting\">\nmv &#039;GIRL W\/HOOP.jpg&#039; &#039;GIRL WITH HOOP.jpg&#039;\n<\/code><\/pre><\/p>\n<p>And you don\u2019t need to worry about spaces and special characters.<\/p>\n<p><b>Except<\/b> that OSX doesn\u2019t treat the \/ in a file name as a slash. It coverts it to a colon.<\/p>\n<p>To see this, drag a file with a forward slash from the desktop to the terminal. Note what happens.<br \/>\n<pre><code class=\"preserve-code-formatting\">\n\/Desktop\/GIRL\\ W:\\ HOOP.jpg\n<\/code><\/pre><\/p>\n<p>Spaces are escaped, but the forward slash is converted to a colon.<\/p>\n<p>So to get my move command to work I need to do this.<br \/>\n<pre><code class=\"preserve-code-formatting\">\nmv GIRL\\ W:HOOP.jpg GIRL\\ WITH\\ HOOP.jpg\n<\/code><\/pre><\/p>\n<p>And it\u2019s happy.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you want to rename a file from the command line you use the mv command. Escape special characters (like spaces, asterisks, quotes, etc.) with a backslash. The backslash character itself is escaped with a backslash. So for example, &#8216;girl w\/ hoop&#8217; would be &#8216;girl\\ w\\\/\\ hoop&#8217; I tried running this command mv GIRL\\ W\\\/HOOP.jpg &hellip; <a href=\"https:\/\/www.wellgolly.com\/?p=1361\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">OSX difference from Linux<\/span><\/a><\/p>\n","protected":false},"author":6,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-1361","post","type-post","status-publish","format-standard","hentry","category-computers"],"_links":{"self":[{"href":"https:\/\/www.wellgolly.com\/index.php?rest_route=\/wp\/v2\/posts\/1361","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wellgolly.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wellgolly.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wellgolly.com\/index.php?rest_route=\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wellgolly.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1361"}],"version-history":[{"count":0,"href":"https:\/\/www.wellgolly.com\/index.php?rest_route=\/wp\/v2\/posts\/1361\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wellgolly.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1361"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wellgolly.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1361"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wellgolly.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1361"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}