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 1 year has passed since last update.

Linuxの環境変数設定:起動から有効(bashの場合とcshの場合)

Posted at

bash

/etc/profile

bashのログインから実行する。全てのユーザーは参照する可能、基本の環境変数を設定する。

環境変数の設定方法

  1. /etc/profileを開く(vi /etc/profile)
  2. 環境変数設定を追加:export [環境変数]=[値]
  3. 保存

csh

/etc/csh.login

/etc/csh.loginはcshの「/etc/profile」。

環境変数の設定方法

  1. /etc/profileを開く(vi /etc/profile)
  2. 環境変数設定を追加:setenv [環境変数] [値] ("="がない)
  3. 保存

ターミナルの値

いまのターミナルはbashかcshの表示方法:

  • env:全ての環境変数を表示して、SHELLの値を見える。
  • echo $SHELL:直接にSHELLの値を表示できる。
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?