linux equivalent of PATH in Windows [SOLVED]

Quick to answer questions about finding your way around Linux Mint as a new user.
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions use the other forums in the support section.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
vogonpoet

linux equivalent of PATH in Windows [SOLVED]

Post by vogonpoet »

I have a script (.sh) that works and that I would like to run from any terminal in any directory. In Windows, i would add the directory the script is in to the PATH. What's the equivalent in linux mint?
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
piratesmack

Re: linux equivalent of PATH in Windows

Post by piratesmack »

It's actually also called PATH in Linux.

Edit ~/.bashrc and add something like:

Code: Select all

export PATH="$PATH:/home/steve/scripts/bin"
Replace '/home/steve/scripts/bin' with wherever the script is located.

You could also just copy the script into /usr/local/bin, which is already in PATH
unexistance

Re: linux equivalent of PATH in Windows

Post by unexistance »

Hi,

Try

Code: Select all

echo $PATH
Regards,
vogonpoet

Re: linux equivalent of PATH in Windows [SOLVED]

Post by vogonpoet »

you guys rock! Thanks! Worked like a champ - I moved the script to /user/local/bin and changed a path in the script so it was absolute and not relative.
Locked

Return to “Beginner Questions”