Path Utils is a set of lightweight Bash scripts for managing your PATH environment variable in a convenient and safe way. It allows you to add directories to PATH, remove them, and list all current entries, highlighting duplicates and non-existent paths. The scripts support both Bash and Zsh shells.
.
├── install.sh # Automatic installer for local or remote usage
├── LICENSE # MIT License file
├── PKGBUILD # Arch Linux AUR build script
├── README.md # This documentation file
└── scripts # Directory containing executable scripts
├── pathadd
├── pathdel
└── pathls
yay -S path-utilswget -qO- https://raw.githubusercontent.com/Remenod/path-utils/master/install.sh | bashcurl -fsSL https://raw.githubusercontent.com/Remenod/path-utils/master/install.sh | bashTip: When using these scripts in your current shell session, you may want to
sourcethem first, especially if you want immediate effects on the currentPATH.
Add a directory to your PATH and append it to your .bashrc or .zshrc for persistence.
source pathadd <directory>- Resolves the full path using
realpath - Checks if the directory already exists in
PATH - Updates the current session and the appropriate shell config file (
.bashrcor.zshrc)
Remove a directory from your PATH and .bashrc/.zshrc.
source pathdel <directory>- Removes the entry from the current session
- Cleans the shell configuration file to remove persistent entries
List all directories currently in PATH, marking duplicates and non-existent directories.
pathls- Highlights duplicates in yellow
- Highlights missing directories in red
- Provides a clean overview of the current environment
- Simple, Bash-only scripts with no external dependencies
- Safe updates to
.bashrc/.zshrcand current sessionPATH - Detection of duplicates and invalid directories
- Supports Bash and Zsh shells
- Enhance cross-shell support for Fish and other shells
- Introduce a CLI interface for each script
This project is licensed under the MIT License.