2 月 10

作業環境が変わるたびにaliasを定義するのがうっとおしいので、
alias化したコマンドを書いておきます。

※csh,tcsh用です Q4b

alias ls ‘ls -F’
alias ll ‘ls -l’
alias la ‘ls -a’
alias lla ‘ls -la’
alias lc ‘ls “*.c”‘
alias lh ‘ls “*.h”‘
alias new ’source ~/.tcshrc’
alias fh ‘find -name “*.h” -print | xargs grep $1′
alias fc ‘find -name “*.c” -print | xargs grep $1′
alias fm ‘find -name “makefile” -print | xargs grep $1′
alias ver ‘cat CVS/Entries | grep $1′

説明

alias 説明
alias ls ‘ls -F’ ディレクトリには/を、実行権限ファイルには*を、リンクには@を表示してlsする。
alias ll ‘ls -l’ ファイルの詳細を表示する 
alias la ‘ls -a’ 隠しファイルを表示する
alias lla ‘ls -la’ 隠しファイルを含むファイルの詳細を表示する
alias lc ‘ls “*.c”‘ Cソースだけを表示する
alias lh ‘ls “*.h”‘ ヘッダファイルだけを表示する
alias new ’source ~/.tcshrc’ シェルをリロードする
alias fh ‘find -name “*.h” -print | xargs grep $1′ 使い方
> fh AAAA
AAAAを含むヘッダファイルを検索する
alias fc ‘find -name “*.c” -print | xargs grep $1′ 使い方
> fc ABC
ABCを含むCソースを検索する
alias fm ‘find -name “makefile” -print | xargs grep $1′  使い方
> fm BBB
BBBを含むmakefileを検索する
alias ver ‘cat CVS/Entries | grep $1′  使い方
> ver main.c
main.cの現在のバージョンを表示する。