OS / Ubuntu16.04 / Uncategorized

Ubuntu Ports, Process Commands

sudo netstat -peanut : Lists all the processes with ports

sudo netstat -peant | grep ":9300 "

user@user-HP-Compaq-8100-Elite-SFF-PC:/opt/logstash/bin$ sudo netstat -lanpt | grep LIST | grep java
tcp        0      0 127.0.0.1:63342         0.0.0.0:*               LISTEN      6493/java
tcp        0      0 0.0.0.0:39953           0.0.0.0:*               LISTEN      6493/java
tcp        0      0 127.0.0.1:6942          0.0.0.0:*               LISTEN      6493/java
tcp        0      0 127.0.0.1:35040         0.0.0.0:*               LISTEN      6493/java
tcp6       0      0 127.0.0.1:36237         :::*                    LISTEN      7028/java
tcp6       0      0 :::9200                 :::*                    LISTEN      15290/java
tcp6       0      0 :::9300                 :::*                    LISTEN      15290/java
tcp6       0      0 :::33527                :::*                    LISTEN      8160/java
tcp6       0      0 :::57852                :::*                    LISTEN      8160/java

user@user-HP-Compaq-8100-Elite-SFF-PC:/opt/logstash/bin$ ps auwwx | grep 15290
elastic+ 15290  0.7  4.0 4631044 323400 ?      Ssl  17:37   0:32 /usr/bin/java -Xms256m -Xmx1g -Djava.awt.headless=true -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -XX:+HeapDumpOnOutOfMemoryError -XX:+DisableExplicitGC -Dfile.encoding=UTF-8 -Delasticsearch -Des.foreground=yes -Des.path.home=/usr/share/elasticsearch -cp :/usr/share/elasticsearch/lib/elasticsearch-1.7.6.jar:/usr/share/elasticsearch/lib/*:/usr/share/elasticsearch/lib/sigar/* -Des.pidfile=/var/run/elasticsearch/elasticsearch.pid -Des.default.path.home=/usr/share/elasticsearch -Des.default.path.logs=/var/log/elasticsearch -Des.default.path.data=/var/lib/elasticsearch -Des.default.config=/etc/elasticsearch/elasticsearch.yml -Des.default.path.conf=/etc/elasticsearch org.elasticsearch.bootstrap.Elasticsearch
user     18111  0.0  0.0  21296   940 pts/19   S+   18:52   0:00 grep –color=auto 15290

 

To get a list of all users in Ubuntu

[ec2-user@ip-172-31-37-147 /]$ cut -d: -f1 /etc/passwd

 

nohup: No Hang Up

jobs -l : listing of no hups

ps -ef

Leave a Reply

Your email address will not be published. Required fields are marked *