treeをインストール

電脳備忘録

サーバーのディレクトリ構造をさっくっと知るのにtreeコマンドが便利らしいので、さっそくテストサーバにインストールしてみました。

たまにディレクトリ構成図とか作ることがあると思いますが、こいつを使えばズバッと一発で作れてしまうニクイやーつなのです。

[Linux] ディレクトリ構成図作るのに便利だよ tree コマンド

サーバーのOSはCentOS6.3なのでyumでインストールできました。

# yum -y install tree
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
* base: mirror.fairway.ne.jp
* extras: mirror.fairway.ne.jp
* updates: mirror.fairway.ne.jp
base                                                     | 3.7 kB     00:00
extras                                                   | 3.5 kB     00:00
updates                                                  | 3.5 kB     00:00
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package tree.x86_64 0:1.5.3-2.el6 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
================================================================================
Package         Arch              Version                Repository       Size
================================================================================
Installing:
tree            x86_64            1.5.3-2.el6            base             36 k
Transaction Summary
================================================================================
Install       1 Package(s)
Total download size: 36 k
Installed size: 65 k
Downloading Packages:
tree-1.5.3-2.el6.x86_64.rpm                              |  36 kB     00:00
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : tree-1.5.3-2.el6.x86_64                                      1/1
Verifying  : tree-1.5.3-2.el6.x86_64                                      1/1
Installed:
tree.x86_64 0:1.5.3-2.el6
Complete!

ツリー表示したいディレクトリに移動して「tree」コマンドを打つとディレクトリ構造を一覧化してくれました。

# cd /var/www/html
# tree
・
├── Finished
├── Package
├── Running
├── test001
│      └── index.html
├── test002
│      └── index.html
└── test003
         └── index.html

確かに便利ですね。構成図の作成というより、 ディレクトリ内に消し忘れファイルがないかのチェックに使おうかと思っています。

広告

ブログの維持費に充てるでございます・・・。