in

Linux add to $PATH: Fix “command not found” error (Linux & Mac)



Linux add to path. Understand the “Command Not Found” error.

0:20 – What the $PATH environment variable does
1:18 – Example of using Linux $PATH
1:50 – Command not found error
2:14 – Running command from directory
3:03 – Updating your $PATH variable
4:00 – Append new folder to path
5:15 – Prepend new folder to beginning of path

One of the most important things to understand when installing programs and using your terminal is to know how the $PATH environment variable works on Linux, Mac, and even Windows systems.

In this video we’ll show you how to work with your $PATH. In short, the $PATH variable lists all the directories that the computer will look through to try to find a command you’ve entered in the terminal. If you run a command, and it’s not found in any of the folders in your $PATH, then it will throw an error “command not found”.

You have several options.

1. Call the command by specifying the location of the executable file.

2. Move the executable file to a folder that’s already in your $PATH

3. ADD the proper directory to the $PATH.

============ More Info ============

Visit Our Website: https://truthseekers.io

Follow us on FaceBook: https://www.facebook.com/truthseekers.io/

========================

Share this:

35 Comments

  1. I know this video is really old but its worth a shot. so I am trying to use the show command for "show vlan" I installed nmh verified it is in /usr/bin/mh and I just tried to move it to /usr/bin with no luck. I've tried ./show, sudo ./show, cd into the dir and no matter what I try it either tells me command not found or not installed. has anyone delt with this before and found out how to get it working? if I use whereis command it shows my archive file and if i "ls /usr/bin/mh" it shows that "show" is actually installed and highlighted green. so I am not sure what else I can do at this point…
    EDIT: I'm running Ubunto 20.04 LTS (freshly installed)

  2. Thank you so much brother , being trying to install brew on ubuntu and all the forms I checked in the past two hours kept bsing abt why it wasnt working. You went straight to the point why it isnt working ; how to make such an issue work and thats it.

  3. Thank You Brother…finally someone that explains how it works, why it wasn't working, and what you need to do to fix it…with clear examples step by step, that are easy to read, watch, and understand and follow along.. I'm building a server, with 30tb of raid for storage, for my home and kids.I am turning a pair of docking stations and a server that came with 2 complete on site Professional Studio Editing Stations from the movie Life Of Pi and the Linux, Red Hat Nash, Fedora core 6 Kneel before Zod, and first edition Mint are all from 2005 and a lot of what I have been finding is new commands were not working. i needed the older yum instead of rpm stuff..lol and I am a 53 year old custom bike builder who is about 35+ years away from any kind of computer programing… so nice and slow works great for me..do you have anything on temporary failure on name resolution??

  4. I'm stuck on a beginner problem of using git please a little Help is really appreciated I'm stuck on this for many days😟. So Whenever I create a new folder (For ex: repo) and on doing pwd (i.e., repo pwd ) even on changing directory (i.e., cd repo) it still always shows "command not found"
    please help……!!🙏

  5. hi! i know this is a stupid question, but when you were creating the file, how did you get down to "–insert–"? I just started today and seriously can't figure it out. The rest of the video is extremely helpful though, thank you!

  6. What’s that website you mentioned at the end? I couldn’t get it , can you please write it if you get the chance? Thanks a lot . Good stuff

  7. Damn man you are something else i have been looking for solutions about this path issues and fuck in 3 minutes i understood the whole idea of it. Thanks a lot !!!!

  8. thank you. i spent a lot of time to learn the vi command. finally i got it. there are other methods like "gedit" command to edit the text file, then export it. what's the difference between them?