{"id":5143,"date":"2015-08-16T20:22:18","date_gmt":"2015-08-16T12:22:18","guid":{"rendered":"http:\/\/rmohan.com\/?p=5143"},"modified":"2015-08-16T20:22:18","modified_gmt":"2015-08-16T12:22:18","slug":"finding-the-process-that-locked-a-port-in-aix","status":"publish","type":"post","link":"https:\/\/mohan.sg\/?p=5143","title":{"rendered":"Finding the process that locked a port in AIX"},"content":{"rendered":"<div class=\"paragraph\"><strong>Finding the process that locked a port in\u00a0AIX<\/strong><br \/>\n<strong>********************************************************************<\/strong><br \/>\nRun the following command to check if port is in use<\/p>\n<p># netstat -an | grep &lt;port number&gt;<\/p>\n<p>If above returns the connection, then run the following command to get the address of the port number<\/p>\n<p># netstat -Aan | grep &lt;port number&gt;<\/p>\n<p>Once you have the address of the port number, run the following command to get the process id that is using the port.<\/p>\n<p># rmsock &lt;address of port number&gt; tcpcb<\/p>\n<p>Example<br \/>\n# netstat -an | grep 30767 tcp4 \u00a0 \u00a0 \u00a0 0 \u00a0 \u00a0 \u00a00 \u00a0*.30767 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0*.* \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0LISTEN # netstat -Aan | grep 30767 f100060001b2f398 tcp4 \u00a0 \u00a0 \u00a0 0 \u00a0 \u00a0 \u00a00 \u00a0*.30767 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0*.* \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0LISTEN # rmsock\u00a0f100060001b2f398 tcpcb The socket 0x1b2f008 is being held by proccess 942150 (vcs_agent).<\/p>\n<\/div>\n<div>\n<div><\/div>\n<hr class=\"styled-hr\" \/>\n<div><\/div>\n<\/div>\n<div class=\"paragraph\">Find Command\u00a0General syntax of \u201cfind\u201d command<br \/>\n$ find &lt;where&gt; &lt;condition&gt; &lt;action&gt;<br \/>\nFInd The Largest Files in a Directory<br \/>\n*************************************************<br \/>\nfind \/web( path mentioned ) \u00a0-xdev -type f -ls |awk &#8216;{print $7&#8243; &#8220;$8&#8221; &#8220;$9&#8221; &#8220;$10&#8221; &#8220;$11}&#8217;|sort -rn |head -20<br \/>\ndu -a . | sort -nr | head<\/p>\n<p>*******************************************************<br \/>\nWorking with Crontab<br \/>\n********************************************************<br \/>\n&#8212;-&gt;crontab -l \u00a0 \u00a0&#8212;- list all the cron jobs<br \/>\n&#8212;-&gt;crontab -e \u00a0 \u00a0&#8212;- to edit the cronjobs<br \/>\n&#8212;-&gt;crontab -r &#8212;&#8211; to remove the crons(before removing it create a backup)<br \/>\n&#8212;-&gt;crontab -l &gt; filename.txt<br \/>\n&#8212;-&gt;crontab -e filename.txt<br \/>\n&#8212;-&gt;crontab filename.txt.<\/p><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Finding the process that locked a port in AIX ******************************************************************** Run the following command to check if port is in use<\/p>\n<p># netstat -an | grep &lt;port number&gt;<\/p>\n<p>If above returns the connection, then run the following command to get the address of the port number<\/p>\n<p># netstat -Aan | grep &lt;port number&gt;<\/p>\n<p>Once you [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[31],"tags":[],"_links":{"self":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/5143"}],"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=5143"}],"version-history":[{"count":1,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/5143\/revisions"}],"predecessor-version":[{"id":5144,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/5143\/revisions\/5144"}],"wp:attachment":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5143"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5143"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5143"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}