{"id":81,"date":"2008-07-30T21:09:24","date_gmt":"2008-07-31T04:09:24","guid":{"rendered":"https:\/\/www.wkiri.com\/today\/?p=81"},"modified":"2008-07-30T21:13:37","modified_gmt":"2008-07-31T04:13:37","slug":"what-i-do-with-my-shell","status":"publish","type":"post","link":"https:\/\/www.wkiri.com\/today\/?p=81","title":{"rendered":"What I do with my Shell"},"content":{"rendered":"<p><a href=\"http:\/\/lifehacker.com\/software\/unix\/review-your-most-oft+used-unix-commands-202712.php\">Lifehacker suggests<\/a> the following command to list your most frequently used commands:<\/p>\n<blockquote><p>\n<tt>history|awk '{print $2}'|awk 'BEGIN {FS=\"|\"} {print $1}'|sort|uniq -c|sort -r<\/tt>\n<\/p><\/blockquote>\n<p>The idea is to identify your frequent commands and then perhaps alias them to something shorter.  Unix being what it is, of course, you&#8217;re unlikely to save many keystrokes unless you&#8217;re aliasing not just the command but also its arguments.  Anyway, on my Mac, I get the following top 10 list:<\/p>\n<blockquote>\n<ul>\n<li>ls: what&#8217;s here?\n<li>cd: go somewhere else.\n<li>open: Mac-specific; spawns a Finder window if the argument is a directory or spawns the appropriate viewer\/editor for a graphics file, Word document, PDF file, etc.  I love this command.\n<li>ssh: connect to another machine (sorry, elysium!).\n<li>mv: move something to a better place.\n<li>latex: there can be only one typesetter.\n<li>less: less is more.  No, wait, less isn&#8217;t more.  Never mind; just display the contents of a text file.\n<li>df: how much disk space is left?  (I was getting close to the limit of my 100 GB!)\n<li>convert: magical utility that turns any graphics format into any other one.\n<\/ul>\n<\/blockquote>\n<p>On my linux machine at work, the same exercise turned up slightly different patterns:<\/p>\n<blockquote>\n<ul>\n<li>ls: or maybe it was the same pattern.\n<li>cd: like I said&#8230;\n<li>jobs: oh good, something different!  I run a lot of jobs on pavonis and often need help remembering what&#8217;s still running in which shell.\n<li>fg: foreground a job, leaving the others to languish in the darkness.\n<li>screen: oh, the joys of a detachable screen!  I want to learn to wield this magic even more.\n<li>less: less is still more!  Or maybe it isn&#8217;t.\n<li>cut: I love cutting and pasting in the shell.\n<li>bg: dismiss this job into the background wastelands, where it may toil in obscurity!\n<li>nice: try not to crowd out other users on the same machine.\n<li>top: find out who is crowding me out on my own machine.\n<\/ul>\n<\/blockquote>\n<p> I don&#8217;t see myself aliasing any of these in the near future, but it&#8217;s a fun self-data-mining exercise.  How do you use your shell?<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Lifehacker suggests the following command to list your most frequently used commands: history|awk &#8216;{print $2}&#8217;|awk &#8216;BEGIN {FS=&#8221;|&#8221;} {print $1}&#8217;|sort|uniq -c|sort -r The idea is to identify your frequent commands and then perhaps alias them to something shorter. Unix being what it is, of course, you&#8217;re unlikely to save many keystrokes unless you&#8217;re aliasing not just [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[23],"tags":[],"_links":{"self":[{"href":"https:\/\/www.wkiri.com\/today\/index.php?rest_route=\/wp\/v2\/posts\/81"}],"collection":[{"href":"https:\/\/www.wkiri.com\/today\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wkiri.com\/today\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wkiri.com\/today\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wkiri.com\/today\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=81"}],"version-history":[{"count":0,"href":"https:\/\/www.wkiri.com\/today\/index.php?rest_route=\/wp\/v2\/posts\/81\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wkiri.com\/today\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=81"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wkiri.com\/today\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=81"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wkiri.com\/today\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=81"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}