MacOS 上での個人設定
MacOS の個人設定,ドットファイルの類い. 私的な記録目的.ある種のバックアップとも言える.
設定ファイル
$HOME 以下の設定ファイル.
- ~/.bash_profile の冒頭で ~/.bashrc を読みこむ
- ソフトウェア・コマンド類の環境変数設定など, ほぼ全ての設定は ~/.bashrc に書き込んでおく.
- ~/.bash_profile は,SSH トンネル関連の実行や,全体で共通する環境変数などのみを記述.
- MacOS 特有のコマンドやオプションも,Linux 環境とできる限り共通した書式で実行可能にしておく. See also Mac Tips (hysk)
- OSバージョンアップや PC環境の移設時 (See also MacOS データ移設 (hysk)), 設定ファイルの移動や修正を忘れるかもしれない. このページは,未来の自分への申し送りでもある(コピー忘れしても,ここを見れば復旧可能).
~/.bash_profile
~/.bash_profile (2016-02-13版).
# Create manually (M. Hayasaki; 2013-06-04) if [ -f ~/.bashrc ]; then . ~/.bashrc fi # MacPorts Installer addition on 2015-01-20_at_15:59:14: adding an appropriate PATH variable for use with MacPorts. export PATH="/opt/local/bin:/opt/local/sbin:$PATH" # Finished adapting your PATH environment variable for use with MacPorts. ### SSH tunnel ssh -q -fN con_serverA ### Set default blocksize as 1kiro byte for ls, df, du commands export BLOCKSIZE=1k
~/.bashrc
~/.bashrc (2016-02-13版).
# Source global definitions if [ -f /etc/bashrc ]; then . /etc/bashrc fi PS1="[\u@\h:\w]\n$ " PATH=$PATH:/usr/local/mysql/bin PATH=$HOME/bin:$HOME/local/bin:/usr/local/bin:/usr/local/grads/bin:$PATH export HISTCONTROL=ignoreboth export PATH ## NetCDF (use v3 series as default; 2015-04-08) export NETCDF=/usr/local/netcdf3 ## GrADS export GASCRP=$HOME/local/grads-2.0.1/gslib export GADDIR=$HOME/local/grads-2.0.1/data2 ## NCL export NCARG_ROOT=/usr/local/NCL ## Fortran (use gfortran on MacOS X) # (Use MacPorts, 2015-01-20) export FC=/opt/local/bin/gfortran export F77=$FC export F90=$FC export F9X=$FC alias ls='ls -F' alias la='ls -a' alias ll='ls -l' # lr: Full Recursive Directory Listing # ------------------------------------------ alias lr='\ls -R | grep ":$" | sed -e '\''s/:$//'\'' -e '\''s/[^-][^\/]*\//--/g'\'' -e '\''s/^/ /'\'' -e '\''s/-/|/'\'' | less' # Copied from https://gist.github.com/stephenll/8762279 ### If you execute in command-line, use following command: # ls -R|grep ":$"|sed -e 's/:$//' -e 's/[^-][^\/]*\//--/g' -e 's/^/ /' -e 's/-/|/' |less #### quick-view TeX Bibliography file alias bibless='less ~/home/tex/BIB/biblio.bib' #### Execute application(s) from command-line ## quick-view of images (qlmanage; subprogram for Finder (to view image thumbnail)) #alias ql='qlmanage -p "$@" >& /dev/null' alias ql='qlmanage -p $@ >& /dev/null' alias ppt='open -a Microsoft\ PowerPoint' alias word='open -a Microsoft\ Word' alias excel='open -a Microsoft\ Excel' alias xpdf='open -a Preview' alias finder='open .' ###################################################################### ##### Remote login settings ###################################################################### ### SSH tunnel to server-A alias scon_serverA='ssh -fN con_serverA' ### Remote login using SSH configuration (~/.ssh/config) alias ssh_serverA='ssh -X -p 10022 localhost' alias scp_serverA='scp -p -P 10022 ' ### Direct SSH login using hostname (/etc/hosts) # -> "$hostname" style alias serverB="slogin -X serverB"
変更履歴
更新日 | 内容 |
---|---|
2015-02-13 | 記述開始.~/.bashrc & ~/.bash_profile を記録. |