In: Computer Science
What does this command do & ps -ef | grep tty | less
Searches the output from the ps command for tty and displays it one screen at a time
Displays all of the interactive running processes
Searches the output from the ps command for the word more
Displays output from the ps command one screen at a time
ps -ef command is used to lists all the process in the full
format that are currently running in your machine, it includes
UID(who have started the process), PID(ID of each process, its
unique), PPID(It represents the ID of the parent process, it's not
unique) and CMD(to run that process)
These all information helps us to identify who have started which
process and we can easily kill those processes if we want.
Output:
If you're using grep tty | less, then it will simply open up the
result of ps -ef in a command line in an interactive shell while
less command is used to print information page wise.
ps -A: to list down active processes
ps -ef: to list down processes in full format
I hope it helps.