0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

【コマンド】MacでTreeコマンドを使い、ディレクトリ構造を出力する

Posted at

ディレクトリ構造をツリー形式で表示できる、TREE コマンドの使い方について解説します。


Homebrewをインストール

TreeはHomebrewでインストールするので、Macに入っていない場合は先に入れておく。

※Homebrewとは、コマンドラインで使うmacOS用のパッケージマネージャー。簡単なコマンドを入れるだけでプログラムをインストールできるようになる。

Homebrewをインストールすると brew というコマンドが使えるようになる。バージョンを確認するコマンドは以下の通り。

$ brew -v

Treeをインストール

Treeのインストールは以下のコマンドで行う。

$ brew install tree

Treeの使い方

1.対象のディレクトリに移動

user$ cd /pathを指定

2.treeコマンドを実行

対象のディレクトリ名$ tree

実行すれば、ディレクトリの内容がツリー構造で出力されます。

0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?