CLI shortcut – Linux heritage of bash shorcuts
Even inside the CLI (VTYSH) you'll get benefit of Linux bash shortcuts.
Controlling the Screen
The following shortcuts allow you to control what appears on the screen (source howtogeek).
Ctrl+L: Clear the screen. This is similar to running the "clear" command.
Ctrl+S: Stop all output to the screen. This is particularly useful when running commands with a lot of long, verbose output, but you don't want to stop the command itself with Ctrl+C.
Ctrl+Q: Resume output to the screen after stopping it with Ctrl+S.
Moving the Cursor
Use the following shortcuts to quickly move the cursor around the current line while typing a command.
Ctrl+A or Home: Go to the beginning of the line.
Ctrl+E or End: Go to the end of the line.
Alt+B: Go left (back) one word.
Ctrl+B: Go left (back) one character.
Alt+F: Go right (forward) one word.
Ctrl+F: Go right (forward) one character.
Ctrl+XX: Move between the beginning of the line and the current position of the cursor. This allows you to press Ctrl+XX to return to the start of the line, change something, and then press Ctrl+XX to go back to your original cursor position. To use this shortcut, hold the Ctrl key and tap the X key twice.
Deleting Text
Use the following shortcuts to quickly delete characters:
Ctrl+D or Delete: Delete the character under the cursor.
Alt+D: Delete all characters after the cursor on the current line.
Ctrl+H or Backspace: Delete the character before the cursor.
Fixing Typos
These shortcuts allow you to fix typos and undo your key presses.
Alt+T: Swap the current word with the previous word.
Ctrl+T: Swap the last two characters before the cursor with each other. You can use this to quickly fix typos when you type two characters in the wrong order.
Ctrl+_: Undo your last key press. You can repeat this to undo multiple times.
Cutting and Pasting
Bash includes some basic cut-and-paste features.
Ctrl+W: Cut the word before the cursor, adding it to the clipboard.
Ctrl+K: Cut the part of the line after the cursor, adding it to the clipboard.
Ctrl+U: Cut the part of the line before the cursor, adding it to the clipboard.
Ctrl+Y: Paste the last thing you cut from the clipboard. The y here stands for "yank".
Capitalizing Characters
The bash shell can quickly convert characters to upper or lower case:
Alt+U: Capitalize every character from the cursor to the end of the current word, converting the characters to upper case.
Alt+L: Uncapitalize every character from the cursor to the end of the current word, converting the characters to lower case.
Alt+C: Capitalize the character under the cursor. Your cursor will move to the end of the current word.
Search in command history
From "switch#" prompt, type CTRL+r: you will get the following prompt "(reverse-i-search)`':" which allows to recall a previous command by typing first letters of the commands. Example:
(reverse-i-search)`sh ip': sh ip bgp
Will propose all the commands in the history that start with 'sh ip'. Do CTRL-r again for getting next prevous command starting with 'sh ip' like '(reverse-i-search)`sh ip': sh ip int".
------------------------------
Vincent Giles
------------------------------
Original Message:
Sent: Apr 22, 2021 08:54 PM
From: Justin Noonan
Subject: AOS-CX Tips to try on the Simulator
For a lab environment, without an Network Time Protocol (NTP) server, you can quickly manually configure the time and date on AOS-CX using the "clock" command:
------------------------------
Justin Noonan
Original Message:
Sent: Apr 22, 2021 11:42 AM
From: Matthew Fern
Subject: AOS-CX Tips to try on the Simulator
Looking for only specific output from a given 'show' command? Use pipes! The pipe character | can be used to filter the output of a show command using a number of different patterns - display only lines containing a particular string, a running configuration starting with a particular command, or exclude specific portions of a command's output. Here are a few examples...
When using the command "show interface brief", you can filter the list to only display interfaces that are currently up, using the following command:
6300# show interface brief | include "up"1/1/2 1 access 5G-SmartRate yes up 2500 --1/1/3 1 access 5G-SmartRate yes up 2500 --1/1/6 1 access 5G-SmartRate yes up 1000 --1/1/7 1 access 5G-SmartRate yes up 5000 --1/1/9 1 access 5G-SmartRate yes up 1000 --1/1/48 1 access 5G-SmartRate yes up 2500 --vlan1 -- -- yes up -- --
If you are working with a running configuration on a switch with NAE agents installed and running, you can exclude them from the displayed configuration using this command:
6300# show running-config | exclude "nae"Current configuration:!!Version ArubaOS-CX FL.10.07.0004!export-password: defaultuser admin group administrators password ciphertext <...>ntp server pool.ntp.org minpoll 4 maxpoll 4 iburstntp enable!!!!!!ssh server vrf defaultssh server vrf mgmtvsf member 1 type jl659avlan 1spanning-treeinterface mgmt no shutdown ip dhcpinterface 1/1/1 no shutdown no routing vlan access 1[output snipped]interface 1/1/52 no shutdown no routing vlan access 1interface vlan 1 ip dhcp!!!!!https-server vrf defaulthttps-server vrf mgmtconfiguration-lockout central managed
Lastly, command output may be redirected to a local file that can be transferred off the switch via the Bash shell. Files generated in this way are stored in the folder /tmp and can be transferred via TFTP, SFTP, or to a mounted USB storage device.
6300# show interface | redirect interfaces.txt6300# start-shell 6300:~$ cd /tmp6300:/tmp$ cat interfaces.txtInterface 1/1/1 is down Admin state is up State information: Waiting for link Link state: down for 2 days (since Mon Apr 19 18:34:29 UTC 2021) Link transitions: 10 Description: Hardware: Ethernet, MAC Address: 64:e8:81:b7:b5:ff MTU 1500 Type 5G-SmartRate Full-duplex qos trust none Speed 0 Mb/s Auto-negotiation is on Flow-control: off Error-control: off MDI mode: none VLAN Mode: access Access VLAN: 1 Rate collection interval: 300 seconds Rate RX TX Total (RX+TX) ---------------- -------------------- -------------------- -------------------- Mbits / sec 0.00 0.00 0.00 KPkts / sec 0.00 0.00 0.00 Unicast 0.00 0.00 0.00 Multicast 0.00 0.00 0.00 Broadcast 0.00 0.00 0.00 Utilization 0.00 0.00 0.00 Statistic RX TX Total ---------------- -------------------- -------------------- -------------------- Packets 61398 107582 168980 Unicast 60400 61813 122213 Multicast 821 43352 44173 Broadcast 177 2417 2594 Bytes 15685033 51749976 67435009 Jumbos 0 0 0 Dropped 0 0 0 Pause Frames 0 0 0 Errors 0 0 0 CRC/FCS 0 n/a 0 Collision n/a 0 0 Runts 0 n/a 0 Giants 0 n/a 0[output truncated]
For more information on syntax used by the pipe command, refer to the command help:
6300# show running-config | Usage: show {<SHOW-COMMAND-OPTIONS>}... [ | {include <PATTERN-STRING> | exclude <PATTERN-STRING> | begin {<LINES-TO-DISPLAY>} <PATTERN-STRING>}]... [ | {count [<PATTERN-STRING>] | redirect [<FILE-NAME>]}] list [ | {include <PATTERN-STRING> | exclude <PATTERN-STRING> | begin {<LINES-TO-DISPLAY>} <PATTERN-STRING>}]... [ | {count [<PATTERN-STRING>] | redirect [<FILE-NAME>]}]Example: show running-config | redirect "abc.txt" show running-config | begin 2 "vlan" | begin -2 "vlan" | begin "vlan" show running-config | include "vlan" | exclude "vlan2" | count show vlan | include "up" | include "VLAN100" list | include "show" | exclude "show" | countDescription: The Pipe(|) command allows to filter the output of show or list commands using one of the options - "include", "exclude", "begin", "count" or "redirect".
------------------------------
Matt Fern
Sr. Technical Marketing Engineer, Aruba Switching
Aruba, a Hewlett Packard Enterprise company
Original Message:
Sent: Apr 22, 2021 05:44 AM
From: Kamal Takodra
Subject: AOS-CX Tips to try on the Simulator
Here is one command I find very useful
"show run current-context" or short from "sho r c" if you are feeling particularity easy on the keyboard ;-)
This allows you to have a quick peek and focus at the config of the "context" you are in, give it a try if you don't use it already.
Enjoy ;-)
------------------------------
Kamal Takodra
If my post was useful accept solution and/or give kudos
Original Message:
Sent: Apr 22, 2021 03:07 AM
From: Vincent Giles
Subject: AOS-CX Tips to try on the Simulator
Hello all,
I'm starting this thread so that everyone can contribute here by sharing their recommended tips on AOS-CX.
Recently, Justin posted one: repeat command
https://community.arubanetworks.com/HigherLogic/Security/SAML/LocalSamlLoginService.aspx?binding=HttpPost&ReturnUrl=https%3a%2f%2fcommunity.arubanetworks.com%2fcommunity-home%2fdigestviewer%2fviewthread%3fGroupId%3d565%26MessageKey%3decad5dfd-42b8-4311-bd27-5a048b835eeb%26CommunityKey%3daa40c287-728e-4827-b062-5eff4ed6410b%26tab%3ddigestviewer%26ReturnUrl%3d%252fcommunity-home%252fdigestviewer%253fcommunitykey%253daa40c287-728e-4827-b062-5eff4ed6410b%2526tab%253ddigestviewer
Arubanetworks | remove preview |
|
An other one: try the show ip route and show ip rib on new 10.7 version. Much better than before !
For instance:
An other one: on VSX cluster, did you know that you can perform a show command on the VSX peer by appending vsx-peer
to almost any show command ?
Example:
------------------------------
Vincent Giles
------------------------------