LoginSignup
3
3

More than 5 years have passed since last update.

gnu の tree コマンド

Last updated at Posted at 2013-09-04

gnu tree コマンドは数多くのオプションがあります。
  http://mama.indstate.edu/users/ice/tree/

便利そうなオプションを紹介します。

 $ tree -fapugsQD  .
 "."
├── [-rw-r--r-- youichik staff            430 May 28 13:26]  "./.gitignore"
├── [-rw-r--r-- youichik staff            766 May 28 13:26]  "./Gemfile"
├── [-rw-r--r-- youichik staff           2508 May 28 13:37]  "./Gemfile.lock"
├── [-rw-r--r-- youichik staff           9220 May 28 13:26]  "./README.rdoc"
├── [-rw-r--r-- youichik staff            272 May 28 13:26]  "./Rakefile"
├── [drwxr-xr-x youichik staff            272 May 28 13:26]  "./app"
│   ├── [drwxr-xr-x youichik staff            170 May 28 13:26]  "./app/assets"
│   │   ├── [drwxr-xr-x youichik staff            102 May 28 13:26]  "./app/assets/images"
  ...  以下省略 ...
 83 directories, 93 files

H をオプションに追加すれば、これらが HTML 形式で出力されます。
C を追加指定すれば、色も付きます。

ある Directory 以下を apache の directory-index をつかわずに公開したかったら、
この tree コマンドをつかって html を生成すると良さそうです。

X をオプション指定すれば、XML形式で出力を得られます。

XML形式を利用して、なにかツールを作れそうな気もします。
# rails で作成したファイル群から、最小限 必要なファイル/ディレクトリだけをサーバーに
# ftp 転送し、permission, owner, group を設定するとか ...

3
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
3