init / configスクリプトを実行せずにbashを実行する方法は?

init / configスクリプトを実行せずにbashを実行する方法は?

システムディレクトリに~/.bashrc~/.bash_profileおよび同様のファイルがあります。~/.profile

init / configスクリプトを実行せずにbashを実行する方法

  • 下に~
  • システムディレクトリにありますか?
  • 上記の2つの下ですか?

必要

  • ファイルを変更しないでください。

  • bashをログインまたは非ログインシェルとして実行します(両方に興味があります)。 Linux を起動してもこのファイルを実行できるようにします。

  • bashを対話型または非対話型シェルとして実行する(両方に興味がある)

ありがとうございます。

ベストアンサー1

bash --noprofile

構成スクリプト(ユーザーの範囲とシステムの範囲)をロードせずにBashシェルを実行します。

からman bash

   -i        If the -i option is present, the shell is interactive.
   -l        Make bash act as if it had been invoked as a login shell (see INVOCATION below).

(...)

   --noprofile
          Do  not  read  either  the  system-wide  startup  file  /etc/profile  or  any  of  the  personal initialization files ~/.bash_profile,
          ~/.bash_login, or ~/.profile.  By default, bash reads these files when it is invoked as a login shell (see INVOCATION below).

おすすめ記事