Friday, February 6, 2026

Cisco Nexus cli alias Command

You can use the cli alias <command> to create a shortcut on your favorite Cisco commands. An example would be an alias for write memory (or just a wr) in a Cisco Nexus switch (it only supports copy run start).


N5K# configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
N5K(config)# cli ?
  alias  Define an alias
  var    Define a variable

N5K(config)# cli alias ?
  name  Specify the alias

N5K(config)# cli alias name ?
  WORD  Alias command (Max Size 30)

N5K(config)# cli alias name wr ?
  LINE  Alias definition

N5K(config)# cli alias name wr copy run start ?
  <CR>  
  LINE   Alias definition

N5K(config)# cli alias name wr copy run start
N5K(config)# show run | i cli
cli alias name wr copy run start
N5K(config)# alias         // NEXUS VERIFICATION COMMAND
CLI alias commands
==================
alias  :show cli alias
wr     :copy run start
N5K(config)# wr
[########################################] 100%
Copy complete, now saving to disk (please wait)...