Skip to content

Instantly share code, notes, and snippets.

@aphlysia
Last active August 29, 2015 14:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aphlysia/e8d04d2bb2d39ad0a4be to your computer and use it in GitHub Desktop.
Save aphlysia/e8d04d2bb2d39ad0a4be to your computer and use it in GitHub Desktop.

これは stfuawsc_itg Advent Calendar 2014 12日目の記事です。ですたい。

.bashrc をさらす

PS1='\[\033[34m\][\u:\[\033[33m\]\w\[\033[34m\]]\[\033[0m\] \$ '

alias rm='rm -i'
alias mv='mv -i'
alias cp='cp -i'
alias less='less -i'
alias irb='irb --noecho'
alias ssh='ssh -o ServerAliveInterval=60'

export PATH="~/bin:${PATH}"
export PAGER="less"

# history の設定
# screen とかで複数セッションあるときに history が消えないようにする
# http://d.hatena.ne.jp/sppr/20090109/1231518070 より
shopt -s histappend
export PROMPT_COMMAND="history -a"
export HISTSIZE=10000
# history に日時を入れる
# http://d.hatena.ne.jp/takuya_1st/20090828/1251474360 より
export HISTTIMEFORMAT="%Y%m%d %T "

うーん、普通ですね。rm, mv, cp-i と、history の設定は強くおすすめです。デフォルトの history は

  994  df -k
  995  du -h /tmp
  996  cd /tmp/
  997  ls -la
  998  cd hoge
  999  ls -la
 1000  history | less

こんなんで、いつ実行されたのかわからないし1000個までしかないし。それが

 9872  20141209 14:40:00 pyenv shell miniconda3-3.4.2
 9873  20141209 14:40:04 python --version
 9874  20141209 14:40:10 python
 9875  20141209 14:40:14 ipython
 9876  20141209 14:40:32 conda info -l
 9877  20141209 14:40:41 conda help info
 9878  20141209 14:40:48 conda info -e

こんなんになります。

あとエイリアスは、コマンドの前に \ をつけると打ち消せますね。最近知りました。

@atakemura
Copy link

まとめてレポジトリにするとべんり
https://github.com/klarcius/dotfiles

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment