Edit your bashrc to add, reorder or fix the PATH so personal tools run without typing full paths. 16.11.2025 | reading time: 2 min Want your scripts and local tools to run from any directory? Modify `~/.bashrc` to change the user PATH so that custom bin directories are found first or last, and test the change immediately. A concrete edit and test Make a backup, add a local bin path, reload and verify the result with these commands: ```bash cp ~/.bashrc ~/.bashrc.backup cat >> ~/.bashrc <<'EOF' # Add user's local bin export PATH="$HOME/bin:$PATH" EOF source ~/.bashrc echo "$PATH" ``` Prepend, append, and avoid duplicates Decide whether to prepend or append: prepend with `export PATH="$HOME/bin:$PATH"` so personal tools shadow system ones, append with `export PATH="$PATH:$HOME/bin"` to prefer system binaries; remove duplicates by checking `echo $PATH | tr ':' '\n' | uniq` and refresh shell lookup with `hash -r` or test executables with `command -v <name>`. Where PATH changes actually apply Interactive and login shells read different files: `~/.bashrc` is for interactive non-login shells, `~/.profile` or `~/.bash_profile` for login shells, and system-wide settings live in `/etc/profile` and `/etc/environment`; edit the correct file for the session type you want to affect. Quick safety checklist Never put an unquoted dot or an empty entry at the front of PATH, avoid hardcoding absolute paths that may move, prefer `$HOME/bin` and test with `which` or `command -v` before committing changes to dotfiles. Next steps for real mastery Now that you know how to change PATH in `~/.bashrc`, practice by creating a small `~/bin` script, adding it to PATH and running it from several directories; deepen system knowledge and consider certifying skills with CompTIA Linux+ or LPIC-1 at bitsandbytes.academy for focused exam preparation. Join Bits & Bytes Academy First class LINUX exam preparation. setup scripting security