Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

header-navigation
keyboard_arrow_up
close
keyboard_arrow_left
Junos CLI Reference
Table of Contents Expand all
list Table of Contents
file_download PDF
{ "lLangCode": "en", "lName": "English", "lCountryCode": "us", "transcode": "en_US" }
English
keyboard_arrow_right

test configuration

date_range 19-Nov-23

Syntax

content_copy zoom_out_map
test configuration filename
syntax-only

Description

Verify that the syntax of a configuration file is correct. If the configuration contains any syntax or commit check errors, a message is displayed to indicate the line number and column number in which the error was found. When using the filename option, this command only accepts text files.

Options

filename

Name of the configuration file. This file must be a text file and no other type.

syntax-only

(Optional) Check the syntax of a partial configuration file, without checking for commit errors.

Required Privilege Level

view

Output Fields

When you enter this command, you are provided feedback on the status of your request.

Sample Output

test configuration

content_copy zoom_out_map
user@host> test configuration terminal 
[Type ^D to end input]
system {
host-name host;
test1;
login;
}
terminal:3:(8) syntax error: test
  [edit system]
    'test;'
      syntax error
terminal:4:(11) statement must contain additional statements: ;
  [edit system login]
    'login ;'
      statement must contain additional statements
configuration syntax failed

Release Information

Command introduced before Junos OS Release 7.4.

syntax-only option introduced in Junos OS Release 12.1.

footer-navigation