{"id":6050,"date":"2016-07-14T22:27:02","date_gmt":"2016-07-14T14:27:02","guid":{"rendered":"http:\/\/rmohan.com\/?p=6050"},"modified":"2016-07-14T22:39:19","modified_gmt":"2016-07-14T14:39:19","slug":"solaris-tips-and-tricks","status":"publish","type":"post","link":"https:\/\/mohan.sg\/?p=6050","title":{"rendered":"Solaris Tips and Tricks"},"content":{"rendered":"<p><strong>Solaris Tips and Tricks<\/strong><br \/>\nPS Long Listing<br \/>\nYou want to see the whole command, but &#8211; how annoying &#8211; ps truncates to 80 characters.<\/p>\n<p>\/usr\/ucb\/ps augxww<br \/>\ngives full command listings.<\/p>\n<p>If you&#8217;re only interested in one process, an excellent alternative is pargs which lists the command line arguments for a given command.<\/p>\n<p>For example:<br \/>\npargs 12345<br \/>\nWill give all the command line arguments for process ID 12345<\/p>\n<p>Compressing a Tar file upon creation<br \/>\nThe standard Solaris version of tar misses the compression options found on fruitier versions of *nix. Never mind &#8211; we can use pipes to compress and uncompress archives.<\/p>\n<p>Creating and compressing a tar file:<br \/>\ntar cvf &#8211; \/home\/doug\/stuff_to_backup | gzip > my_tar_file.tar.gz<\/p>\n<p>Uncompressing and extracting a tar file:<br \/>\ngunzip -c tar_file_to_uncompress.tar.gz | tar xvf &#8211;<\/p>\n<p>Netstat counts<br \/>\nA quick view of the state of your TCP connections can be very useful &#8211; here&#8217;\u2019s a quick and dirty (nice and simple) way of getting that information.<br \/>\nbash-3.00$ echo &#8220;Total: &#8221; `netstat | wc -l`<\/p>\n<p>Total:  1756<br \/>\nbash-3.00$ netstat | perl -pe &#8216;split;$_=&#8221;$_[6]\\n&#8221;&#8216; | sort | uniq -c | sort -n -k 1,1<\/p>\n<p>   1 &#8212;&#8212;&#8212;&#8211;<br \/>\n   1 Remote<br \/>\n   1 Rwind<br \/>\n   7<br \/>\n  20 LAST_ACK<br \/>\n  26 FIN_WAIT_2<br \/>\n 130 ESTABLISHED<br \/>\n 642 CLOSE_WAIT<br \/>\n 946 TIME_WAIT<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Solaris Tips and Tricks PS Long Listing You want to see the whole command, but &#8211; how annoying &#8211; ps truncates to 80 characters.<\/p>\n<p>\/usr\/ucb\/ps augxww gives full command listings.<\/p>\n<p>If you&#8217;re only interested in one process, an excellent alternative is pargs which lists the command line arguments for a given command.<\/p>\n<p>For example: pargs [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[39],"tags":[],"_links":{"self":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/6050"}],"collection":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=6050"}],"version-history":[{"count":1,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/6050\/revisions"}],"predecessor-version":[{"id":6051,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/6050\/revisions\/6051"}],"wp:attachment":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=6050"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=6050"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=6050"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}