How does the `ps` command help in viewing and understanding the processes running on a Linux system? Describe the meaning of key columns such as PID, PPID, STAT, and NI in the `ps` command output. Provide an example command to display detailed information about all processes.
The ps command provides a detailed description of the processes running on a linux system. Using it with different options results in different outputs for e.g. ps -f provides a detailed information about all the processes. The PID column represents the process id, the PPID represents the parent process's id, NI represents the nice value of the process and the STAT column provides the current status of the process. An example command to display detailed information about all process is ps -l, it displays the output as:-
F S UID PID PPID C PRI NI ADDR SZ WCHAN TTY TIME CMD 0 S 1000 7964 4966 0 80 0 - 2980 do_wai pts/1 00:00:00 bash 4 R 1000 24026 7964 0 80 0 - 3168 - pts/1 00:00:00 ps