kengo92iの日記

プログラミングとかやったことの記録を書いていきます。

とりあえずコピペで済ませる .bash_profile テンプレート

Macのターミナルの設定ファイルである.bash_profile のテンプレートです.
後々の設定は必要かもしれませんが,最低限の設定ができる .bash_profile です.

.bash_profile とは?

Macのターミナルの設定ファイルです.基本的には隠しファイルになっているのでFinder上には表示されません..bash_profileは作成されている場合は,自分のホームディレクトリに存在しています.とりあえず,下記のコマンドを入力して存在しているか確認してみましょう.

$ cd
$ ls -la | grep .bash_profile

なければ, .bash_profileを作成して適当に作りましょう.

$ touch .bash_profile
$ vim .bash_profile # お好きなエディタを使ってください.

コピペで済ませるテンプレート

##
# My Setting File
##

alias h="history"
alias h2="history 20"
alias la="ls -la"
alias ll="ls -l"

export CLICOLOR=1
export LSCOLORS=exfxcxdxbxegedabagacad
export TERM=xterm-color

export _JAVA_OPTIONS="-Dfile.encoding=UTF-8"

export PS1='\[\033[01;31m\]\u\[\033[00m\]@:\[\033[01;34m\]\w\[\033[00m\]\$ '

echo -e Welcome to "\033[1;31m`hostname`\033[0;39m", it\'s "\033[1;32m`date "+%Y/%m/%d"`\033[0;39m" today, "\033[1;34m`date "+%H:%M:%S"`\033[0;39m" now.

##
# End of .bash_profile
##