{"id":894,"date":"2010-08-26T20:33:44","date_gmt":"2010-08-27T04:33:44","guid":{"rendered":"http:\/\/www.codebelay.com\/blog\/?p=894"},"modified":"2010-08-26T20:33:44","modified_gmt":"2010-08-27T04:33:44","slug":"commands-i-use-frequently","status":"publish","type":"post","link":"https:\/\/www.codebelay.com\/blog\/2010\/08\/26\/commands-i-use-frequently\/","title":{"rendered":"Commands I Use Frequently"},"content":{"rendered":"<p>Here&#8217;s a list of commands I use frequently, where the first number represents the number of times I used that command today:<\/p>\n<p>86\tgit &#8211; the best version control software ever<br \/>\n59   cd &#8211; used to change directories on the command-line<br \/>\n54\tls &#8211; used to list files in a directory<br \/>\n41\tvim &#8211; when textmate just isn&#8217;t fast enough for moving and manipulating text I use this text editor<br \/>\n24\tgrep &#8211; this is great for searching through code<br \/>\n21\tsudo &#8211; I use this for stopping and starting servers and anything that requires super user access<\/p>\n<p>I figured this out by using the following:<\/p>\n<div style=\"padding: 5px 5px 5px 5px; background: #000; color: #fff\">\nhistory | cut -c8-20 | sort > commands.txt\n<\/div>\n<p>I created the following script in Perl:<\/p>\n<div style=\"padding: 5px 5px 5px 5px; background: #000; color: #fff\">\n#!\/usr\/bin\/env perl<\/p>\n<p>use strict;<br \/>\nuse warnings;<\/p>\n<p>my %h_list = ();<br \/>\nmy @sorted = ();<br \/>\nmy @listed = ();<\/p>\n<p>open(LS, &#8220;commands.txt&#8221;);<br \/>\nwhile(<LS>) {<br \/>\n  if ($_ =~ \/(\\w+)\/) {<br \/>\n    $h_list{$1}++;<br \/>\n  }<br \/>\n}<\/p>\n<p>close(LS);<\/p>\n<p>foreach my $key (keys %h_list)<br \/>\n{<br \/>\n  push @listed, $h_list{$key} . &#8220;\\t&#8221; . $key;<br \/>\n}<\/p>\n<p>@sorted = sort { $b <=> $a } @listed;<br \/>\nforeach (@sorted)<br \/>\n{<br \/>\n  print $_ . &#8220;\\n&#8221;;<br \/>\n}<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Here&#8217;s a list of commands I use frequently, where the first number represents the number of times I used that command today: 86 git &#8211; the best version control software ever 59 cd &#8211; used to change directories on the command-line 54 ls &#8211; used to list files in a directory 41 vim &#8211; when [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[170,4,289],"tags":[],"class_list":["post-894","post","type-post","status-publish","format-standard","hentry","category-command-line","category-how-to","category-sysadmin"],"_links":{"self":[{"href":"https:\/\/www.codebelay.com\/blog\/wp-json\/wp\/v2\/posts\/894","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.codebelay.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.codebelay.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.codebelay.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.codebelay.com\/blog\/wp-json\/wp\/v2\/comments?post=894"}],"version-history":[{"count":0,"href":"https:\/\/www.codebelay.com\/blog\/wp-json\/wp\/v2\/posts\/894\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.codebelay.com\/blog\/wp-json\/wp\/v2\/media?parent=894"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.codebelay.com\/blog\/wp-json\/wp\/v2\/categories?post=894"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.codebelay.com\/blog\/wp-json\/wp\/v2\/tags?post=894"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}