はじめての Cisco ネットワーク機器④ 「CLI コマンドの補助機能」

はじめてのシスコネットワーク機器

たくさんの種類がある Cisco の CLI コマンドをすべて最初に覚えておく必要はありません。わからなくなった場合は簡単にその場で調べたり、正しい CLI コマンドの実行を手助けをしてくれる補助機能があります。またこれらを普段から使用することはコマンドの入力ミスを防ぐためにも有効です。知っておくととても便利な機能ですのでここで紹介したいと思います。

CLI 補助機能① 使用可能なCLIコマンドの一覧を表示する

? を使用すると即座にその時点で入力可能なコマンドの一覧が表示されます。入力する場所によって表示される内容に違いがあります。

例1:はじめに、 ? だけを入力すると、そのモードで実行可能なコマンドの一覧が表示されます。

Switch# ?
 Exec commands:
   access-enable    Create a temporary Access-List entry
   access-template  Create a temporary Access-List entry
   archive          manage archive files
   beep             Blocks Extensible Exchange Protocol commands
   cd               Change current directory
   clear            Reset functions
   clock            Manage the system clock
   cns              CNS agents
   configure        Enter configuration mode
   connect          Open a terminal connection
   copy             Copy from one file to another
   crypto           Encryption related commands.
   debug            Debugging functions (see also 'undebug')
   delete           Delete a file
   dir              List files on a filesystem
   disable          Turn off privileged commands
   disconnect       Disconnect an existing network connection
   dot1x            IEEE 802.1X Exec Commands
   enable           Turn on privileged commands
   erase            Erase a filesystem
   exit             Exit from the EXEC
  --More--

例2:コマンドの途中で ? を入力するとその時点で続けて入力可能なコマンド候補を表示します。

Switch# sh?
shell show

例3:コマンドにつづく入力可能なオプションを表示するために、スペースのあと ? を入力します。

   Switch# show running-config ?
   all        Configuration with defaults
   brief      configuration without certificate data
   full       full configuration
   identity   Show identity profile/policy information
   interface  Show interface configuration
   map-class  Show map class information
   partition  Configuration corresponding a partition
   view       View options
   vlan       Show L2 VLAN information
   |          Output modifiers
  

CLI 補助機能② コマンドを補完する

コマンド入力途中で候補が1つしかなくなった時点で tabキー を押すと残りの部分を補完してくれます。

例:show running-config の途中で tabキー 補完する

Switch# show ru[tabキーを押す]
Switch# show running-config

CLI 補助機能③ コマンドを省略する

コマンドのキーワードはすべて完璧に入力しなくても候補が1つになった文字数からは省略することが可能です。
頻繁に使うコマンドは自分なりの省略形で覚えておくと便利です。

例1:configure terminal の省略

Switch# conf t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#

例2:interface GigabitEthernet 0/1 の省略

Switch(config)# int gi 0/1
Switch(config-if)#

参考リンク

はじめての Cisco ネットワーク機器① 「起動~コンソール接続」

はじめての Cisco ネットワーク機器② 「CLI コマンドモード」

はじめての Cisco ネットワーク機器③ 「基本 CLI コマンド」

未経験からネットワークエンジニアを目指す勉強方法


コメント

タイトルとURLをコピーしました