A developer needs to merge two configuration files, app.conf.old and app.conf.new, into a single file named app.conf. They want to interactively review the differences side-by-side and choose which version of each differing line to include in the final output file. Which of the following commands will achieve this?
The correct command is sdiff -o app.conf app.conf.old app.conf.new. The sdiff command is used to compare two files side-by-side. The -o or --output option is specifically used to create a third file by interactively merging the two source files. When sdiff is run with this option, it prompts the user to choose which version of a differing line to keep. The command diff -u app.conf.old app.conf.new > app.conf creates a unified diff patch and redirects it to a file, but it is not an interactive merging process. The command sdiff app.conf.old app.conf.new | merge app.conf is incorrect as merge is not a standard command for this purpose and sdiff does not output to a pipe in a format suitable for another program to merge interactively. The command cp app.conf.old app.conf && sdiff --in-place app.conf app.conf.new is incorrect because sdiff does not have an --in-place option.
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 is the purpose of the `sdiff` command in Linux?
Open an interactive chat with Bash
How does the `-o` option in `sdiff` work?
Open an interactive chat with Bash
Why doesn’t `diff -u app.conf.old app.conf.new > app.conf` work for interactive merging?
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