Here I’m looking at the contexts of everything running under my own username: ~]$ ps -Z If your system is SELinux capable, you can get SELinux context information with the Z flag to the ps command. Show securty contexts in RedHat/CentOS/Fedora INTERESTING: this output shows a few more processes running under my username greys: they were not started directly by me but are still needed and managed under my user. Greys 26402 26331 0 19:03 ? 00:00:00 /usr/bin/dbus-daemon -session -address=systemd: -nofork -nopidfile -systemd-activation -syslog-o Root 1 0 0 Mar26 ? 00:00:02 /usr/lib/systemd/systemd -switched-root -system -deserialize 18 Combined with the -f option, this gives us a fairly useful output: ~]$ ps -ef | more This will show not only your own processes, but all the other processes running under different users as well. One immediately obvious thing from this listing is that bash (process ID 26344) is actually the parent process of my ps -f command (see how it shows PPID of 26344) – this makes perfect sense, obviously: we ran ps by typing a command in the bash shell prompt. In this example I’m still looking at my own processes, but really -f is a modifier – so you can use in combination with any other ps command options: ~]$ ps -f Using the -f option for ps you can gain additional useful information on each process in the listing: usernames (UID), process ID (PID), parent process ID (PPID) and full command lines (not just the process name). ~]$ psĢ6606 pts/0 00:00:00 ps Show full information about processes As you can see from the listing, I’m running bash shell and then ps command. Simply type “ps” in the command line to see which processes you’re currently running on your Unix/Linux system. Ps command is one of the basic Unix commands that helps you access information about processes running on your system.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |