I tried:
who & pwd and it output the result of pwd output: /root.
May I know if I am right?
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.
Sign up to join this communityI tried:
who & pwd and it output the result of pwd output: /root.
May I know if I am right?
The &
operator has nothing to do with executing two commands, see this question.
In order to execute two distinct commands on the same line, use the appropriate separator ;
:
who; pwd