What is $PATH on a Linux Shell? (The Linux Crash Course Series)

  Рет қаралды 31,987

Learn Linux TV

Learn Linux TV

Күн бұрын

Do you want to Learn Linux? The Linux Crash Course series contains video lessons on all kinds of Linux commands and concepts. In this episode, we'll take a look at the concept of $PATH in Linux. You'll learn what it is, why it's helpful, and also how to customize it.
Brand New Udemy Courses Available!
Check out my new courses on Udemy and take your learning even further!
• Ansible Course ➜ learnlinux.link/ansible
• Linux Essentials Course ➜ learnlinux.link/linux-essentials
Check out the Linux Shop
In the official shop, you'll find Shirts, hats, stickers, bags and more!
➜ merch.learnlinux.tv
5% discount on LPI exam vouchers
After you finish Jay's new course, get 5% off an LPI exam voucher here:
➜ learnlinux.link/lpi-voucher
Become a Patron
Show your support for Learn Linux TV on Patreon and get access to exclusive perks!
➜ learnlinux.link/patron
Become a Channel Member
Show your support for Learn Linux TV here on KZfaq and get access to exclusive perks!
➜ learnlinux.link/member
Mastering Ubuntu Server: 4th Edition
Jay's latest book covers everything you need to know in order to master Ubuntu Server. It's available here:
➜ ubuntuserverbook.com
Linux Gear and Kits
Check out Jay's choice of hardware products, audio/video equipment, and more.
➜ learnlinux.link/amazon
Grab an awesome Pi-powered KVM
Support Learn Linux TV and grab yourself a TinyPilot KVM here:
➜ learnlinux.link/tinypilot
Note: Royalties and/or commission is earned from each of the above links
Time Codes
00:00 - Intro
00:55 - Spin up your very own Linux server on Linode (sponsor)
02:53 - Looking at an alternate universe, where PATH was never invented
05:47 - What $PATH actually is, and why it's so useful to have
06:40 - Using a Bash script to further explain PATH
10:29 - Running a script or binary from outside of PATH
11:37 - Finding the path to a command or script
12:21 - Why is your home directory not within PATH by default?
13:23 - Adding a new directory to your PATH
17:48 - How to make changes to PATH survive closing your shell session
Full Courses from Learn Linux TV
• Linux Essentials Certification Workshop ➜ learnlinux.link/lpi-course
• Linux Crash Course series ➜ linux.video/cc
• Learn how to use tmux ➜ linux.video/tmux
• Learn how to use vim ➜ linux.video/vim
• Bash Scripting Series ➜ linux.video/bash
• Proxmox VE Cluster Full Course ➜ linux.video/pve
• Learn Ansible ➜ linux.video/ansible
Linux-related Podcasts
• Enterprise Linux Security ➜ enterpriselinuxsecurity.show
• The Homelab Show ➜ thehomelab.show
Learn Linux TV on the Web
• Main site ➜ www.learnlinux.tv
• Community ➜ community.learnlinux.tv
• Enterprise Linux Security Podcast ➜ enterpriselinuxsecurity.show
• The Homelab Show Podcast ➜ thehomelab.show
• Content Ethics ➜ www.learnlinux.tv/content-ethics
• Request Assistance ➜ www.learnlinux.tv/request-ass...
Disclaimer
Learn Linux TV provides technical content that will hopefully be helpful to you and teach you something new. However, this content is provided without any warranty (expressed or implied). Learn Linux TV is not responsible for any damages that may arise from any use of this content. The person viewing Learn Linux TV's content is expected to follow their best judgement and to make their best decisions while working with any related technology. Always make sure you have written permission before working with any infrastructure. Also, be sure that you're compliant with all company rules, change control procedures, and local laws.
#LearnLinux #linux_tutorial #linuxforbeginners

Пікірлер: 71
@Ranblv
@Ranblv Жыл бұрын
the actual list of directories of that variable is in /etc/environment if anyone is wondering. There you can set new shared path for all users not just you
@MatmarSpace
@MatmarSpace Ай бұрын
Wow! It's amazing how much I've learned from short little video. Big thanks!
@kajah2377
@kajah2377 Жыл бұрын
Great content as usual, and i really appreciate the redesign of the set. it’s perfect now! the silver wall stuff with the triangles was a little hard to look at, but the wood paneling and tech create a really pleasing harmony
@FinderX
@FinderX Жыл бұрын
/usr stand for "Universal System Resource", not User. There is a discussion of this is a deprecation of the /user and then later become /home. But be aware this is a tricky professor/teach test question.
@raymondfb
@raymondfb 6 ай бұрын
Awesome video Jay thank you for taking the time to make them. I can not even begin to tell you how much I have learned from you! Thanks again!
@portfedh
@portfedh Жыл бұрын
This type of content is very useful. Short and to the point. Thanks!
@kapurar
@kapurar Жыл бұрын
As always Jay, great video!
@h20andmore
@h20andmore 10 ай бұрын
NICE work! I like your style of being on point without chasing 10 possible ways. Calm and articulate enhances the ease to follow. Thank you.
@DevendraKumar-cr6to
@DevendraKumar-cr6to Жыл бұрын
Superb content Jay.
@srsr6099
@srsr6099 Жыл бұрын
Standalone videos really help get to our Linux goals, can't thank you enough for this Jay, I owe you a dinner.
@linuxlegion4312
@linuxlegion4312 10 ай бұрын
Thanks a lot Jay brilliant as usual.
@abdelaesus6678
@abdelaesus6678 11 ай бұрын
This video is so perfect! 🙏🔥
@DomMcD
@DomMcD 4 ай бұрын
Great video! Just what I needed.
@aba-nascu
@aba-nascu Жыл бұрын
Thank you, keep the awesome work!
@kawan5851
@kawan5851 2 ай бұрын
One challenge for many users is to remove some link from the PATH after adding it. Please make a video on that topic as well. thanks.
@DL-xf3ur
@DL-xf3ur Жыл бұрын
fabu as always Jay!
@whylde7834
@whylde7834 Жыл бұрын
Thanks Jay, clear and concise.
@ajsim
@ajsim Жыл бұрын
Thank you! Great video. Very helpful
@Jhonfreddy15
@Jhonfreddy15 Жыл бұрын
It did made it easy for me. Thank you so much!
@charlesklein7232
@charlesklein7232 Жыл бұрын
THANK YOU! i knew some of this threw my wanderings but i never understood it! its like magic, if you know the commands you can manipulate them with out understanding. but it nicer to understand and you can manipulate the event further and create things permanently.
@nicedev8189
@nicedev8189 Жыл бұрын
fantastic video thank you!
@simondj8572
@simondj8572 Жыл бұрын
Awesome, I wouldn't thought that this "." can be that "/", it reminids me of simplicity of things. Thanks a lot, your way of thinking is amazing.
@michaelalonge7679
@michaelalonge7679 5 ай бұрын
Great content..thanks so much
@snamone
@snamone 7 ай бұрын
Thank you very much that video was excellent! You really have a talent for making all things Linux easy to understand and you put a great deal of effort into creating your content.
@LearnLinuxTV
@LearnLinuxTV 7 ай бұрын
Glad it helped!
@yelp9359
@yelp9359 9 ай бұрын
Greate content. Thanks for help and lots of appreciation.
@GrindAlchemyTech
@GrindAlchemyTech 10 ай бұрын
Thank this was helpful
@Rebel101
@Rebel101 Жыл бұрын
Awesome!!!
@AdilProgramming
@AdilProgramming 2 ай бұрын
Great Video
@PS_Tube
@PS_Tube Жыл бұрын
This is interesting video. Full of information.
@ysf9423
@ysf9423 Жыл бұрын
thank you very much! i subscribed to your channel
@narayangurung7090
@narayangurung7090 6 ай бұрын
clean and clear than u so much🎉
@r.u.sirius7423
@r.u.sirius7423 2 ай бұрын
Thanks!
@flipinfin
@flipinfin Жыл бұрын
Great video very educational and easy to understand. My question is where's the best place to install programs?
@alxt111
@alxt111 Жыл бұрын
Hi Jay, thanks for the great video. I really appreciate your videos. Do you plan on making a video about terminal colors? Currently I'm trying to wrap my head around all this $TERM, xterm-256color, true color, terminfo database, tic, escape sequence stuff and it's very confusing. Especially when you want all of this to work with ssh and tmux. I think that a lot of people would be interested in such a video.
@sukh_bajwa
@sukh_bajwa Жыл бұрын
Thanks Jay! Could you please come up with another video explaining how to add global variable PATH using /etc/environment and /etc/profile files detailing dis/advantages of each?
@lucdrouin2625
@lucdrouin2625 Жыл бұрын
Your detailed explanations are very instructive. Could you please publish two seperate videos on : file / directory date manipulation and attrib command 'all features'. Thank You.
@eleven2435
@eleven2435 Жыл бұрын
Pretty good, thank You! Was that laptop the System76/HP combo next to You?
@cryptotechcoder
@cryptotechcoder 10 ай бұрын
Nice but at the end of the if statement... because the then was on a new line was that the reason the semicolon was omitted?
@peterjansen4826
@peterjansen4826 Жыл бұрын
I have outgrown this tutorial-series but it is great for newcomers to Linux to have this handed on a silver plate. I will definitely refer new Linux-users to this series.
@TheStevenWhiting
@TheStevenWhiting Жыл бұрын
Have you done a series on BASH scripting? Would quite like one of those. Have no experience with it there are some commands written in terminal that I do over and over, one after the other and would quite like a way to BASH script it.
@vanadium4167
@vanadium4167 Жыл бұрын
Do not change your PATH in .bashrc. Instead, change it in .profile or .bash_profile (depending on your distribution). That way, it is defined as soon as you log in. You then can also run your commands e.g. from a run prompt (Alt+F2) or from a shortcut key without having to define the full path.
@helloimatapir
@helloimatapir Жыл бұрын
Good advice. Use .zprofile for ZSH.
@helloimatapir
@helloimatapir Жыл бұрын
@iowahank Yeah that's pretty common for big distros like Ubuntu that use bash. If you use something like Arch, you usually have to edit the PATH yourself.
@RoughGanome
@RoughGanome Жыл бұрын
Great content and great video. However, you forgot the ";" in your new if statement.
@AABBULLAH511
@AABBULLAH511 Жыл бұрын
Thankkkkkk youuuuuuuuuu
@canahmetbe
@canahmetbe Жыл бұрын
Thanks
@gkaruk
@gkaruk Жыл бұрын
As always a great clear bitesize video. Recently we had a challenge of trying to understand where to put our persistent PATH setting and got multiple answer which I hopped this might clarify, but sadly not deep enough video and thus I ask in hope of deep one maybe next :) If I want to set the PATH to include a new path location there appears to be any number of different files/profiles/bashrc to use but I cant find any decent guide on which file to use when? Do you have any recommende dlinks to read up on please? Use case is login as UserA ensure has PATH including /usr/local/bin but which bash profile do/should you edit to ensure? ~/.bashrc ~/profile /etc/profile and others I am seeing makes for confusion? Futher more I also ned to ensure the PATH /usr/local/bin exists for ROOT when I sudo - , again which profile file should i edit to ensure ?
@frederickteye
@frederickteye 18 күн бұрын
You are the boss
@MRMOTOFOTO
@MRMOTOFOTO 11 ай бұрын
Thanks!!! I finally get it. Lol
@marcin2x4
@marcin2x4 Жыл бұрын
So to run the `mycmd` script without locating in `bin` we could also run `bash mycmd`, correct?
@giuliogemino6407
@giuliogemino6407 Жыл бұрын
Do you have any clue about how to connect a Garmin GPS device and run garmin express to update the device in a Linux Mint 20.3 MATE OS without considering Windows dual boot and windows stuffs in wine or openbox virtual machine? Is there any other way perhaps using the CLI to update the device?
@nasirmehdimalik8940
@nasirmehdimalik8940 Жыл бұрын
Great
@TheClembo
@TheClembo Жыл бұрын
Jay:?????, recently started using POP-OS as my daily driver but noticed cannot down arrow in nano anymore?? Cursor goes left and right and up OK but not down, and yes down arrow works ok every where else!! Having to use 'gedit' to change my, for example, 'bashrc' file. Any thoughts? NB, I've always created my bin directory in home and then logged out and back in to get it into my PATH automatically. Good video and well explained. ATB
@krisbrightspirals
@krisbrightspirals Жыл бұрын
The "secret" to the other path is within the breath :)
@jordantube1000
@jordantube1000 Жыл бұрын
Question: does bash check the path variables in the order they are listed in $PATH? So if you had two programs with the exact same name, but in different Path locations, which would it run?
@shallex5744
@shallex5744 Жыл бұрын
yes it follows each directory in order
@thorstenroller5280
@thorstenroller5280 Жыл бұрын
Hey, new Linux user here, First of all, great video very informative and conceise but unfortunately I encountered a situation which you didn't touch on... The issue is that I Ve installed a game (fheroes2) which came in a tar.gz which I unpacked in home/games...after installing the dependencies it ran fine so I wanted to be able to run it from the terminal...so I added the dir to Path and it launched but with an error saying it can't find some necessary files...didn't take me long to figure out that subdirs are not added to PATH therefore the game doesn't find them and throws the error...I checked online and apparently there is some terminal magic to add dirs and their subdirs recursively but it is not recommended to do that... Sooo...how do I make the game launchable with just one command from the terminal the right way
@zameerpashablr
@zameerpashablr Жыл бұрын
God bless you for this wonderful learning. You're one of the best hearted Persons and explain each and every aspect. Learning a lot from your videos.
@jwspock1690
@jwspock1690 Жыл бұрын
cool
@nisarpatel6665
@nisarpatel6665 Жыл бұрын
Make video on copy data from linux server to Gdrive
@Im.Tabachnik
@Im.Tabachnik Жыл бұрын
L love 💕 the PATH you are tech
@gallardojose1
@gallardojose1 Жыл бұрын
Path to enlightenment: We observe two parts of the universe interacting with each other, yourself and everything else. Pay attention to them both, decide what you want to do for one or the other. Do your best. Whether it gets done or not is up to the universe as a whole. So long as you know in your heart that you tried, you’ll have done everything you can. You can rest easy knowing you fulfilled your purpose.
@johnwestervelt1525
@johnwestervelt1525 Жыл бұрын
If you move the Buddha from the corner hidden behind everything to the forefront as he used to be.... might help with that path to enlightenment... 😉
@patientson
@patientson Жыл бұрын
This $path and the one of enlightenment are similar in that they require some conscious to pseudo-move to increase the tactile senses in any living creature. I call it 25. Many only rely and replenish 5 but leave 2 alone till its too late.
@stephenrochester6309
@stephenrochester6309 Жыл бұрын
I rub 5 all over myself and 2 is saved for when I am feeling extra spicy.
@mathieuleclerc4136
@mathieuleclerc4136 Жыл бұрын
I guess its where you earn how to get money typing codes, right?...
@TheMightyWalk
@TheMightyWalk 10 ай бұрын
finally i understand path after 7 useless videos lol
@foss_sound
@foss_sound Жыл бұрын
I really enjoy watching your videos. These should be there years ago for me! ;) You may consider doing "KZfaq Shorts" for every command to reach even more potential users. Keep on making great videos.
10 Linux Terminal Tips and Tricks to Enhance Your Workflow
44:16
Learn Linux TV
Рет қаралды 92 М.
Create a New Virtual Hard Disk & Partition
4:45
Joshua Deason
Рет қаралды 5
ИРИНА КАЙРАТОВНА - АЙДАХАР (БЕКА) [MV]
02:51
ГОСТ ENTERTAINMENT
Рет қаралды 15 МЛН
He sees meat everywhere 😄🥩
00:11
AngLova
Рет қаралды 11 МЛН
Looks realistic #tiktok
00:22
Анастасия Тарасова
Рет қаралды 88 МЛН
ROCK PAPER SCISSOR! (55 MLN SUBS!) feat @PANDAGIRLOFFICIAL #shorts
00:31
100+ Linux Things you Need to Know
12:23
Fireship
Рет қаралды 691 М.
Linux Crash Course - Understanding Logging
29:10
Learn Linux TV
Рет қаралды 45 М.
Become a shell wizard in ~12 mins
12:25
CODE IS EVERYTHING
Рет қаралды 228 М.
Learning Awk Is Essential For Linux Users
20:02
DistroTube
Рет қаралды 288 М.
Linux Crash Course - The /etc/fstab file
30:29
Learn Linux TV
Рет қаралды 100 М.
Linux Command-Line Tips & Tricks: Over 15 Examples!
31:37
Learn Linux TV
Рет қаралды 213 М.
Linux Crash Course Series - How to Share Files via SSHFS
20:00
Learn Linux TV
Рет қаралды 26 М.
Самый дорогой кабель Apple
0:37
Romancev768
Рет қаралды 322 М.
Mastering Picture Editing: Zoom Tools Tutorial
0:52
Photoo Edit
Рет қаралды 503 М.
Первый обзор Galaxy Z Fold 6
12:23
Rozetked
Рет қаралды 141 М.
Tag her 🤭💞 #miniphone #smartphone #iphone #samsung #fyp
0:11
Pockify™
Рет қаралды 29 МЛН
Урна с айфонами!
0:30
По ту сторону Гугла
Рет қаралды 8 МЛН