{"id":1037,"date":"2011-12-23T13:14:43","date_gmt":"2011-12-23T18:14:43","guid":{"rendered":"http:\/\/ywwg.com\/wordpress\/?p=1037"},"modified":"2011-12-23T13:14:43","modified_gmt":"2011-12-23T18:14:43","slug":"making-find-simpler-on-linux","status":"publish","type":"post","link":"https:\/\/ywwg.com\/wordpress\/archives\/1037","title":{"rendered":"Making &#8216;find&#8217; simpler on linux"},"content":{"rendered":"<p>The &#8220;find&#8221; command, which searches directories for files, is great but requires a lot of options to perform a simple search.  Usually I want to search the current directory for a specific file name, but doing that requires all this typing:<\/p>\n<p><code>find .\/ -iname \"*my_search_term*\"<\/code><\/p>\n<p>What I would like to be able to is just type:<br \/>\n<code>f my search term<\/code><\/p>\n<p>and have it match files that look like that.  Here&#8217;s a little bash script I call &#8220;find.sh&#8221; that does it:<\/p>\n<p><code>#!\/bin\/bash<br \/>\nargs=`echo \"$*\" | sed -e \"s\/ \/*\/g\"`<br \/>\neval find .\/ -iname \\\"*$args*\\\"<\/code><\/p>\n<p>then just put the following in your ~\/.bashrc<br \/>\n<code>alias f=\"\/location\/to\/find.sh\"<\/code><\/p>\n<p>This script takes the arguments, converts spaces to wildcards, then does a case-insensitive search of the current directory.  So &#8220;f foo bar&#8221; gets translated to <code>find .\/ -iname \"*foo*bar*\"<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The &#8220;find&#8221; command, which searches directories for files, is great but requires a lot of options to perform a simple search. Usually I want to search the current directory for a specific file name, but doing that requires all this typing: find .\/ -iname &#8220;*my_search_term*&#8221; What I would like to be able to is just &hellip; <a href=\"https:\/\/ywwg.com\/wordpress\/archives\/1037\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Making &#8216;find&#8217; simpler on linux&#8221;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[23,13],"tags":[],"_links":{"self":[{"href":"https:\/\/ywwg.com\/wordpress\/wp-json\/wp\/v2\/posts\/1037"}],"collection":[{"href":"https:\/\/ywwg.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ywwg.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ywwg.com\/wordpress\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/ywwg.com\/wordpress\/wp-json\/wp\/v2\/comments?post=1037"}],"version-history":[{"count":3,"href":"https:\/\/ywwg.com\/wordpress\/wp-json\/wp\/v2\/posts\/1037\/revisions"}],"predecessor-version":[{"id":1040,"href":"https:\/\/ywwg.com\/wordpress\/wp-json\/wp\/v2\/posts\/1037\/revisions\/1040"}],"wp:attachment":[{"href":"https:\/\/ywwg.com\/wordpress\/wp-json\/wp\/v2\/media?parent=1037"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ywwg.com\/wordpress\/wp-json\/wp\/v2\/categories?post=1037"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ywwg.com\/wordpress\/wp-json\/wp\/v2\/tags?post=1037"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}