How to Set Path Variables

[Editing this post, as the topic becomes more clear]

Does anyone know how to set the path variables for a Mac OS?

Current folder structure:

  /
     /Applications
             /[a lot of applications]
            /Postgres.app
                       /Contents
                               /Versions
                                        /12
                                             /bin
                                                  /psql
   /Users
           /myName
                  /Applications
                        /[nothing, except a couple hidden files]

Right now, if I run the command psql, I am getting “command not found”
If I type the full path "/Applications/Postgres.app/Contents/Versions/12/bin/psql, it works. But typing this every time is not practical.

If I run “git” that command is available, or “code .”

Also, I installed “netlify-cli” globally with “npm install -g netlify-cli”, but when I run “netlify-cli”, I get “command not found” and I don’t know where to find it in my system

… So, something is working correctly with my paths, and something is not. I don’t know how to fix the problem, without messing up other paths.

Does anyone know how I could find out where “netlify-cli” got installed and fix my paths to “netlify-cli” and “psql” without messing up any other paths?

Thanks for any pointers!

To clarify, cd ~ does indeed take you to your user directory. To go to root, you’d use cd /.

The command

export PATH=/Applications/Postgres.app/Contents/Versions/12/bin

might be what you are looking for to set the path?

I’m not super familiar with Postqresql, unfortunately.

1 Like

Thanks for that tip. (I took out the part about postgresql, because it turns out it was a type-o. I mainly need to learn about paths and permissions).

1 Like

Found this: You can run npm list -g to see which global libraries are installed and where they’re located.