Home > Linux > Processes in Linux: Fun with Terminal

Processes in Linux: Fun with Terminal

Warning: the content may increase your appetite for interest in Linux.
It’s a myth that “processes” are a complex concept. A process is an executing set of machine level instruction or code.
Whenever you are running an application, a process that belongs to this application is running. There are some processes which runs only in the background. They are called daemons in Linux. The process status, “ps” command shows the currently running processes.
Enough with the theory, now let’s get our hands dirty. Open a terminal session on your favorite Linux distribution.

The “ps” command has mainly two options

  • -e lists all running processes
  • -f shows full process status

At the terminal type “ps -ef

 

full_process_list_linux

  • UID – id of user who invoked terminal
  • PID – ID of that process
  • PPID – parent process ID of the running process
  • C – no. of child processes
  • STIME – start time
  • TTY – terminal executing the process, shows “?” when it is a daemon
  • CMD – name of the process

When the system boots only one process exists – the init process, which is invoked by kernel. Kernel is the core of an operating system on which all other drivers and applications exist and run. The first process on the list is thus always be init.

At the terminal type “ps -e

process_list_linux

How to initiate a background process?

Linux is a true multi-user, multitasking OS. You can run more than one process simultaneously. Type the program name followed by an ampersand(&) separated by a space

vlc &

vlc

The “&” allows to run vlc media player in the background of our parent shell.

  • [1] shows number of child process.
  • 3120 is the process ID(PID) of vlc.

 As a side note, try “ps” command on your Android phone or tablet. Fire up a terminal emulator and see what happens

 

 

android_processandroid_process_list

Possibly Related Posts:


  1. No comments yet.
  1. No trackbacks yet.