101-500 Exam QuestionsBrowse all questions from this exam

101-500 Exam - Question 109


What is the purpose of the xargs command?

Show Answer
Correct Answer: C

The xargs command reads standard input and builds up commands to execute. It is commonly used to construct argument lists and pass them to other commands. For example, it can take the output of one command and use it as arguments for another command.

Discussion

2 comments
Sign in to comment
amwangiOption: C
Jun 14, 2021

The answer is C

ResekoOption: C
Sep 2, 2023

Example: The command uses xargs to create directories in the ~/tests/ path with usernames obtained from the /etc/passwd file: tail /etc/passwd | cut -d":" -f1 | xargs -I {} mkdir -p ~/tests/{}