• 0 Posts
  • 20 Comments
Joined 1 year ago
cake
Cake day: June 17th, 2023

help-circle


  • Explaining like you are 5:

    If you have worked with programming languages, you might have come across global variables and inbuilt functions/keywords. PATH is a similar global variable for your terminal session.

    Every time you open up a terminal, you load up these “global variables”, and you/programs can access them (or the applications assigned to them).

    So, let’s say you have your application (executable) as /home/werecat/corncob/bin/corn, instead of starting it with ./home/werecat/corncob/bin/corn ..., if you have /home/werecat/corncob/bin in your PATH variable, you can just use it as corn ....

    export PATH="/home/werecat/corncob/bin:$PATH"
    

    just means:

    1. PATH = /home/werecat/corncob/bin + PATH
    2. persist (export) path for the duration of this session (usually until you close the terminal tab)

    If you see somewhere to add it to your /home/werecat/.bashrc file, it means “all commands in .bashrc file are auto-executed every time you start a new terminal session, so if you have it there, you won’t need to manually keep entering the command over and over again”.

    You can list these environment variables by just running:

    env
    

    Also, recommend you have a look at https://www.freecodecamp.org/news/how-to-set-an-environment-variable-in-linux/.

    Hope this helps. Good luck on your Linux journey.






  • For a person with not much familiarity with Linux, and just wants to check things out, I would recommend starting out with a VM. WSL is good, but that is not the “Linux experience”. Moreover, if they are not already familiar with the command line, it may be a bit intimidating. The same goes for dual booting. It’s more technical, and it’s more appealing to just jump back into Windows when things go wrong on Linux. VM approach though, gives you a sandboxed space (with DEs and all) where you can smoothly get familiar and comfortable with Linux before making the final switch. That’s my personal opinion for beginners.