{"id":86,"date":"1997-09-09T01:36:29","date_gmt":"1997-09-09T09:36:29","guid":{"rendered":"http:\/\/www.birdhouse.org\/betips\/?p=86"},"modified":"1997-09-09T01:36:29","modified_gmt":"1997-09-09T09:36:29","slug":"batch-changing-filename-cases","status":"publish","type":"post","link":"https:\/\/www.betips.net\/?p=86","title":{"rendered":"Batch-changing filename cases"},"content":{"rendered":"<p>On occassion, you may find it useful to be able to change all the filenames in a directory from UPPERCASE to lowercase, or vice versa. This will be particularly true if you&#8217;re copying over file from a Windows 95\/98 partition, since Windows is so inconsistent with its case handling. Here&#8217;s a shell script you can use to automate the process. Type or copy the following lines into Terminal, one at a time:<\/p>\n<pre>\nfor i in * ; do\n  j=`echo $i|tr 'A-Z' 'a-z'`\n  mv \"$i\" \"$j\"\ndone\n<\/pre>\n<p>  To change from lowercase to uppercase, reverse the order of &#8218;A-Z&#8216; &#8218;a-z&#8216;. The script requires that the <b>tr<\/b> utility be in your \/bin\/ directory, which it should be by default. If you think you&#8217;ll use this often, make a script out of it for later use. Paste the above into a text file, but add the line <code><br \/>\n<\/code> to the top, as the first line. Save it with the name &#8222;lowercase.&#8220; Then make it executable by typing <b>chmod 755 lowercase<\/b> into Terminal. Edit the file again to do the uppercasing trick, and save the new file as &#8222;uppercase.&#8220; Run chmod on that too. Move both of these files to your \/boot\/home\/config\/bin\/ directory, and they&#8217;ll always be available to you from the command line.<br \/>\n If you&#8217;d rather download these scripts, ready to run, you can get them <a href=\"\/software\/\">here<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>On occassion, you may find it useful to be able to change all the filenames in a directory from UPPERCASE to lowercase, or vice versa. This will be particularly true if you&#8217;re copying over file from a Windows 95\/98 partition, since Windows is so inconsistent with its case handling. Here&#8217;s a shell script you can [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[10],"class_list":["post-86","post","type-post","status-publish","format-standard","hentry","tag-scripting"],"_links":{"self":[{"href":"https:\/\/www.betips.net\/index.php?rest_route=\/wp\/v2\/posts\/86","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.betips.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.betips.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.betips.net\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.betips.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=86"}],"version-history":[{"count":0,"href":"https:\/\/www.betips.net\/index.php?rest_route=\/wp\/v2\/posts\/86\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.betips.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=86"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.betips.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=86"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.betips.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=86"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}