What does the command awk '{print $1}' <(ll) <(cat /etc/passwd) do?

Study for the OSCP Linux Exam. Use our flashcards and multiple-choice questions to test your skills. Each query comes with detailed hints and explanations to enhance your preparedness. Get ready to conquer the exam!

Multiple Choice

What does the command awk '{print $1}' <(ll) <(cat /etc/passwd) do?

Explanation:
The command relies on process substitution to feed two command outputs into one awk run, and awk prints the first field of each input line. Since you’re passing two inputs, you get the first field from every line of the first command’s output (the first column shown by ll) and then the first field from every line of the second command’s output (the first column of /etc/passwd, i.e., the username). In short, it outputs the first column from the ll output followed by the first column from the passwd output.

The command relies on process substitution to feed two command outputs into one awk run, and awk prints the first field of each input line. Since you’re passing two inputs, you get the first field from every line of the first command’s output (the first column shown by ll) and then the first field from every line of the second command’s output (the first column of /etc/passwd, i.e., the username). In short, it outputs the first column from the ll output followed by the first column from the passwd output.

Subscribe

Get the latest from Passetra

You can unsubscribe at any time. Read our privacy policy