 Hey everybody welcome back to the channel today. We're going to look at something fairly simple now Every Linux distribution comes with a shell and when we talk about a shower It's usually talking about your when you're in the terminal Here we're talking about this thing. This is basically your shots a little bit more complicated than that But we'll just talk about you know leave it some simple simple like that Most Linux distributions all but like one or two. I think actually Come with bash is their shell. So yours probably looks like this You won't have the Neofetched there, but it will probably look like something like that. That's your your prompt or your bash shell I use Zsh and mine looks like this now. I've themed it a little bit. It's just you know for simplicity minimalism sake or whatever But really no matter what? What? Shell you're using there's a cool function called aliasing. So basically when you type in say you want to Get into your Document editor whether you use them or new them or Nana or whatever chances are you'd have to type in something like this and Then you know, I'm going to make a fig for my poly bar. I'd had to type in all of that and It can be kind of a pain or you could you might have to type in Same thing if you want to do you I can do your I3 config And you'd have to do that and see but if you use an alias Like I've set up an alias for my I3 config and it just looks like this I just type in I3 con and I get into the same thing. That's what an alias basically does it's a It's a shortcut of sorts from That leads you to a full-fledged argument or a command so The question is how do you set up an alias? It sounds really cool, right? So in order to do that you'd want to go into either your bash RC file which will probably look like this or You want to if you're using ZSH you want to go into your ZSH RC file Dot ZSH RC file and it will look like this Now as you can see I've It's gonna depending on what distribution you are and what where you started off at You know It will look a little bit different But basically what the ZSH RC does is it provides the base level arguments for what your shell? Looks like what your prompt looks like and so far so forth and so so on And as you can see I have a whole bunch of aliases here That I've set up that allow me to save time not having to type in things so specifically Like I have this update one here So I type in update and really what that's telling DSH to do is really to run this command here pseudopacman dash YYU and and yay and so on so far that basically just updates my system completely without me having to do anything other than enter my You know root password This one here cleans up Abandoned profiles This one here gets me into my vmrc or my nano neo vmrc this one The one I really like this is my favorite alias of all time I just type in v instead of having to do nvim and That gets me into neo vm without having to type in the whole thing every time Now as you can see these are really easy to set up I Mean just really easy set up so what I'm going to do today is just show you how to Set up an alias real quickly so What I want to do is type in alias and then the Next argument you want to pass in is what you want your alias to be so basically the euphemism For lack of a better word of what your argument is going to be your your shortcut term And I'm going to create one for my poly bar, which I do because I don't have that yet So I'm just going to call this poly and then equals quotation marks and then this is going to be nvim Doc I think I have to get doc config slash poly bar Slash config and that's it now We save that and We quit out of your terminal so you have to start up a new session of zsh It's just easier to quit the terminal and start over again if we type in poly Takes us to the poly bar or config and it's really as simple as that so Type in my zsh alias And that takes me to my zsh RC and we'll do it one more time alias now I found a A Program the other day that allows me to Practice typing in the terminal. It's called WPM and it looks like this, but it has some arguments And And it allows me to you know pass in a stats file. So The argument would be like that. I don't really want to type that in every time. So what I'm going to do is copy this and then Go in my zsh file. Oops. I've already got that open and and type in alias and Then type in WPM Equals and then that thing I just copied Apparently didn't copy that's okay oops See if it's there it is there there, okay and Then that'll allow me to use what WPM with this flag instead of having to type that in every time. So we Write this and we do WPM and that gives us Gets us into the program, but Using that stats file so it keeps track of you know how fast I type Which I'm not going to show you how I do because I suck at typing fast with an audience Anyways, that is alias now. There's another thing real quickly Let's see if I can show you this. I'm not sure if I have one set up. These things are called functions Okay, and these a function is a little bit different Basically what a function allows you to do is you could theoretically write yourself a little bash script or zsh script that would Work similar to how an alias work. So this one here Sets my wallpaper. Now this leads to another script But alternatively you could create a function called oops damn Hit the page up button Function and then squirrely black squirrely brackets and then Could you I See a good a good example of this like I'm trying to think of a good example Yeah, you could do Like this YouTube dash and then pass in arguments if I can type and Then that would allow you to go through and type in If you do this just call this yt a we'll call it yta because I've already already have yta d Gotta put a space in there and then that what that should do is Go through and run this with whatever argument comes out for this. So we'll see if that works I'm not actually sure if it will work again. You had to quit out of that session of zsh. So if we just type in yta But did we just do yt I thought we did yta. No, we just did yt. Okay, so we do yt and then pass it a Song or something. I don't know. Um, just let's say we wanted to download this video here. We just Copy the link location Go back here copy that and then type that Maybe I did this wrong maybe I got the YouTube BL I'm I'm a dumbass So we do this, you know the right way, you know That's better Now if we do yt and then this Yeah, I might have passed the wrong error and anyways Obviously, I'm not using it YouTube down DL, you know correctly But you could put it put in any argument there you want and that's a function. What's different is that You functions are more for Scripts and things that you want to have a flow to them so you could put multiple arguments if you wanted to or even lead directly to a script whereas an aliases for a Specific bash or ZSH command and that's really is they're very very useful. I have like I said, I have a ton of them set up I Have the these here for word sprints for when I write C is for clear cuz I mean everybody knows that you can Press control L to clear, but it's much easier to Put just press clear or the letter C and that works for me It's basically about saving time. So anyways, that is alias and just a brief look at a function that actually didn't work mainly because I think I'm pretty sure I Did not use these flags correctly. I can't remember. I don't use YouTube YouTube BL very often So I'm sure I probably did that move just go ahead and delete that Anyways, if you liked this video hit the thumbs up button if you didn't care for it. Give it a thumbs down I don't particularly care what you do I just you know would prefer you do something if you really liked it give us a subscribe and we'll see you next time Thanks for watching