showコマンド表示のフィルタ
showコマンドによっては、非常に長い表示になることがあります。長い表示のshowコマンドから確認したい部分を効率よく見つけるには、showコマンドの表示をフィルタします。showコマンドのあとに「|」(パイプ)でどのような表示のフィルタをかけるかを決められます。
R1#show running-config | ? append Append redirected output to URL (URLs supporting append operation only) begin Begin with the line that matches exclude Exclude lines that match include Include lines that match redirect Redirect output to URL section Filter a section of output tee Copy output to URL
主なフィルタの意味は次のようになります。
begin |
指定した文字列を含む行から表示する |
exclude |
指定した文字列を含む行を除外して表示する |
include |
指定した文字列を含む行だけを表示する |
section |
指定した文字列を含むセクションだけを表示する |
セクションとは、ある行とその後に続くインデントされている行のまとまりです。以下は、show running-configのinterface FastEtehernet0/0のセクションの例です。

showコマンド表示フィルタの例
showコマンド表示のフィルタの例です。
begin
beginの表示フィルタとして、「interface FastEtehernet0/0」を含む行からrunning-configの表示を開始するフィルタの例です。
R1#show running-config | begin interface FastEthernet0/0 interface FastEthernet0/0 ip address 192.168.1.254 255.255.255.0 duplex auto speed auto ! ! no ip http server ip forward-protocol nd ! ~省略~
exclude/include
excludeおよびincludeのフィルタの例です。show ip interface briefでインタフェースのIPアドレスと状態を見ています。インタフェースの状態がup/upとなっているインタフェースだけ表示する例です。
「exclude down」でdownのインタフェースを除外して表示します。または「include up」でupのインタフェースのみ抜き出して表示します。
R1#show ip interface brief Interface IP-Address OK? Method Status Protocol FastEthernet0/0 192.168.1.254 YES manual up up Loopback0 192.168.0.1 YES manual administratively down down R1#show ip interface brief | exclude down Interface IP-Address OK? Method Status Protocol FastEthernet0/0 192.168.1.254 YES manual up up R1#show ip interface brief | include up FastEthernet0/0 192.168.1.254 YES manual up up
section
sectionを使った表示フィルタの例です。「section line」と指定すると、「line」を含む行のセクションのみを表示します。これにより「line con 0」のセクションの設定と「line aux 0」のセクションの設定と「line vty 0 4」のセクションの設定だけを表示します。
R1#show running-config | section line line con 0 exec-timeout 0 0 privilege level 15 password 7 094F471A1A0A logging synchronous login line aux 0 exec-timeout 0 0 privilege level 15 password 7 060506324F41 logging synchronous login line vty 0 4 login local
running-config/startup-configの特定インタフェース部分だけ表示
また、show running-config/show startup-configで特定のインタフェースの部分だけを表示することもできます。show running-config/show startup-configのあとにinterface <interface-name>を指定すると、そのインタフェースの部分だけを表示します。
R1#show running-config interface loopback 0 Building configuration... Current configuration : 77 bytes ! interface Loopback0 ip address 192.168.0.1 255.255.255.255 shutdown end
関連記事
「ネットワークのおべんきょしませんか?」内の記事を検索
Ciscoのキホン
- Ciscoルータのメモリ領域とコンフィグレーションレジスタ
- Ciscoルータの起動シーケンス
- 設定のための準備
- Cisco機器の設定ファイル
- Cisco機器の設定の流れ
- Cisco CLIの基礎知識 ~コマンドの種類とモード~
- Cisco機器のインタフェース
- Cisco CLIのヘルプと補完
- Cisco CLIの主なエラーメッセージ
- Cisco 設定コマンドの削除
- default interfaceコマンド ~インタフェースの設定を初期化~
- Cisco コマンドの一括入力
- doコマンド ~コンフィグレーションモードからEXECコマンドを実行~
- interface rangeコマンド ~複数インタフェースの一括設定~
- showコマンド表示のフィルタ ~見たい情報だけを適切に表示~
- debugコマンド ~リアルタイムの動作確認~
- CLIログイン時に自動的に特権EXECモードに移行する
- 設定ファイルの保存と管理
- IOSファイルシステムの操作
- Catalystスイッチの管理 ~スイッチにIPアドレスを設定する意味~
- Cisco機器の時刻設定
- VTYアクセス(Telnet/SSH)によるリモート管理
- terminal monitorコマンド ~Telnet/SSHのログイン先のログを表示~
- 多段階Telnetのセッション中断
- Cisco パスワードの最小文字数設定
- Cisco 初期設定の例
- CDP ~つながっている機器はなに?~
- Ciscoルータ パスワードリカバリ
- Catalystスイッチのパスワードリカバリ