P. 1
CLI Reference

CLI Reference

|Views: 391|Likes:
Published by Manuel_Smeriglio

More info:

Published by: Manuel_Smeriglio on Oct 09, 2009
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

10/12/2012

pdf

text

original

To create a command alias, use the alias global configuration command. To delete all aliases in a
command mode or to delete a specific alias, and to revert to the original command syntax, use the no
form of this command.

alias mode command-alias original-command

no alias mode [command-alias]

Syntax Description

Defaults

A set of six basic EXEC mode aliases are enabled by default. See the “Usage Guidelines” section of this
command for a list of default aliases.

Command Modes

Global configuration

Command History

Usage Guidelines

You can use simple words or abbreviations as command aliases.

Table44 lists the basic EXEC mode aliases that are enabled by default.

The default aliases in Table44 are predefined. These default aliases can be disabled with the
noaliasexec command.

Common keyword aliases (which can not be disabled) include running-config (keyword alias for
system:running-config) and startup-config (keyword alias for nvram:startup-config). See the
description of the copy command for more information about these keyword aliases.

mode

Command mode of the original and alias commands.

command-alias

Command alias.

original-command

Original command syntax.

Release

Modification

10.3

This command was introduced.

Table44

Default Command Aliases

Command Alias

Original Command

h

help

lo

logout

p

ping

r

resume

s

show

w

where

Basic System Management Commands

alias

FR-379

Cisco IOS Configuration Fundamentals Command Reference

78-11740-02

Note that aliases can be configured for keywords instead of entire commands. You can create, for
example, an alias for the first part of any command and still enter the additional keywords and arguments
as normal.

To determine the value for the mode argument, enter the command mode in which you would issue the
original command (and in which you will issue the alias) and enter the ? command. The name of the
command mode should appear at the top of the list of commands. For example, the second line in the
following sample output shows the name of the command mode as “Interface configuration”:

Router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#interface e0
Router(config-if)#?
Interface configuration commands:
access-expression

Build a bridge boolean access expression

.
.
.

To match the name of the command mode to the acceptable mode keyword for the alias command, issue
the alias ? command. As shown in the following sample output, the keyword needed to create a
command alias for the access-expression command is interface:

Router(config)# alias ?
accept-dialin

VPDN group accept dialin configuration mode

accept-dialout

VPDN group accept dialout configuration mode

address-family

Address Family configuration mode
call-discriminator Call Discriminator Configuration
cascustom Cas custom configuration mode
clid-group CLID group configuration mode
configure Global configuration mode
congestion Frame Relay congestion configuration mode
controller Controller configuration mode
cptone-set custom call progress tone configuration mode
customer-profile customer profile configuration mode
dhcp DHCP pool configuration mode
dnis-group DNIS group configuration mode
exec Exec mode
flow-cache Flow aggregation cache config mode
fr-fr FR/FR connection configuration mode
interface Interface configuration mode

.
.
.

Router(config)# alias interface express access-expression

For a list of command modes with descriptions and references to related documentation, refer to the
“CiscoIOS Command Modes” appendix of the Release12.2 Cisco IOS Configuration Fundamentals
Configuration Guide.

When you use online help, command aliases are indicated by an asterisk (*), and displayed in the
following format:

*command-alias=original-command

For example, the lo command alias is shown here along with other EXEC mode commands that start with
“lo”:

Router#lo?
*lo=logoutlockloginlogout

Basic System Management Commands

alias

FR-380

Cisco IOS Configuration Fundamentals Command Reference

78-11740-02

When you use online help, aliases that contain multiple keyword elements separated by spaces are
displayed in quotes, as shown here:

Router(config)#alias exec device-mail telnet device.cisco.com 25
Router(config)#end
Router#device-mail?
*device-mail=”telnet device.cisco.com 25"

To list only commands and omit aliases, begin your input line with a space. In the following example,
the alias td is not shown, because there is a space before the t? command line.

Router(config)#alias exec td telnet device
Router(config)#end
Router# t?
telnetterminaltesttn3270trace

To circumvent command aliases, use a space before entering the command. In the following example,
the command alias express is not recognized because a space is used before the command.

Router(config-if)#exp?
*express=access-expression
Router(config-if)#express ?
% Unrecognized command

As with commands, you can use online help to display the arguments and keywords that can follow a
command alias. In the following example, the alias td is created to represent the command telnet device.
The /debug and /line switches can be added to telnet device to modify the command:

Router(config)#alias exec td telnet device
Router(config)#end
Router#td?
/debug

Enable telnet debugging mode

/line

Enable telnet line mode

...
whois

Whois port


Router#telnet device

You must enter the complete syntax for the command alias. Partial syntax for aliases is not accepted. In
the following example, the parser does not recognize the command t as indicating the alias td:

Router#t
% Ambiguous command: “t”

Examples

In the following example, the alias fixmyrt is configured for the clear iproute 209.165.201.16 EXEC
mode command:

Router(config)# alias exec fixmyrt clear ip route 209.165.201.16

In the following example, the alias express is configured for the first part of the access-expression
interface configuration command:

Router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#interface e0
Router(config-if)#?
Interface configuration commands:
access-expression

Build a bridge boolean access expression

.
.
.

Basic System Management Commands

alias

FR-381

Cisco IOS Configuration Fundamentals Command Reference

78-11740-02

Router(config-if)#exit
Router(config)#alias ?
accept-dialin

VPDN group accept dialin configuration mode

accept-dialout

VPDN group accept dialout configuration mode

address-family

Address Family configuration mode

call-discriminator

Call Discriminator Configuration

cascustom

Cas custom configuration mode

clid-group

CLID group configuration mode

configure

Global configuration mode

congestion

Frame Relay congestion configuration mode

controller

Controller configuration mode

cptone-set

custom call progress tone configuration mode

customer-profile

customer profile configuration mode

dhcp

DHCP pool configuration mode

dnis-group

DNIS group configuration mode

exec

Exec mode

flow-cache

Flow aggregation cache config mode

fr-fr

FR/FR connection configuration mode

interface

Interface configuration mode

.
.
.

Router(config)#alias interface express access-expression
Router(config)#int e0
Router(config-if)#exp?
*express=access-expression

Router(config-if)#express ?
input

Filter input packets

output

Filter output packets

!Note that the true form of the command/keyword alias appears on the screen after issuing
!the express ? command.
Router(config-if)#access-expression ?
input

Filter input packets

output

Filter output packets

Router(config-if)#ex?
*express=access-expression exit

!Note that in the following line, a space is used before the ex? command
!so the alias is not displayed.
Router(config-if)# ex?
exit

!Note that in the following line, the alias can not be recognized because
!a space is used before the command.
Router(config-if)# express ?
% Unrecognized command

Router(config-if)#end
Router#show alias interface
Interface configuration mode aliases:
express

access-expression

Related Commands

Command

Description

show aliases

Displays command aliases.

Basic System Management Commands

buffers

FR-382

Cisco IOS Configuration Fundamentals Command Reference

78-11740-02

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->