0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

.bashrc,.bashprofileの変更反映

Last updated at Posted at 2019-10-30

.bashrcなどを変更したときにすぐに反映される方法

一回ターミナルを閉じ直して、もう一度開き直せば反映されますが、コマンドからやるときは

$source ~/.bash_profile でOK

試しに、コマンド履歴を便利に取り出す関数を導入して見ます(関数に関してはhttps://qiita.com/catfist/items/82ed3df7a0b524aeab69 
の記事をコピペです)

[bash_profileに関数chisを追加]
スクリーンショット 2019-10-30 7.24.54.png

.bash_profileの読み込み
 58 07:18:42 ~/Lab_tool  $ vim ~/.bash_profile 
 59 07:20:03 ~/Lab_tool  $ chis
-bash: chis: command not found
 60 07:20:05 ~/Lab_tool  $ source ~/.bash_profile 
 61 07:23:13 ~/Lab_tool  $ chis
source ~/.bash_profile

となり、source ~/.bash_profile をする前は使えなかったchisが使えるようになり、直前のコマンドが呼び出せました

source ~/.bash_profile

0
1
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
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?