A UNIX administrator has a file named users.txt containing one username per line. They need to run a command that copies /etc/skel/.bashrc into each user’s home directory, resulting in paths like /home/alice/.bashrc, /home/bob/.bashrc, and so on. Which xargs invocation ensures each username replaces the placeholder in the copy command?
The -I option tells xargs to treat as a placeholder and substitute it with each line from users.txt. Without -I, xargs simply appends arguments to the end or splits lines without recognizing the placeholder, so would remain literal or misalign arguments. Options that only limit arguments per invocation (-n1, -L1) do not perform placeholder replacement.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What does the '-I' option in xargs do?
Open an interactive chat with Bash
How does xargs differ from a standard loop in shell scripting?
Open an interactive chat with Bash
Why does the correct invocation with -I differ from the other options?