■環境変数 シェル変数
□printenv
環境変数の表示
□set
$ set 環境変数、シェル変数の表示
$ set -o 設定されているオプションを確認する
$ set -o opt オプションを設定する
$ set +o opt オプションを無効にする
□alias
$ alias ls=’ls -l’
$ alias lsmore=”ls -l | more’
$ ¥ls
□function
$ function lslink() { ls -s | grep ‘^l’; }
※ls -l でファイルを表示すると行頭のファイル種別がlになる
□declare
$ declare -f 宣言されている関数を表示する
□unset
$ unset lsink 関数lslinkを削除
■bash files
- /etc/profile ログイン時に実行され、全ユーザーから参照される
- ~/.bash_profile ログイン時に実行される
- ~/.bash_login .bash_profileがない場合ログイン時に実行
- ~/.profile .bash_profileも.bash_loginもない場合ログイン時実行
- ~/.bashrc bash起動時に実行される
- ~/.bash_logout ログアウト時に実行される