A system administrator needs to update a configuration file located at /srv/stage/app.conf by moving it to /etc/app/. An older version of app.conf already exists in the destination directory. The administrator needs to ensure the file is moved only if the source file in the staging directory is newer than the existing file in the production directory. Which of the following commands will achieve this specific outcome?
The correct command is mv -u /srv/stage/app.conf /etc/app/. The -u or --update option tells mv to move the source file only when the destination file is older than the source, or if the destination file does not exist. This prevents overwriting a newer configuration with an older one.
mv -n /srv/stage/app.conf /etc/app/ is incorrect because the -n or --no-clobber option prevents overwriting the destination file under any circumstances if it already exists.
mv -i /srv/stage/app.conf /etc/app/ is incorrect because the -i or --interactive option would prompt the user for confirmation before overwriting, rather than automatically performing the action based on the file timestamps.
mv -b /srv/stage/app.conf /etc/app/ is incorrect because the -b or --backup option would move the file and create a backup of the overwritten destination file, regardless of the timestamps.
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 '-u' option in the 'mv' command do?
Open an interactive chat with Bash
How is '-n' different from '-u' in the 'mv' command?
Open an interactive chat with Bash
What happens if both '-i' and '-u' are used together in the 'mv' command?
Open an interactive chat with Bash
CompTIA Linux+ XK0-006 (V8)
Services and User Management
Your Score:
Report Issue
Bash, the Crucial Exams Chat Bot
AI Bot
Loading...
Loading...
Loading...
IT & Cybersecurity Package Join Premium for Full Access