GNU/Linux >> Linux の 問題 >  >> Linux

Linux でのさまざまな OS シェルの環境呼び出しの順序

異なる OS シェルの環境変数の実行順序を知ることは、システム管理者にとって非常に重要です。これは、cron ジョブの設定や、対話型シェルで実行されるコマンドと非対話型シェルを使用するバッチ ジョブの違いを理解するのに役立つ場合があります。

1.シェル:CSH

起動 (順序):

--> .cshrc (always)
--> .login (login shells)

終了:

--> .logout (login shells)

その他:

.history (saves history based on "$savehist")

2.シェル:tcsh

起動 (順序):

--> /etc/csh.cshrc (always)
--> /etc/csh.login (login shells)
--> .tcshrc (always)
--> .cshrc (if no .tcshrc file is present)
--> .login (login shells)

終了:

-->.logout (login shells)

その他:

--> .history (saves history based on "$savehist")
--> .cshdirs (saves directory stack)

3.シェル:sh

起動 (順序):

--> /etc/profile (login shells)

終了:

Any command or script specified using the command: trap "command" 0

その他:

--> .profile (login shells)

4.シェル:ksh

起動 (順序):

--> /etc/profile (login shells)
--> .profile (login shells)
--> $ENV (always, if it is set)

終了:

Any command or script specified using the command: trap "command" 0

5.シェル:bash

起動 (順序):

--> /etc/profile (login shells)
--> .bash_profile (login shells)
--> .profile (login if no .bash_profile file is present)
--> .bashrc (interactive non-login shells)
--> $ENV (non-interactive shells)

終了:

--> .bash_logout (login shells)

その他:

--> .inputrc (readline initialization)

6.シェル:zsh

起動 (順序):

--> .zshenv (always, unless the -f option is specified)
--> .zprofile (login shells)
--> .zshrc (interactive shells, unless the -f option is specified)
--> .zlogin (login shells)

終了:

--> .zlogout (login shells)


Linux
  1. Linuxのシェルの種類は何ですか?

  2. 2020年のLinux向けの10の最高のビデオ会議ソフトウェア

  3. Linux で「パスワードなし」の ssh ログイン用に SSH キーをセットアップする方法

  1. Condaを使用してさまざまなPythonバージョンの仮想環境を作成する

  2. Linux で SSH の「公開/秘密鍵」ログイン用の SSH キーをセットアップする方法

  3. Linux カーネルは __init 呼び出しの順序をどのように決定しますか?

  1. Linuxマシンでrootユーザーのリモートログインを無効にする方法

  2. Linux –すべてのユーザーにとって永続的な環境変数?

  3. Linux –異なるLinux / UNIXカーネルは交換可能ですか?