I have done few google searches but none of them answered my question.
Do we have any universal way to display headers of all commands in Ubuntu with out installing additional packages? commands like ps -ef
& ls
, du
.
Example
ps -ef | egrep "PID"
UID PID PPID C STIME TTY TIME CMD
root 18208 21629 0 02:49 pts/0 00:00:00 egrep --color=auto PID
in the above example, I have used egrep
to get the header
the above command prints no header when other grep
words are used
Example below
ps -ef | egrep "nrpe"
nobody 8262 1 0 01:49 ? 00:00:00 /usr/bin/nrpe -c /etc/nrpe.cfg -d
root 18225 21629 0 02:49 pts/0 00:00:00 egrep --color=auto nrpe
P.S : I know functions of egrep
but that doesn't work everywhere to get the headers.
TIA
Thanks for Answers
– preetam singh Nov 23 '19 at 17:14head
command, it is universal, as explained in my answer, the example that I used is just different from yours (I use-el
option instead of-ef
, so column displayed are different due to his choice of options) – damadam Nov 25 '19 at 14:16