Last active
November 26, 2022 02:56
-
-
Save rot26/ed2c36ce0f810a5ec24359a550c0bace to your computer and use it in GitHub Desktop.
[.bashrc.d] Use bashrc directory instead of bashrc #bash #bashrc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Add this to your ~/.bashrc file | |
# Use .bashrc.d directory instead of bloated .bashrc file | |
# From: https://waxzce.medium.com/use-bashrc-d-directory-instead-of-bloated-bashrc-50204d5389ff | |
BASHRC_DIR="${HOME}/.bashrc.d" | |
# Optionally create directory if not exists | |
if [ ! -d "${BASHRC_DIR}" ]; then | |
mkdir -p "${BASHRC_DIR}"; | |
chmod 700 "${BASHRC_DIR}"; | |
fi | |
# Load any *.bashrc files in ~/.bashrc.d/ | |
if [ -d "${BASHRC_DIR}" ]; then | |
for file in ${BASHRC_DIR}/*.bashrc; do | |
source "${file}"; | |
done | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment