{"id":198,"date":"2012-12-16T17:59:45","date_gmt":"2012-12-16T23:59:45","guid":{"rendered":"http:\/\/www.evermoretechnologies.com\/blog\/?p=198"},"modified":"2012-12-16T17:59:45","modified_gmt":"2012-12-16T23:59:45","slug":"mass-renaming-files","status":"publish","type":"post","link":"https:\/\/www.evermoretechnologies.com\/blog\/2012\/12\/mass-renaming-files\/","title":{"rendered":"Mass renaming files"},"content":{"rendered":"<p>So, I&#8217;m a noob when it comes to linux bash stuff, but I had a situation where I needed to strip the parenthesses out of a bunch of files provided to me because the system they were going into didn&#8217;t like them in image file names.<\/p>\n<p>A little bit of google searching lead me to a simple bash answer. \u00a0(I knew it was powerfull stuff.)<\/p>\n<p>So, here is the answer to all my problems, typed in to a terminal from the directory I needed to rename files in:<\/p>\n<p>[code]#!\/bin\/bash<br \/>\n    for i in *.jpg<br \/>\n        do<br \/>\n        x=${i\/\/[()]\/}<br \/>\n        echo &quot;$i renames to: $x&quot;<br \/>\n        mv $i $x<br \/>\n    done<br \/>\n[\/code]<\/p>\n<p>Thanks to this page for steering me in the right direction: http:\/\/www.linuxquestions.org\/questions\/linux-software-2\/how-do-you-remove-parenthesis-from-filenames-using-sed-812975\/<\/p>\n","protected":false},"excerpt":{"rendered":"<p>So, I&#8217;m a noob when it comes to linux bash stuff, but I had a situation where I needed to strip the parenthesses out of a bunch of files provided&#8230; <a href=\"https:\/\/www.evermoretechnologies.com\/blog\/2012\/12\/mass-renaming-files\/\">Read more &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/www.evermoretechnologies.com\/blog\/wp-json\/wp\/v2\/posts\/198"}],"collection":[{"href":"https:\/\/www.evermoretechnologies.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.evermoretechnologies.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.evermoretechnologies.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.evermoretechnologies.com\/blog\/wp-json\/wp\/v2\/comments?post=198"}],"version-history":[{"count":0,"href":"https:\/\/www.evermoretechnologies.com\/blog\/wp-json\/wp\/v2\/posts\/198\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.evermoretechnologies.com\/blog\/wp-json\/wp\/v2\/media?parent=198"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.evermoretechnologies.com\/blog\/wp-json\/wp\/v2\/categories?post=198"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.evermoretechnologies.com\/blog\/wp-json\/wp\/v2\/tags?post=198"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}