I am trying to understand this peculiar behavior. Basically, I'm trying to grep an output of a command while still keeping the first line/header. Thanks for the help in advance.
Success Case
ps -ef | { head -1; grep bash; }
Output:
UID PID PPID C STIME TTY TIME CMD
username 1008 1 0 Jan21 tty1 00:00:00 -bash
username 1173 1008 0 Jan21 tty1 00:00:00 -bash
Failed Case
ls -tlrh / | { head -1; grep tmp; }
Output:
total 100K
(i.e.: it ignores the /tmp
folder)