Main Menu

Search

Showing posts with label auto restart. Show all posts
Showing posts with label auto restart. Show all posts

LINUX: "ps" Command To List and Sort All Non Root User Processes By Total Memory Usage - In Descending Order PID's with Highest Total Memory Used At the Top (How To Doc)

Below "ps" command can be used to list and sort all non root user processes by total memory usage. Below command shows PID's with Highest total used Memory (in MB) owned by root user at the top and list goes down in descending order sorted by total memory usage.
ps -N -U root -wo rss=,user,comm= --sort -rss | while read -r rss comm ; do echo $((rss/1024))"MB -" $comm; done

Below is example output of above command.

# ps -N -U root -wo rss=,user,comm= --sort -rss | while read -r rss comm ; do echo $((rss/1024))"MB -" $comm; done | more
0MB -
5959MB - oracle ora_dbw0_db
2710MB - appuser java
1957MB - oracle ora_mman_db
1156MB - orauser mysqld
853MB - oracle ora_cjq0_db
488MB - appuser java
467MB - orauser ora_mmon_db
441MB - orauser ora_smon_db
354MB - orauser ora_ckpt_db

Products to which Article Applies

All Linux Operating Systems

LINUX: How To Enable Particular Service Using "systemctl" Command To Auto Start During Reboot?

Below "systemctl" Command can be used to enable particular Service.
systemctl enable <service name>

For example if you want to enable Docket service to start when Linux Machine reboots, your "systemctl" command will look as follows:



systemctl enable docker

Once the service is enable run below command to verify that the service is enabled.

systemctl list-unit-files | grep -i <service>

For e.g. if you enabled Docker service, you can run below command to verify whether the Docker service is enabled.
systemctl list-unit-files | grep -i docker.

Below is example output of above command.
# systemctl list-unit-files | grep -i docker
docker.service          enabled


Products to which Article Applies


All Linux Operating Systems

Additional References

https://www.digitalocean.com/community/tutorials/how-to-use-systemctl-to-manage-systemd-services-and-units