Understanding Variables on the Linux Command-Line

preview_player
Показать описание
The Linux Crash Course series here on Learn Linux TV teaches you a valuable Linux-related skill in each and every video. You can watch most episodes in any order, and with over 60 entries in this series (and counting) there's no shortage of Linux Learning! In this episode, Jay will teach you all about shell variables.

*Free Bash Scripting Course!*

*Thanks to Akamai for sponsoring this video!*

*🎓 BRAND NEW UDEMY COURSES AVAILABLE!*
Check out my new courses on Udemy and take your learning even further!

*🐧 SUPPORT LINUX LEARNING!*
_Note: Royalties and/or commission is earned from each of the above links_

*⏰ TIME CODES*
00:00 - Intro
00:46 - Set up your own Linux server with Akamai! (Sponsor)
01:58 - Revisiting the echo command
02:45 - Creating a variable in Bash
03:11 - Printing the contents of a variable
08:54 - Understanding Environment Variables
12:19 - Capturing the output of a command into a variable
15:22 - Capturing the current date into a variable

*Full Courses from Learn Linux TV*

*🌐 LEARN LINUX TV ON THE WEB*

*⚠️ 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. Always make sure you have written permission before working with any infrastructure and that you are compliant with all company rules, change control procedures, and local laws.

#CloudComputing #DevOps #Linux
Рекомендации по теме
Комментарии
Автор

i am professional with 11 year experience but i still love your all videos and keep watching them daily the way you explain basics... just addicted for learning.

sidheart
Автор

Outstanding!
Thank you so much for your videos. I always learn something from you. I knew quite a bit about shell variables and even the env command. I've used the $(command) before, but more as a script-kiddie (copy/pasting what I've seen others doing online) and never knew that it opened up a sub-shell to run the command within the parentheses.
Please keep up the good work!

QHPRN
Автор

Great video. I watched it last month when it was new. It came back to me as I was moving a bunch of files and directories around. Typing out directory names can be tedious even with autocomplete. I used what I learned in this video to create variables of the directory paths. It instantly made things so much easier. I could not only copy things around faster, I could also move around to the directories I stored in variables faster.

Akaterial
Автор

Pretty cool how I was learning about Python variables and you dropped this. This is cool. I feel like I can really get things more organized.

Xenonandplutonium
Автор

Don't sweat the ALL CAPS. Many early computers (and in fact the first typewriter) used only all caps.
Using lowercase or mixed-case letters tends to complicate things.
Merry Christmas!

lorensims
Автор

It should be interesting to see how this subshell-capture trick will work with some output more sophisticated than "ls" and all that. If it can actually capture htop in any meaningful way it would be handy to grab it for log purposes. Dunno, but there is a lot to test.

zeppelinmexicano
Автор

Why do newlines disappear inside the variable at 13:30? That does not seem very consistent, imagine if other things you don't know (obviously not normal characters??) could also disappear.

bramfran
Автор

6:40 You should have ls'd a directory with something in it for this example.

Shocker
Автор

Is it OK to download say your bash course videos as a reference to use offline? If not where can I purchase a licence?

xw
Автор

If I want a variable to be available every time I open bash, is there a way to persist them?

pmpartners
Автор

Nice video, did not know about sub shell

tanuj
Автор

Why do we call Shell a "Shell". Is it because of the concept of "Sub-Shells"?

ujjawalsinha
Автор

Please help. Why does Linux need a command line and a shell. Windows stopped using DOS ages ago

ZubairKhan-vsfe
Автор

Sir add some videos with no-ip server setup

suhas_joshi
Автор

That path-variable had a / at the end. I therefore expected $mydir/hello.txt to have two / before the file name and throw an error because of the invalid path.
Seems like linux ignores unnecessary slashes - interesting curiosity.

palodoxaliqua