0
0

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 3 years have passed since last update.

【Linux】エイリアスの登録

Posted at

■.bashrcにエイリアスを記述する

初めに.bashrcにエイリアスを定義する。
.bashrcは、bashを起動したときに読み込まれる設定ファイル。
シェル起動時に1回実行される。

vim ~/.bashrc

ファイルを開いたら記述する。

.bashrc
alias ee='export ENV=dev'

■source ~/.bash_profileの実行

.bashrcにエイリアスを定義したら、.bash_profileに反映させる必要がある。
.bash_profile.bashrc同様にbashの設定ファイルで、ターミナルを起動したときなどログイン時に1回実行される。
ここには環境変数などを定義する。
以下コマンドで.bashrcの設定を.bash_profileに反映させる。

source ~/.bash_profile

コマンドを実行したら、ターミナルを再起動。

alias

aliasコマンド実行すると登録したエイリアスが表示される。

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?