---
title: Getting Familiar with Using CISCO-LIKE Command Line
slug: enterprise-v5p2/getting-familiar-with-using-cisco-like-command-line
createdAt: 2026-03-19T02:05:38.577Z
---

## <font color="#1d50a2">How to Enter the Command Line View</font>

| **Operation**      | **Command**      | **Description**                                                                                 |
| ------------------ | ---------------- | ----------------------------------------------------------------------------------------------- |
| Enter the CLI view | **sonic cli**    | By  default, upon logging into the device, you will automatically enter the  command line view. |
| Exit the CLI view  | **system  bash** | Use  the **'exit'** command to return to the command line configuration  interface.             |

## <font color="#1d50a2">Commond Keywords</font>

| **Keywords**           | **Description**                                        |
| ---------------------- | ------------------------------------------------------ |
| **no**                 | Cancel  or disable a specific setting                  |
| **show this**          | Display  the current configuration of the current view |
| **configure terminal** | Enter  the system configuration mode                   |
| **delete**             | Delete  a configuration file                           |
| **reboot**             | Reboot  the device                                     |
| **write**              | Save  the current configuration                        |
| **shutdown**           | Disable  or turn off a port                            |
| **exit**               | Exit  to the previous level or log out                 |
| **do**                 | Ignore view execution commands                         |
| **end**                | Return directly to the system view                     |

## <font color="#1d50a2">Command Line Usage Assistance</font>

When entering an incomplete keyword, pressing the Tab or Space key will automatically complete the keyword.

If you encounter issues while using the command line, you can utilize the help function to get assistance, eliminating the need to memorize extensive and intricate commands.

While entering a command, pressing the Tab key will display a list of matching keywords. Entering "?" will provide hints for relevant keywords or explanations of parameters.

```text
sonic# show <tab>
acl       arp       counters     history     image      interface    link-aggregation
lldp       mac-address   platform     running-config  startup-config  sub-interface  traffic
sonic# configure terminal
sonic(config)# access-list l3 test ingress <tab>
 <cr> 
sonic(config)# access-list l3 test <enter>
Syntax error: The command is not completed
sonic(config)# access-list l3 test1 ingress 
sonic(config-l3-acl-test1)# ?
 end  Exit to the exec Mode
 exit Exit from current mode
 no  Negate a command or set its defaults
 rule Add an access list entry
 show show running-config

sonic(config-l3-acl-test1)# rule ?
  rule ID (0..500)
sonic(config-l3-acl-test1)# rule 1 ?
 source-mac     Specify source mac address
 destination-mac   Specify destination mac address
 ethernet-type    Specify ethernet protocol type
 outer-vlan     Specify outer VLAN id
 vlan-pri      Specify outer VLAN priority
```

## <font color="#1d50a2">Configuration File Management</font>

The configuration files for this series of switches are in JSON (JavaScript Object Notation) format. JSON is a lightweight data interchange format, and its file extension is typically .json.

### <font color="#1d50a2">Viewing Configuration File</font>

By default, the system configuration files are stored in the **/etc/sonic** directory. The default system configuration file is named **config\_db.json.** When performing configuration saving or restoration operations, it's this file that gets modified, determining the initial configuration upon the device's next startup. Additionally, this directory also contains backups of configuration files, labeled with timestamps, which facilitates configuration recovery for users. Every time the "write" command is executed, a new config\_db.json file is generated to save the current configuration, and the original file's name is modified to the format **config\_bd**+timestamp.

### <font color="#1d50a2">Configuration Saving</font>

After a user logs into the device, configurations made through command-line operations or other means are temporary. If you require persistent configurations, you should manually save the modified settings. This involves updating the current configuration to the default configuration file, config\_db.json. If you don't save the configurations, the device's settings will revert to their state before modifications after a reboot.

| **OperationMaintenance Interface** | **Command**              | **Description** |
| ---------------------------------- | ------------------------ | --------------- |
| Save configuration                 | **write**                |                 |
| Display startup  configuration     | **show  startup-config** |                 |

### <font color="#1d50a2">Configuration rollback</font>

Users can roll back the switch configuration using the configuration file according to the timestamp identifier.

For example, you need to roll back the configuration to config\_db.json\_2026-01-08\_02:41:28

```none
admin@sonic:/etc/sonic$ sudo cp config_db.json_2026-01-08_02:41:28 config_db.json # Overwrite the current configuration with the configuration file that needs to be rolled back.
admin@sonic:/etc/sonic$ sudo reboot  # Take effect after restarting the device
```

