LoginSignup
7
7

More than 5 years have passed since last update.

macosx 設定メモ bash編

Last updated at Posted at 2016-02-06

El Capitanには、.bash_profileも、.bashrcもありません。
なので自力で作成します。

$ touch .bash_profile
$ vi .bash_profile

viじゃなくても良いですが、.bash_profileに下記のように書き込みます。

source ~/.bashrc

または、

if [ -f ~/.bashrc ] ; then
. ~/.bashrc
fi

これは自分の趣味ですが、メモとして残します。

# プロンプトを[アカウント名@ホスト名 フルパス 時刻] の形式で表示する
export PS1='[[\033[40;0;33m]\u@\h \w/ [\033[40;2;37m]\t[\033[0m] ] $ '

# historyコマンドに日時を表示するようにする
HISTSIZE=2000
HISTTIMEFORMAT='%F %T '
unset HISTCONTROL
export HISTSIZE HISTTIMEFORMAT

さらに.bashrcを作成

$ touch .bashrc
$ vi .bashrc

これも個人的な設定を・・・

alias ls="ls -G"
alias ll="ls -la"

手始めに、こんな感じでbash環境を整備します。

7
7
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
7
7