GithubHelp home page GithubHelp logo

dot-files's Introduction

dot-files

my dot files

.bashrc vs .bash_profile

bashの日本語manページより抜粋&まとめ。

"~/.bash_profile" を読み込む場合

bashが対話的なログインシェルとして起動されるか、 --login オプション付きの非対話的シェルとして起動されると、/etc/profile からコマンドを読み込んで実行した後、以下の順番でファイルを探し、最初に見つかった読み込み可能なファイルからコマンドを実行する。

~/.bash_profile
~/.bash_login
~/.profile

"~/.bashrc" を読み込む場合

ログインシェルでない対話的シェルとして起動されると、 ~/.bashrc ファイルがあれば、 bash はここからコマンドを読み込み、実行する。

よく見かける .bash_profile と .bashrc の組み合わせ

以下のように .bash_profile 内で .bashrc を読み込ませる。 こうしておけば、ログインシェルか否かにかかわらず .bashrc を読み込んでくれる。 大半のLinuxディストリビューションやCygwin/MinGW系ツールがこの流儀に従っているので、日常的なシェル環境の設定は .bashrc の方に書いておけば良い。

~/.bash_profile:

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

~/.bashrc:

(対話環境 = terminal アプリでSSHログインなどして接続するCLI環境用設定)
PS1="[\u@\h \W]\$ "
export PS1
alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'
...

参考URL

dot-files's People

Contributors

msakamoto-sf avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.