2024/02/13 22:13:39

bash

Unix shell bash の基本

bash 設定ファイルの読み込み順

~/ を覗くと、bash に関連するいくつかの設定ファイルがあります。

  • .bash_profile
  • .bashrc
  • .bash_history
  • .bash_logout

/etc/ にも bash の設定ファイルは存在します。

  • /etc/bashrc
  • /etc/profile
  • /etc/profile.d/*

これらのファイルは以下のような順で自動的に読み込まれます。

  1. /etc/profile → /etc/profile.d/*
  2. /etc/bashrc
  3. ~/bash_profile → ~/.bashrc(内部で /etc/bashrc を読む)

* .bash_profileは基本的にログインしたときだけ読み込まれます
* アカウントごとの設定は .bashrc に書いておきます

bash スクリプト

サイト内検索