Cisco IOS Shell Command Reference

Similar documents
A through Z Commands

Cisco IOS Shell. Finding Feature Information. Prerequisites for Cisco IOS.sh. Last Updated: December 14, 2012

Cisco Unified Communications Self Care Portal User Guide, Release

Cisco IOS Flexible NetFlow Command Reference

Recovery Guide for Cisco Digital Media Suite 5.4 Appliances

Cisco FindIT Plugin for Kaseya Quick Start Guide

Media Services Proxy Command Reference

Application Launcher User Guide

Migration and Upgrade: Frequently Asked Questions

Cisco Unified Communications Manager Device Package 8.6(2)( ) Release Notes

Cisco Nexus 1000V for KVM Interface Configuration Guide, Release 5.x

CPS UDC MoP for Session Migration, Release

IP Routing: ODR Configuration Guide, Cisco IOS Release 15M&T

Cisco UCS Performance Manager Release Notes

Cisco IOS HTTP Services Command Reference

Cisco UC Integration for Microsoft Lync 9.7(4) User Guide

Cisco TelePresence FindMe Cisco TMSPE version 1.2

IP Addressing: IPv4 Addressing Configuration Guide, Cisco IOS Release 12.4

Cisco 1000 Series Connected Grid Routers QoS Software Configuration Guide

Flow Sensor and Load Balancer Integration Guide. (for Stealthwatch System v6.9.2)

IP Switching Configuring Fast Switching Configuration Guide Cisco IOS Release 15SY

Cisco Evolved Programmable Network System Test Topology Reference Guide, Release 5.0

Host Upgrade Utility User Guide for Cisco UCS E-Series Servers and the Cisco UCS E-Series Network Compute Engine

Cisco Unified Communications Self Care Portal User Guide, Release 11.5(1)

Cisco Unified Communications Manager Device Package 10.5(1)( ) Release Notes

Embedded Packet Capture Configuration Guide, Cisco IOS Release 15M&T

Software Configuration Guide, Cisco IOS XE Everest 16.6.x (Catalyst 9300 Switches)

SAML SSO Okta Identity Provider 2

Cisco CSPC 2.7x. Configure CSPC Appliance via CLI. Feb 2018

Cisco CIMC Firmware Update Utility User Guide

IP Addressing: IPv4 Addressing Configuration Guide, Cisco IOS Release 15S

Embedded Packet Capture Configuration Guide

Cisco Jabber IM for iphone Frequently Asked Questions

NNMi Integration User Guide for CiscoWorks Network Compliance Manager 1.6

IP Addressing: Fragmentation and Reassembly Configuration Guide, Cisco IOS XE Release 3S (Cisco ASR 1000)

Prime Service Catalog: UCS Director Integration Best Practices Importing Advanced Catalogs

NetFlow Configuration Guide

Cisco IOS Optimized Edge Routing Command Reference

Validating Service Provisioning

Cisco StadiumVision Management Dashboard Monitored Services Guide

Cisco ASR 9000 Series Aggregation Services Router Netflow Command Reference, Release 4.3.x

Cisco Connected Mobile Experiences REST API Getting Started Guide, Release 10.2

Cisco IOS First Hop Redundancy Protocols Command Reference

Cisco Report Server Readme

Flexible Netflow Configuration Guide, Cisco IOS XE Release 3SE (Catalyst 3850 Switches)

IP Addressing: Fragmentation and Reassembly Configuration Guide

Cisco TelePresence Management Suite Extension for Microsoft Exchange Software version 3.1

Embedded Packet Capture Configuration Guide

Videoscape Distribution Suite Software Installation Guide

Cisco TEO Adapter Guide for SAP Java

Cisco UCS Performance Manager Release Notes

Cisco IOS HTTP Services Command Reference

Cisco Jabber for Android 10.5 Quick Start Guide

Cisco Terminal Services (TS) Agent Guide, Version 1.1

Access Switch Device Manager Template Configuration

Cisco TEO Adapter Guide for Microsoft System Center Operations Manager 2007

Backup and Restore Guide for Cisco Unified Communications Domain Manager 8.1.3

Release Notes for Cisco Unified Intelligence Center, Release 10.0(1)

Cisco Nexus 7000 Series NX-OS Virtual Device Context Command Reference

Cisco UCS Performance Manager Release Notes

Cisco TEO Adapter Guide for Microsoft Windows

Cisco IOS IP Routing: EIGRP Command Reference

Cisco TEO Adapter Guide for

Cisco Meeting App. What's new in Cisco Meeting App Version December 17

Cisco UCS Performance Manager Release Notes

Cisco UCS Virtual Interface Card Drivers for Windows Installation Guide

Installation and Configuration Guide for Visual Voic Release 8.5

HTTP Errors User Guide

Cisco Discovery Protocol Configuration Guide, Cisco IOS XE Release 3S (Cisco ASR 920 Series)

TechNote on Handling TLS Support with UCCX

Cisco UCS Director F5 BIG-IP Management Guide, Release 5.0

Cisco WebEx Best Practices for Secure Meetings for Site Administrators and Hosts

Cisco Terminal Services (TS) Agent Guide, Version 1.1

Cisco Meeting App. Cisco Meeting App (Windows) Release Notes. March 08, Cisco Systems, Inc.

Cisco UCS Director API Integration and Customization Guide, Release 5.4

Quick Start Guide for Cisco Prime Network Registrar IPAM 8.0

CPS UDC SNMP and Alarms Guide, Release

Cisco UCS C-Series IMC Emulator Quick Start Guide. Cisco IMC Emulator 2 Overview 2 Setting up Cisco IMC Emulator 3 Using Cisco IMC Emulator 9

Tetration Cluster Cloud Deployment Guide

Cisco TelePresence Management Suite Extension for Microsoft Exchange 5.5

Cisco Proximity Desktop

Cisco Terminal Services (TS) Agent Guide, Version 1.0

Cisco Prime Network Registrar IPAM 8.3 Quick Start Guide

Cisco ACI Simulator Installation Guide

Applying QoS Features Using the MQC

Cisco Video Surveillance Virtual Matrix Client Configuration Guide

Cisco WAAS Mobile User Guide

Cisco Instant Connect MIDlet Reference Guide

Direct Upgrade Procedure for Cisco Unified Communications Manager Releases 6.1(2) 9.0(1) to 9.1(x)

Cisco Unified Web and Interaction Manager Browser Settings Guide

Cisco Nexus 9000 Series NX-OS IP Fabric for Media Solution Guide, Release 7.0(3)I4(2)

Cisco TelePresence Management Suite Extension for Microsoft Exchange Software version 5.7. User Guide July 2018

Cisco TelePresence Management Suite Extension for Microsoft Exchange Software version 5.0

Cisco Nexus 7000 Series Switches Configuration Guide: The Catena Solution

Cisco Unified Contact Center Express Historical Reporting Guide, Release 10.5(1)

External Lookup (for Stealthwatch System v6.10.0)

Addendum to Cisco Physical Security Operations Manager Documentation, Release 6.1

IT Administrator Guide for Mass Deployment of the Cisco Webex Meetings Desktop App

Cisco Unified Contact Center Express Historical Reporting Guide, Release 10.6(1)

Cisco Jabber Video for ipad Frequently Asked Questions

Transcription:

Americas Headquarters Cisco Systems, Inc. 170 West Tasman Drive San Jose, CA 95134-1706 USA http://www.cisco.com Tel: 408 526-4000 800 553-NETS (6387) Fax: 408 527-0883

THE SPECIFICATIONS AND INFORMATION REGARDING THE PRODUCTS IN THIS MANUAL ARE SUBJECT TO CHANGE WITHOUT NOTICE. ALL STATEMENTS, INFORMATION, AND RECOMMENDATIONS IN THIS MANUAL ARE BELIEVED TO BE ACCURATE BUT ARE PRESENTED WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED. USERS MUST TAKE FULL RESPONSIBILITY FOR THEIR APPLICATION OF ANY PRODUCTS. THE SOFTWARE LICENSE AND LIMITED WARRANTY FOR THE ACCOMPANYING PRODUCT ARE SET FORTH IN THE INFORMATION PACKET THAT SHIPPED WITH THE PRODUCT AND ARE INCORPORATED HEREIN BY THIS REFERENCE. IF YOU ARE UNABLE TO LOCATE THE SOFTWARE LICENSE OR LIMITED WARRANTY, CONTACT YOUR CISCO REPRESENTATIVE FOR A COPY. The Cisco implementation of TCP header compression is an adaptation of a program developed by the University of California, Berkeley (UCB) as part of UCB's public domain version of the UNIX operating system. All rights reserved. Copyright 1981, Regents of the University of California. NOTWITHSTANDING ANY OTHER WARRANTY HEREIN, ALL DOCUMENT FILES AND SOFTWARE OF THESE SUPPLIERS ARE PROVIDED AS IS" WITH ALL FAULTS. CISCO AND THE ABOVE-NAMED SUPPLIERS DISCLAIM ALL WARRANTIES, EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, THOSE OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OR ARISING FROM A COURSE OF DEALING, USAGE, OR TRADE PRACTICE. IN NO EVENT SHALL CISCO OR ITS SUPPLIERS BE LIABLE FOR ANY INDIRECT, SPECIAL, CONSEQUENTIAL, OR INCIDENTAL DAMAGES, INCLUDING, WITHOUT LIMITATION, LOST PROFITS OR LOSS OR DAMAGE TO DATA ARISING OUT OF THE USE OR INABILITY TO USE THIS MANUAL, EVEN IF CISCO OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. Any Internet Protocol (IP) addresses and phone numbers used in this document are not intended to be actual addresses and phone numbers. Any examples, command display output, network topology diagrams, and other figures included in the document are shown for illustrative purposes only. Any use of actual IP addresses or phone numbers in illustrative content is unintentional and coincidental. Cisco and the Cisco logo are trademarks or registered trademarks of Cisco and/or its affiliates in the U.S. and other countries. To view a list of Cisco trademarks, go to this URL: https:/ /www.cisco.com/go/trademarks. Third-party trademarks mentioned are the property of their respective owners. The use of the word partner does not imply a partnership relationship between Cisco and any other company. (1721R) 2018 Cisco Systems, Inc. All rights reserved.

CONTENTS CHAPTER 1 A through Z Commands 1 shell environment load 2 shell environment save 4 shell init 6 shell processing 8 show shell environment 10 show shell functions 12 terminal shell 16 iii

Contents iv

A through Z Commands shell environment load, page 2 shell environment save, page 4 shell init, page 6 shell processing, page 8 show shell environment, page 10 show shell functions, page 12 terminal shell, page 16 1

shell environment load A through Z Commands shell environment load To download Cisco IOS Shell (IOS.sh) environment from a specified file to the current TTY, use the shell environment loadcommand in privileged EXEC mode. shell environment load filename:url{merge replace} Syntax Description filename:url merge replace The URL of the shell environment file. Merge into the current shell environment. Replace the current shell environment Command Modes Privileged EXEC (#) Command History Release 15.1(4)M 15.1(2)S 15.1(1)SG 15.1(1)SY Modification This command was introduced. This command was integrated into Cisco IOS Release 15.1(2)S. This command was integrated into Cisco IOS Release 15.1(1)SG. This command was integrated into Cisco IOS Release 15.1(1)SY. Usage Guidelines Use the shell environment load command to download the Cisco IOS.sh environment from a specified file to the current terminal. Use the shell environment save command to save this specific file prior to loading the file using the shell environment load command. Examples This example shows how to save and then load a Cisco IOS.sh environment file and merge it into the current shell environment : Router> enable Router# configure terminal Router(config)# Enter configuration commands, one per line. End with CNTL/Z. Router(config)# shell processing full Router# exit Router# shell environment save disk0: URL Router# shell environment load disk0: URL merge 2

A through Z Commands shell environment load Related Commands Command shell environment save show shell environment Description Saves a Cisco IOS.sh environment functions to a specific file. Displays a Cisco IOS.sh environment information. 3

shell environment save A through Z Commands shell environment save To download Cisco IOS Shell (IOS.sh) environment from a specified file to the current TTY, use the shell environment loadcommand in privileged EXEC mode. shell environment load filename:url Syntax Description filename:url The URL of the shell environment file. Command Modes Privileged EXEC (#) Command History Release 15.1(4)M 15.1(2)S 15.1(1)SG 15.1(1)SY Modification This command was introduced. This command was integrated into Cisco IOS Release 15.1(2)S. This command was integrated into Cisco IOS Release 15.1(1)SG. This command was integrated into Cisco IOS Release 15.1(1)SY. Usage Guidelines Use the shell environment save command to save all current shell environment, except built-in shell functions, to a specified file. Then only you can use theshell environment load command to load the Cisco IOS.sh environment in the specific file on the current terminal. Examples This example shows how to save a Cisco IOS.sh environment file: Router> enable Router# configure terminal Router(config)# Enter configuration commands, one per line. End with CNTL/Z. Router(config)# shell processing full Router# exit Router# shell environment save disk0:url Related Commands Command shell environment save show shell environment Description Saves a Cisco IOS.sh environment functions to a specific file. Displays a Cisco IOS.sh environment information. 4

A through Z Commands shell environment save 5

shell init A through Z Commands shell init To enable Cisco IOS Shell (IOS.sh) initialization options, use the shell init command in global configuration mode. To disable the Cisco IOS.sh initialization options, use the no form of this command. shell init {filename: no-exec} no shell init Syntax Description filename:url no-exec The URL of the shell environment file. Stores the initialization filename and loads the saved environment from that file at the next rebooting of the router. Command Default Cisco IOS.sh initialization is disabled. Command Modes Global configuration (config) Command History Release 15.1(4)M 15.1(2)S 15.1(1)SG 15.1(1)SY Modification This command was introduced. This command was integrated into Cisco IOS Release 15.1(2)S. This command was integrated into Cisco IOS Release 15.1(1)SG. This command was integrated into Cisco IOS Release 15.1(1)SY. Usage Guidelines Use the shell initcommand to provide Cisco IOS.sh environment access to everyone who logs on to the router. If this command is configured, during system boot up, the router automatically reads and loads the content of the shell configuration from the given file which includes the user-defined variables and functions created previously. It copies the saved files into the Cisco IOS.sh environment. When you use the no-exec keyword, it allows you to store the initialization filename and loads the saved environment from that file at the next rebooting of the router. Note This command is similar to the show environment load command which allows you to download the Cisco IOS.sh environment operations. 6

A through Z Commands shell init Examples This example shows how to enable Cisco IOS.sh processing in all IOS modes: Router# configure terminal Enter configuration commands, one per line. End with CNTL/Z. Router(config)# shell processing full Router(config)# shell init disk0:url Related Commands Command show environment load Description Downloads a Cisco IOS.sh environment operations. 7

shell processing A through Z Commands shell processing To restore the default behavior of Cisco IOS Shell (IOS.sh) processing, use the shell processing command in global configuration mode. To disable the Cisco IOS.sh functions, use the no form of this command. shell processing full no shell processing Syntax Description full Enables shell processing. Command Default Cisco IOS.sh processing is enabled for other applications to use the shell functions. Command Modes Global configuration (config) Command History Release 15.1(4)M 15.1(2)S 15.1(1)SG 15.1(1)SY Modification This command was introduced. This command was integrated into Cisco IOS Release 15.1(2)S. This command was integrated into Cisco IOS Release 15.1(1)SG. This command was integrated into Cisco IOS Release 15.1(1)SY. Usage Guidelines To enable shell processing and access all its functions, it is recommended that you use the shell processing fullcommand. This allows you the ability to use shell processing in the configuration level without entering the terminal shell command on your terminal at the EXEC level. Use the no shell processing command to disable Cisco IOS.sh processing on the router. To restore the default Cisco IOS.sh processing, use the shell processing command. To reenable shell processing and access all its functions, it is recommended that you use the shell processing fullcommand. You can turn shell processing on the terminal by using the terminal shellexec command. However shell processing feature is only on while the terminal is running. Once the terminal is turned off, shell processing is off. When the terminal shell command is used, shell processing is not visible in the running configuration because it is only on the terminal level and is not in the configuration level. It is convenient to use the terminal shell command at the terminal level to quickly access the Cisco IOS.sh man commands. To enable shell processing and access all its functions in the configuration, it is recommended that you use the shell processing full command. 8

A through Z Commands shell processing Examples This example shows how to enable Cisco IOS.sh processing in all Cisco IOS configuration modes: Router> enable Router# configure terminal Enter configuration commands, one per line. End with CNTL/Z. Router(config)# shell processing full Related Commands Command terminal shell Description Enables Cisco IOS.sh functions on the router. 9

show shell environment A through Z Commands show shell environment To display shell environment information about user-defined functions, built-in functions, and user-created variables, use the show shell environmentcommand in privileged EXEC mode. show shell environment Syntax Description This command has no arguments or keywords. Command Modes Privileged EXEC (#) Command History Release 15.1(4)M 15.1(2)S 15.1(1)SG 15.1(1)SY Modification This command was introduced. This command was integrated into Cisco IOS Release 15.1(2)S. This command was integrated into Cisco IOS Release 15.1(1)SG. This command was integrated into Cisco IOS Release 15.1(1)SY. Usage Guidelines Use this command to display the shell variables used on the router. Examples The following example displays both the shell environment variables and shell functions. Field names are self-explanatory Router# show shell environment # Environment Variables: # User Environment Variables:?=0 VAR1=value1 VAR2=value2 prc_change_mode=prc_immediate prc_change_type=prc_config_change prc_error_code=prc_success prc_failure_type=prc_invalid prc_ha_sync=prc_ha_sync # Global Environment Variables: # Builtin Environment Variables: PATH=CLI%Userfunctions%Builtins%SYSTEM # Environment Functions: # User Environment Functions: function enable_archive() { configure terminal archive path disk0:backup write-memory end } 10

A through Z Commands show shell environment function enable_logging() { configure terminal archive logging enable record rc end } # Global Environment Functions: # Builtin Environment Functions: (( evaluate a numeric test expression [[ evaluate a logical test expression cat output data from a pipe or file to the terminal cut edit piped output echo echo arguments to the terminal false return false in while or if expressions, and set the result fetch return values from the configuration database grep search for regular expressions in piped output or files head print the first lines in the input interface print interfaces that match the argument let evaluate a numeric expression, and set the result man print information for builtins more page piped output to the terminal nl number the lines in the input null ignore the input printf output formatted data to the terminal read read input into variables set_oper set operational values sleep pause execution of the terminal sort sort the input tail print the tail of the input true return true in while or if expressions, and set the result uname print system information wc count lines, words, and chars Related Commands Command shell environment load Description Downloads Cisco IOS.sh environment from a specified file to the current TTY. 11

show shell functions A through Z Commands show shell functions To display information about Cisco IOS Shell (IOS.sh) user-defined and built-in functions, use the show shell functions command in privileged EXEC mode. show shell functions [functionname brief] Syntax Description functionname brief (Optional) Specifies a user-defined shell function. (Optional) Lists the names of the user-defined and built-in functions. Command Modes Privileged EXEC (#) Command History Release 15.1(4)M 15.1(2)S 15.1(1)SG 15.1(1)SY Modification This command was introduced. This command was integrated into Cisco IOS Release 15.1(2)S. This command was integrated into Cisco IOS Release 15.1(1)SG. This command was integrated into Cisco IOS Release 15.1(1)SY. Usage Guidelines Use this command to display the shell information for the router. Examples The following example shows how to use the show shell functions privileged EXEC command to display the details of the user-defined and built-in functions. Field names are self-explanatory. Router# show shell functions #User defined functions: function enable_archive() { configure terminal archive path disk0:backup write-memory end } function enable_logging() { configure terminal archive logging enable 12

A through Z Commands show shell functions record rc end } #Global User functions: #Built-in functions: (( evaluate a numeric test expression [[ evaluate a logical test expression cat output data from a pipe or file to the terminal cut edit piped output echo echo arguments to the terminal false return false in while or if expressions, and set the result fetch return values from the configuration database grep search for regular expressions in piped output or files head print the first lines in the input interface print interfaces that match the argument let evaluate a numeric expression, and set the result man print information for builtins more page piped output to the terminal nl number the lines in the input null ignore the input printf output formatted data to the terminal read read input into variables set_oper set operational values sleep pause execution of the terminal sort sort the input tail print the tail of the input true return true in while or if expressions, and set the result uname print system information wc count lines, words, and chars The following example shows how to use the show shell functions brief privileged EXEC command to display a list of the names of user-defined and built-in functions: Router# show shell functions brief #User defined functions: enable_archive enable_logging #Global User functions: #Built-in functions: (( [[ cat cut echo false fetch grep head 13

show shell functions A through Z Commands interface let man more nl null printf read set_oper sleep sort tail true uname wc Table 1: Built-in Cisco IOS.sh Functions Built-in Function cat cut echo false fetch for grep head interface let man more nl null printf read set_oper Description Output data from a pipe or file to the terminal. Edit piped output. Echo arguments to the terminal. Return false in while or if expressions, and set the result. Return values from the configuration database. Cisco IOS.sh for loops. Search for regular expressions in piped output or files. Print the first lines in the input. Print interfaces that match the argument. Evaluate a numeric expression, and set the result. Print information for built-ins. Page piped output to the terminal. Number the lines in the input. Ignore the input. Output formatted data to the terminal. Read input into variables. Set operational values. 14

A through Z Commands show shell functions Built-in Function sleep sort tail true uname wc Description Pause execution of the terminal. Sort the input. Print the tail of the input. Return true in while or if expressions, and set the result. Print system information. Count lines, words, and chars. The following example shows how to use the show shell functions enable_archive privileged EXEC command to view the user-defined enable_archive function: Router# show shell functions enable_archive #User defined functions: function enable_archive() { configure terminal archive path disk0:backup write-memory end } 15

terminal shell A through Z Commands terminal shell To enable Cisco IOS Shell (IOS.sh) functions on the router use the terminal shellcommand in privileged EXEC mode. To disable Cisco IOS.sh functions, use the no form of this command. terminal shell [trace] terminal no shell Syntax Description trace Turns on the trace feature on the shell functions that prints the CLI as they are applied. Add trace if it is available [If the trace option is given, it will turn on the trace on the shell functions that prints the CLI as they are applied.] Command Modes Privileged EXEC (#) Command History Release 15.1(4)M 15.1(2)S 15.1(1)SG 15.1(1)SY Modification This command was introduced. This command was integrated into Cisco IOS Release 15.1(2)S. This command was integrated into Cisco IOS Release 15.1(1)SG. This command was integrated into Cisco IOS Release 15.1(1)SY. Usage Guidelines You can turn shell processing on the terminal by using the terminal shellcommand. However shell processing feature is only on while the terminal is running. Once the terminal is turned off, shell processing is off. When the terminal shell command is used, shell processing is not visible in the running configuration because it is only on the terminal level and is not in the configuration level. It is convenient to use the terminal shell command at the terminal level to quickly access the Cisco IOS.sh man commands. To enable shell processing in the configuration, it is recommended that you use the shell processing fullcommand. Examples The following examples shows how to enable Cisco IOS.sh functions on the router and enable the trace feature: Router# terminal shell Router# terminal shell Router# terminal shell trace The following examples shows how to disable Cisco IOS.sh functions on the router: Router# terminal no shell 16

A through Z Commands terminal shell Related Commands Command shell processing full Description Enables Cisco IOS.sh processing on the router in global configuration mode. 17

terminal shell A through Z Commands 18