Using the Command Line Interface (CLI) The following topics explain how to use the system command line interface (CLI) for CX devices and PRSM and how to interpret the command reference topics. Use the CLI for basic system setup and troubleshooting. • Command Context Modes, page 1 • Syntax Formatting, page 1 • Entering Commands, page 2 • Filtering Show Command Output, page 2 • Command Help, page 4 Command Context Modes You can use the CLI commands in the following contexts: • ASA CX console or SSH session, or a console session opened from the parent ASA using the session cxsc console command. • PRSM VMware console or SSH session. In most cases, command behavior is identical for these products. Any differences are noted in the reference section for the commands. Unlike the ASA, there are no separate command modes, but instead a single mode only. All commands are always available. Syntax Formatting Command syntax descriptions use the following conventions: Convention Description command Command text indicates commands and keywords that you enter literally as shown. Command Reference for ASA CX and Cisco Prime Security Manager OL-26836-07 1 Using the Command Line Interface (CLI) Entering Commands Convention Description variable Variable text indicates arguments for which you supply values. [x] Square brackets enclose an optional element (keyword or argument). [ x | y] Square brackets enclosing keywords or arguments separated by a vertical bar indicate an optional choice. {x | y} Braces enclosing keywords or arguments separated by a vertical bar indicate a required choice. [x {y | z}] Nested sets of square brackets or braces indicate optional or required choices within optional or required elements. Braces and a vertical bar within square brackets indicate a required choice within an optional element. Entering Commands When you log into the console through the Console port or an SSH session, you are presented with a command prompt that shows the name of the device, for example: hostname> You type the command at the prompt and press Enter to execute the command. Following are some additional features: • Abbreviating commands—You can abbreviate most commands down to the fewest unique characters for a command; for example, you can enter sho v to view the system version instead of show version. • Scrolling through command history—You can use the up and down arrow keys to scroll through the commands that you have already entered. You can reenter or edit and reenter the commands in the history. • Completing commands—To complete a command or keyword after entering a partial string, press the Tab key. The partial string must match a single command or keyword only for it to be completed. Filtering Show Command Output You can filter the output of show commands by piping the output to filtering commands. Piping output works with all show commands but is most useful when dealing with commands that produce a lot of text. To use the filtering capabilities, use the following format: show command | {grep| include| exclude| begin} [options] pattern Command Reference for ASA CX and Cisco Prime Security Manager 2 OL-26836-07 Using the Command Line Interface (CLI) Filtering Show Command Output Filtering Commands You can use these filtering commands: • grep—Display only those lines that match the pattern. • include—Display only those lines that match the pattern. • exclude—Exclude all lines that match the pattern, show all other lines. • begin—Find the first line that includes the pattern, and display that line and all subsequent lines. Options You can include any combination of the following options that make sense, although not all options are available on the begin command. Option Description Commands -A number Include the indicated number of lines that follow matching grep lines in the output. For example: include -A 5 -B number Include the indicated number of lines that precede matching grep lines in the output. For example: include -B 5 -C number Include the indicated number of lines that surround matching grep lines in the output. For example: include -C 5 -m number Stop printing showing output after showing the indicated number of lines. For example: All -m 5 -c Just print the number of lines that match the pattern. If you grep include this option, -A, -B, and -C are ignored. include exclude -i Ignore case. All Pattern This is a simple case-sensitive text string that can include alphanumeric characters and - _ , ; =. To ignore case, include the -i option. You cannot use regular expressions. The following example shows how these commands change the output of the show ntp command. prsm-vm> show ntp remote refid st t when poll reach delay offset jitter Command Reference for ASA CX and Cisco Prime Security Manager OL-26836-07 3 Using the Command Line Interface (CLI) Command Help ============================================================================== *ntp-rtp1.exampl .GPS. 1 u 47 64 377 47.974 3.988 0.877 +ntp-rtp2.exampl .GPS. 1 u 48 64 377 48.034 3.817 0.980 Current NTP Configuration: Configuration in ntp.conf: server 1.ntp.example.com server 2.ntp.example.com prsm-vm> show ntp | grep rtp1 *ntp-rtp1.exampl .GPS. 1 u 64 64 377 47.974 3.988 0.877 prsm-vm> show ntp | include rtp1 *ntp-rtp1.exampl .GPS. 1 u 5 64 377 47.974 3.988 0.876 prsm-vm> show ntp | exclude rtp1 remote refid st t when poll reach delay offset jitter ============================================================================== +ntp-rtp2.exampl .GPS. 1 u 13 64 377 47.991 3.844 0.593 Current NTP Configuration: Configuration in ntp.conf: server 1.ntp.example.com server 2.ntp.example.com prsm-vm> show ntp | begin rtp1 *ntp-rtp1.exampl .GPS. +ntp-rtp2.exampl .GPS. 1 u 1 u 20 21 64 64 377 377 47.974 47.991 3.988 3.844 0.876 0.593 Current NTP Configuration: Configuration in ntp.conf: server 1.ntp.example.com server 2.ntp.example.com prsm-vm> Command Help Help information is available from the command line by entering the following commands: • help or ?, to see a list of all commands. • help command_name to see the syntax for a command. • command_name ? to see the options for a command. For example, show ?. • string? to show the commands or keywords that match the string. For example, n?. Command Reference for ASA CX and Cisco Prime Security Manager 4 OL-26836-07
© Copyright 2024