Compare Two Files on Your Juniper Router | JN0-102 Exam Prep

Command to Compare Files on Juniper Router

Prev Question Next Question

Question

Which command would allow you to compare two files stored on your router?

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D.

B

The correct answer is option D: user@host> compare filename1 filename2.

The compare command in Junos allows you to compare two files to see if there are any differences between them. This can be useful for verifying the integrity of files, troubleshooting configuration issues, or checking for changes between two versions of a file.

Option A: user@host> file show filename1 compare filename2 is incorrect because the file show command is used to display the contents of a file, not to compare two files.

Option B: user@host> file compare files filename1 filename2 is also incorrect because the correct syntax for the compare command does not include the word "files".

Option C: user@host> compare files filename1 filename2 is incorrect because the correct syntax for the compare command does not include the word "files".

Option D: user@host> compare filename1 filename2 is the correct syntax for the compare command. This command compares the contents of filename1 and filename2 and displays any differences between them.

It's important to note that the compare command does not modify any files. It simply displays the differences between the files. If you want to save the results of the comparison to a file, you can use the | save command to redirect the output to a file. For example:

sql
user@host> compare filename1 filename2 | save compare-results.txt

This will save the output of the compare command to a file named compare-results.txt in the current working directory.