this post was submitted on 04 Oct 2024
14 points (100.0% liked)
Linux
48180 readers
1187 users here now
From Wikipedia, the free encyclopedia
Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).
Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.
Rules
- Posts must be relevant to operating systems running the Linux kernel. GNU/Linux or otherwise.
- No misinformation
- No NSFW content
- No hate speech, bigotry, etc
Related Communities
Community icon by Alpár-Etele Méder, licensed under CC BY 3.0
founded 5 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
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 yourPATH
variable, you can just use it ascorn ...
.just means:
PATH = /home/werecat/corncob/bin + PATH
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:
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.
Thanks. That's a good ELI5. Fortunately I managed to make sense of it before your reply but the link to environment variables is highly appreciated. As I already replied to someone else, I had no idea PATH was a global/environment variable and just assumed it's telling me to specify path so I had no idea I need to RTFM as it confused me greatly and on top of that I did another mistake which confused me even more when I finally managed to get it to do correctly which made me think I am doing it wrong.
I gave up at CMAKE finally as I really need to RTFM more on that as it started to throw many errors at me.