JN0-102 · Question #346
Which command would allow you to compare two files stored on your router?
The correct answer is B. user@host> file compare files filename1 filename2. The file compare operational command is used in Junos to display the differences between two specified files stored on the router. This command helps in identifying modifications or discrepancies between file versions.
Question
Which command would allow you to compare two files stored on your router?
Options
- Auser@host> file show filename1 compare filename2
- Buser@host> file compare files filename1 filename2
- Cuser@host> compare files filename1 filename 2
- Duser@host> compare filename1 filename2
How the community answered
(52 responses)- A4% (2)
- B92% (48)
- C2% (1)
- D2% (1)
Why each option
The `file compare` operational command is used in Junos to display the differences between two specified files stored on the router. This command helps in identifying modifications or discrepancies between file versions.
The `file show` command displays content, but `compare` is a sub-command of `file`, not an option under `file show`.
The correct Junos operational command to compare two files is `file compare files <filename1> <filename2>`. This command displays the differences between the content of the two specified files.
The `compare` command alone is used for comparing configuration changes, not arbitrary files, and the syntax `files` is misplaced.
The `compare` command is used for configuration comparison (e.g., `compare rollback <number>`), not for general file comparison with arbitrary filenames directly.
Concept tested: Comparing files on Junos OS
Source: https://www.juniper.net/documentation/us/en/software/junos/junos-basics/topics/reference/command-summary/file.html
Topics
Community Discussion
No community discussion yet for this question.