Tambourine作業メモ

主にスキル習得のためにやった作業のメモ。他人には基本的に無用のものです。

treeコマンド

treeコマンドは、たまーに欲しくなる。 プロジェクトの共有ディレクトリの使い方を説明するととかに。

Macにはない。Homebrewで入れれば良いらしい

> brew install tree
==> Downloading https://homebrew.bintray.com/bottles/tree-1.8.0.mojave.bottle.ta
######################################################################## 100.0%
==> Pouring tree-1.8.0.mojave.bottle.tar.gz
🍺  /usr/local/Cellar/tree/1.8.0: 8 files, 117KB

試して見る

> ls
納品      課題      成果物
> tree
.
├── ?\215?\223\201
├── 課?\214
└── ?\210\220?\236\234?\211?

3 directories, 0 files

おおぅ。-Nが必要らしい

> tree -N
.
├── 納品
├── 課題
└── 成果物

3 directories, 0 files

絶対忘れるので、aliasを設定しておく

> alias tree "tree -N"
> tree 
.
├── 納品
├── 課題
└── 成果物

3 directories, 0 files

fishのaliasは、実体としては関数定義。なので、関数を保存する必要がある。

> funcsave tree

確認してみよう

> functions
., :, N_, abbr, alias, bg, cd, cdh, contains_seq, delete-or-exit, dirh, dirs,
disown, down-or-search, edit_command_buffer, eval, export, fg,
fish_breakpoint_prompt, fish_clipboard_copy, fish_clipboard_paste, fish_config,
fish_default_key_bindings, fish_default_mode_prompt, fish_fallback_prompt,
fish_hybrid_key_bindings, fish_indent, fish_key_reader, fish_md5,
fish_mode_prompt, fish_opt, fish_print_hg_root, fish_prompt,
fish_sigtrap_handler, fish_title, fish_update_completions, fish_vi_cursor,
fish_vi_key_bindings, fish_vi_mode, funced, funcsave, grep, help, history,
hostname, isatty, kill, la, ll, ls, man, nextd, nextd-or-forward-word, open,
popd, prevd, prevd-or-backward-word, prompt_hostname, prompt_pwd, psub, pushd,
pyenv, rbenv, realpath, seq, setenv, string, suspend, trap, tree, type, umask,
up-or-search, vared, wait,
> functions tree
# Defined in - @ line 1
function tree --description 'alias tree tree -N'
    command tree -N $argv;
end
>