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

bashの読み込みについて

Posted at

概要

先日作ったばかりのVMを起動していつも通り勉強を始めようとしたところ
$PS1 (プレステと呼んでいる) を編集してプロンプトをイケイケにしたのに
どうやら、再起動後は変更が消えてしまうらしい。。。
再起動しても変更を反映したいので備忘録として残す

bashの読み込みについて

VMの再起動時に読み込んでくるときいくつか読み込むファイルがあるらしい
・/etc/profile
・~/.bash_profile
・~/.bashrc

/etc/profile

システム全体で利用するためのディレクトリらしい。。

~/.bash_profile

各ユーザ単位で設定をするディレクトリ
ログインの時に読み込む

~/.bashrc

今回設定するディレクトリ
bashを起動するたびに読み込む
非ログインシェルを使う時よみこむディレクトリらしい

設定

$ vi ~/.bashrc
PS1='\t[\u]\$'←追記
追記後
source ./bashrc を入力し設定反映

さいごに

記述後は再起動してもプロンプトは自分のお気に入りのままに!
しかし。。。
設定を変更する前にはしっかりバックアップを!!
バックアップ取らずに変更してVMおしゃかは勘弁です。。。

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