Check out a free preview of the full Full Stack for Front-End Engineers, v3 course

The "Shell Exercise" Lesson is part of the full, Full Stack for Front-End Engineers, v3 course featured in this preview video. Here's what you'd learn in this lesson:

Jem discusses the application running in the terminal, the shell. Students are then instructed to open the shell config and add a line to make the shell tell you "good morning."


Transcript from the "Shell Exercise" Lesson

>> So next let's talk about your shell. The shell is the actual application running in terminal, the terminal's kind of the thing, the actual application within your operating system that you're running, but a shell interprets all those commands and converts them into something that the OS can understand.

OS X, these days if using a modern MacBook uses the zsh, which is a more extensible version of bash. It's generally the preferred way of doing things now, but bash is the default. bash, you'll find on every Unix-based operating system from here to whatever. It's a tongue in cheek.

It's called the Bourne again shell. I looked this up and I was like, who is this boring person? It certainly didn't deal with Jason Bourne. Now, it's just a funny name, I don't think it's named after anybody. All right, that's just a bit of fun trivia, but bash is the default, zsh is considered bash, they're fairly interchangeable with some minor differences.

But zsh is the one you're using today if you're using a modern MacBook, you might be using bash, that's okay. None of the commands we're gonna use today changed. If you're wondering what your current shell is, say, echo $, echo $ just shows you your current shell. You can also say echo $shell.

That's one of the reserved words, kind of like user. echo $user will tell you your username. There's a whole list of these. We won't go into them cuz they're not super critical. But just fun shortcuts, if you're like, what am I actually using? And if you modify your shell configuration any way, source, that shell config will reload your terminal with the new configuration.

So source ~/.bash_profile will reload your bash configuration. This is important cuz you'll modify and you'll be like, why is nothing working? You have to reload your shell. All right, so for this next exercise, open your shell configuration, add a line that says, make your shell tell you good morning.

So now it gets a little more complicated because I'm not being explicit. I want you to start getting some of these into your memory. So how do we get to the terminal to say anything back to us? Does anybody remember what that command was?
>> Echo.
>> Echo, yes.

So you're gonna say echo, whatever you want it to say. If you wanna get fancy, you can use that $user. Go ahead and play around with your shelter fig a little bit, and you'll see kind of the built-ins that are there.

Learn Straight from the Experts Who Shape the Modern Web

  • In-depth Courses
  • Industry Leading Experts
  • Learning Paths
  • Live Interactive Workshops
Get Unlimited Access Now