How to add a directory to your PATH on Linux.

Shell variables (also called environment variables) are placeholders for information and Bash maintains a suite of these to keep track of various settings. Have a look at what shell variables Bash knows about by typing the following: ┌──(john㉿DESKTOP-PF01IEE)-[/mnt/c/Users/Intel i5/Videos] └─$ env | grep PATH PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/lib/wsl/lib:/mnt/c/Windows/system32:/mnt/c/Windows:/mnt/c/Windows/System32/Wbem:/mnt/c/Windows/System32/WindowsPowerShell/v1.0/:/mnt/c/Windows/System32/OpenSSH/:/mnt/c/Program Files (x86)/NVIDIA Corporation/PhysX/Common:/mnt/c/Program Files/NVIDIA Corporation/NVIDIA NvDLISR:/mnt/c/Program Files (x86)/Bitvise SSH Client:/mnt/c/Users/Intel … Read more

Very useful Linux shell tips and tricks.

Add a new directory to the PATH to allow running an application from it without typing the full path every time you wish to run it. PATH=$PATH:/usr/local/binPATH=$PATH:/usr/local/bin Or you may have something like this in your .bashrc to add this every time you log in. PATH="/home/jason/perl5/bin${PATH:+:${PATH}}"; export PATH;PATH="/home/jason/perl5/bin${PATH:+:${PATH}}"; export PATH; This can also be set … Read more