man -P whoami ls
This command will output user's name, just like whoami
. But when you use pipe to redirect it to a file or to your screen like man -P whoami ls | cat
or man -P whoami ls > file
, the contents of file
will be the man page of ls
.
Why are the two things different? I mean, man -P whoami ls
and man -P whoami ls | cat
output different.
Is there any problem?
man
command to do what he want. For example, there is aflag.txt
in/tmp
directory and he can useman -P 'ls /tmp' ls
to get/tmp
and useman -P 'cat /tmp/flag.txt' ls
to capture the flag.