LoginSignup
13
14

More than 5 years have passed since last update.

ディレクトリ構造、ファイル構造をツリー状に表示

Last updated at Posted at 2012-12-26
ディレクトリをツリー構造で表示
linux
find . -type d|sort|sed -ne'1b;s/[^\/]*\//+--/g;s/+--+/|  +/g;s/+--+/|  +/g;s/+--|/|  |/g;p'
ファイルをツリー構造で表示
linux
find . -type f|sort|sed -ne'1b;s/[^\/]*\//+--/g;s/+--+/|  +/g;s/+--+/|  +/g;s/+--|/|  |/g;p'
全て(ディレクトリ、ファイル)をツリー構造で表示
linux
find . -type . *|sort|sed -ne'1b;s/[^\/]*\//+--/g;s/+--+/|  +/g;s/+--+/|  +/g;s/+--|/|  |/g;p'

参考
http://www.math.kobe-u.ac.jp/~kodama/tips-dirtree.html

13
14
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
13
14