Skip to content

Remenod/path-utils

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Path Utils

Overview

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.

Project Structure

.
├── 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

Installation

AUR

yay -S path-utils

wget

wget -qO- https://raw.githubusercontent.com/Remenod/path-utils/master/install.sh | bash

curl

curl -fsSL https://raw.githubusercontent.com/Remenod/path-utils/master/install.sh | bash

Scripts

Tip: When using these scripts in your current shell session, you may want to source them first, especially if you want immediate effects on the current PATH.

pathadd

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 (.bashrc or .zshrc)

pathdel

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

pathls

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

Current Features

  • Simple, Bash-only scripts with no external dependencies
  • Safe updates to .bashrc/.zshrc and current session PATH
  • Detection of duplicates and invalid directories
  • Supports Bash and Zsh shells

Future Plans

  • Enhance cross-shell support for Fish and other shells
  • Introduce a CLI interface for each script

License

This project is licensed under the MIT License.

About

useful shell rc PATH managment tools

Resources

License

Stars

Watchers

Forks

Languages