Kodama's home / tips.
ディレクトリの tree 構造を見るコマンドは探せばいくつかあるけど, 自分で簡単につくれるので sed 等の練習に自分でやってみるとよい. dtree とか云う名で スクリプトを作っておくと良いよね. 内部では find でディレクトリを探っているので, find のオプションを改造して, 特定の条件のファイルやディレクトリを図示するのにも使える.
$ dtree /home/ftp /home/ftp +--bin +--etc +--incoming +--lib +--pub | +--knot | | +--old | +--tools | : +--dic | : +--sather +--usr : +--bin
$ cd /home/ftp $ find . -type d|sort|sed -ne'1b;s/[^\/]*\//+--/g;s/+--+/| +/g;s/+--+/| +/g;s/+--|/| |/g;p' +--bin +--etc +--incoming +--lib +--pub | +--knot | | +--old | +--tools | | +--dic | | +--sather +--usr | +--bin
Kodama's home / tips.