2006-09-27 Wed

コマンド使用率ランキング はてぶ

zsh は

% perl -pe 's/.+;//' ~/.zsh-history | sort | uniq -c | sort -r|head -12


で集計.

zsh は使い始めたばかり [2006-09-20-2] で,

$ wc -l .zsh-history
316 .zsh-history


と履歴が少ないので,bash の履歴を調べてみた.

$ sort < ~/.bash_history |uniq -c |sort -nr |head
   1659 ls
    998 exit
    544 cl-local
    511 screen -r
    264 su -
    263 screen emacs
    258 cd
    243 ps ax
    228 df -h
    217 cd


cd が 2 個あるけど,これは "cd" か "cd " の違いみたい.

気になるなら

$ sed -e 's/ *$//' < .bash_history |sort |uniq -c |sort -nr |head


で行末のスペースを落とせばいい.

via: コマンド使用率ランキング
     http://www.pochi.cc/~sasaki/chalow/2006-09-27-9.html

2003-03-26 Wed

bash で補完 はてぶ

rpm --rebuild するとき、file 名を補完しようと TAB を押しても候補に
.src.rpm しかでてこない。/etc/bash_completion を見ると、

        --re@(build|compile))
                if [[ "$cur" == -* ]]; then
                        COMPREPLY=( $( compgen -W '--nodeps --rmsource \
                                --rmspec --sign --nodirtokens' -- $cur ) )
                else
                        _filedir 'src.rpm'
                fi
                ;;


となっていたので、_filedir 'src.rpm' を _filedir '@(nosrc|src).rpm'
に書き換え。

ChangeLog 最新ページ