 All right, so I get a lot of questions about what kind of stuff I actually have in my bash RC You can get my bash RC of course at my github links in the description or link to my website Which has a link to it or something like that But in this video, I'm going to talk about what kind of stuff I have in my bash RC what kind of stuff I might recommend for newer users to have in there and Just other stuff about it. I will say over time Some people you will see on the internet will have bash RCs that are like a thousand lines long Mine is 61 right now, and I was looking at this just a second ago And there's probably a lot more I could clear out of this thing But I so I have the mentality of keeping it very relatively short But I'll tell you what I have in addition to the bash RC, which I'll talk about in just one second I guess it's also important to talk about your bash profile So if you don't know if you're total newbie, right? So the bash RC is a list of commands and settings that are going to run every time you open the terminal your bash You're a bash terminal or something like that or a terminal running bash However, you want to think of it and the bash profile is basically what's going to run whenever you log in and bash is your default shell Now one thing about profiles. I will say I mentioned it because it's been a problem for me So this is you can have a bash profile bash underscore profile You can have a just normal dot profile Which runs whenever you log in on a TTY and you don't have a bash profile Or if you just have SA any kind of other shell or something like that you have Z profile for Z S8 you have X profile if you log in In a graphical environment and I find that that all gets very confusing So if you're like me and you often switch between Login types or shells or something like that. I find it very helpful to do the following and that is I Really only have one profile file and then I have my bash profile X profile Z profile They all are just shortcuts. They all all are links that go to this one profile file So that's just one thing that I want to this has caused me problems since other people use my dot file So I just want to say that's what I do. So anyway, you're looking at my profile file here What do I have here? I have a lot of environmental settings set my editor set my terminal browser A lot of these are specific to my own dot files I have like I set my bibliography file as an example Just because there are a lot of times I'm running commands and I want to output stuff to my bibliography file And that is this is like my LaTeX bibliography file where I have like everything all the sources that I cite And I want to output stuff to this file, but it's too hard to write out the whole location So I just use a kind of environmental variable, you know, whatever so I have stuff like that I add my scripts folder to my path if you're a newbie, right? So your path or your path variable is a list of all the directories like From which you can run commands without Giving the whole location, right? So if I run RM, I can run RM from wherever even though It happens that RM is specifically in user bin So by adding a directory to your path directory, you don't have to write out the full location of the Command or script or whatever That's just the basic note if you don't know some people don't I get a lot of questions about it So might as well mention it. So other things I have here In my pro again, this is the profile. This is only going to run when I log in This just says if I log in on the first TTY and I'm not running I3 already Start the graphical environment just because I don't have to type start start X myself because I pretty much always want the graphical environment if that doesn't run or whatever and the profile continues, I also if I'm I'll be in the TTY remind you. I also want Since I'm a Vim user. I want to have Caps Lock remapped as escape. So escape is very accessible so I can get back the normal mode very easily So I actually have it load Let me just show you what this looks like. I have this little I have this little file here TTY maps that lists out Keycodes that I want to remap in the TTY So I just have it switch and basically just this just says switch caps and escape so if So whenever I'm in the TTY whenever I press caps lock it actually Performs as an escape. So I like having that setting for Vim and then I also Load the wall color scheme in my TTY. So that way even if I log in in the TTY I'm gonna have this kind of color scheme that's easier on the eyes At least easier than the default as far as I'm concerned. So that's what I have in my profile Let's actually talk about the bash RC. So again, this is gonna run on log in and bash RC is gonna run pretty much whenever you bring up a Any kind of bash or terminal running bash So basic settings I have here one thing I found You may have noticed this with a lot of terminals that is if you type control s that actually pauses your terminal and you can Well, I might as well No point in showing you what that looks like you just it pauses the terminal It ceases all inputs and you can type whatever and nothing's gonna happen until you press control q And then it's gonna input all those characters that you you put in now this feature is I mean It's it's standard in terminals, but I don't like having it just because You know a lot of times I'll accidentally press control s or something or maybe you might want to remap control s To save in Vim or something like that. I Find this so this command just disables control asking and control q. That's all that's for I mean it technically does other stuff But in practice, that's what it does Another thing I have that a lot of people like everyone said I'll hear someone who who likes ZSH Be like oh ZSH is so great You can just type the directory name and it automatically CDs to it I don't know why people say that because you can do that and bash by just putting in this setting So if I want a CD to my articles directory, I can just type in articles now. I'm there great So that's that and I also have my history size my bash history. I have it infinite. I Why not I figured I've been doing this for a couple months now and I find it pretty useful so basically all of the commands you log are gonna be in bash history anyway and This just keeps it from deleting old commands now. I've been using it for a couple months like this And I want to say it's around How much is it? Well, who cares? It's like around 60 kb or something like that It's so hasn't gotten too big. It's not gonna get into mechs and mechs and mechs I figure I'm gonna reformat my computer before that happens, but it doesn't matter I got a big hard drive anyway But yeah, so that that's something you might want to contemplate and something I don't have in my bash RC But I've thought about doing is you can also put time codes for all your commands in your bash history So if you're running a server or something that might be really useful if something goes wrong You want to check what kind of commands you've run in the past? Now one other other thing here, so this is a bunch of lines here. This sets my my prompt Here so it looks it has this particular color scheme and look appearance, but also What this if statement does? Okay, so one thing I should probably explain one thing that I do is If you go to your Etsy Etsy slash password file you can Change the home directory of different users and one crazy thing that I've done. I don't think this is I don't recommend this is safe It's never it's never bit me in the behind But one thing that I've been doing is I've been using my root user I've given it the home directory of my main user So whenever I run as my root user It actually uses the dot files of my main user and that solves that clears up a bunch of headache in My workflow, I'll just say that I don't know if it's a hundred percent safe I don't know if I recommend doing it, but the reason I have this if statement here is if I switch to the root user What this if statement does is basically just makes the prompt capital and that's just so I know so it's Visually obvious if I'm running something as a root user, so I don't run any commands that I think are questionable That's just what that does and again this only matters if you have I mean if you just want my prompt You can just steal this part right here and throw it in your bash RC But I just want to have the prompt different for the root user and that that's why I do it, you know Anyway some basic aliases and stuff so one thing on aliases Or you know aliases if you don't know they're just shortcuts for commands if you're a new user, right? So I have to type pseudo Pac-Man a whole lot because I'm often using Pac-Man for stuff And I just abbreviate that as P so whenever if I want to upgrade or something like that I can just do P and then give it the options now one thing if you're a new user and This applies of course the Arch Linux running Pac-Man or maybe Ubuntu or Debbie and running app get or something like that If you're a new user, here's what a lot of new users will do okay. Let me let me just show show you alright Let's say you're running Ubuntu Okay, so pseudo apt get install I know that's the the the command for install a program So I'm gonna give an alias for it that is install or something like that or oh upgrade is you know I want to pseudo app get blah blah blah and What is it upgrade or whatever? So the tendency of a lot of new users is to make aliases for very specific Commands or subcommands specifically because this is apt get and then a sub command or however you want to think of it A lot of users will be tempted to make aliases for very specific commands And I sort of recommend against that just because I mean I've one of all two reasons first off. You're not gonna remember or you'll gradually forget what the actual command is You're not gonna remember okay, it's pseudo apt get whatever It's sort of it's not something you actually have to remember and also when you want a specific setting To the command you'll often have to not use your alias or do something weird. So when I The reason I say this is most of my aliases are mostly just abbreviations of things that General commands like all of these are just commands right system CTL them Ranger stuff like that. I don't recommend Making aliases for subcommands or commands with specific options unless you just always want those options So I don't recommend you having an alias for upgrade and alias for install program I recommend you just learn the command And learn the syntax to that command and if you want to abbreviate it If you want to abbreviate the command itself in an alias or add in pseudo that's fine But I think it's not a super good habit to put a whole bunch of the very specific command in an alias I I just but in my experience keep in mind. I did this when I first started using Linux or any kind of Unix system and I just found that it was it wasn't a good habit. I didn't really Learn things as fast and I got in the the mindset of not looking at the command itself and learning about it But making aliases to do these specific things that I wanted and that's not a good habit So pretty much all of my aliases are abbreviations now if you do want to put specific options That's fine, but I recommend to do it only when you want when you always want those options So I have an alias for make directory and I give it the P and the V options So P means make apparent directory if If that doesn't exist and V means visual just give me feedback like the directory was created now I pretty much always want those Options when I run make directory so I can have an alias for that. I don't mind that and I have some down here I'll talk about those in a second But in general just I recommend against making aliases for very specific commands that you're going to run in very specific Circumstances I recommend against that just use aliases to abbreviate or Always enforce some options and nothing else So similar to the make directory thing. This is other options that I always like having So LS I give it a couple. Let's see. I think this is no quotes and this is human readable file Sizes and I also have LS have color auto and group directories first. So group directories first means Pretty much what it sounds like. I mean, let's say I Let's say I LS or yeah LS my documents la tech folder or something like that It's going to First off, there are sub folders here. So it's going to list the folders first. That's group directories first And you'll also see well, there's not color here, but there's bolding that's different here and that's part of that Excuse me So I really just always want color or well I should say color auto means if you output the terminal it's going to appear as color But if you output LS to like a file, it's not going to put the color codes with that and you don't want that So I have color auto for that and same thing with grep. Let's say I have Let's say I grep a file. Let's say grep Well, we'll grep the sequence grep from my bash rc All right, so that just automatically highlight if you put color auto that'll just automatically highlight all the matches So that's something you might want to contemplate and another thing I have is this isn't a cat command but sometimes I want to cat out a a file with the Sort of file high or syntax highlighting And I have this command now. This isn't cat, but this is highlight Which is another command you can download which has the option of outputting stuff in particular syntax So what you can do is let's say I um, let me think of a file that I could do this to um Let's say I run the alac cat on scripts Shortcuts that sh and that's going to cat it out in effect. I mean again, it's not really cat It's really highlight, but it's going to output this file with all the syntax highlighted Now the way highlight works I'll just go and say that it's not going to work if you if I run it on the Let's say my bash rc Excuse me My bash rc here Um, it's going to say I don't know what syntax to run So it's not going to or actually maybe maybe it'll work with force I don't even know Okay. Yeah, no, it doesn't work. Never mind Yeah, so So this will only work on files that have a particular extension and it can get the file type from the extension and assume the syntax Otherwise you have to manually give it syntax and at that point it's not worth it But this is just a nice alias to have just to have it just because occasionally I want to output something in with the file extension and see what it looks like With syntax highlighting Anyway, some other um things that I have So youtube download So if you don't know what youtube dl is i mean it does exactly what it sounds like you just run this command and run it on a youtube link to either a channel Or a video or a playlist and it downloads that channel or video or playlist So I have no excuse me. So I have a couple alias aliases for it I always want these settings So add metadata means when I download the video Put the meta put the metadata with the file, you know be that the author name the video title and uh stuff like even I think it even has like view count and stuff like that and um, I also give it these other options I is let's see. What is I I is uh ignore errors Yeah, so if like a video in a playlist mechs messes up it continues anyway and c is for continue if you um If let's say like the download breaks in the middle You can just run it rerun the command and it's going to pick up where it's starting And so I have youtube yt for uh youtube dl and yta for uh download with audio And and you might say okay. Well this sort of quantum uh contradicts what you said before and in a lot of ways Well, the idea behind it is I have to type all of this I'm gonna want this every time I run youtube dl and it'd be a pain just to add in that extra option So I just have two aliases for it. Uh, but I know youtube dl by heart. Anyway, so that's fine But you can check out the manual for it if you want to add in some other options or something It has there are some other cool stuff. You can have it download thumbnails and stuff Um, aside from that, I also have youtube viewer, which I just abbreviate as capital y capital t And I have some other stuff. I don't actually use this stuff anymore. I used to have speedometer Um, I show you I might still have this installed right so I can see if uh Yeah, I still have speedometer installed and it just gives you, uh, your well, it's not loading anything right now It gives you your internet usage or whatever. So Oh, no, I'm not an ethernet. That's why never mind Um, but I don't actually use this, uh, and the only reason I had these aliases is because I'd always forget what profiles I had on whatever computer I'm using so I just have them Okay, I got mail. I just have them in my bash rc Um, so the reason I have these here are not necessarily because I can't remember speedometer, but because I can't remember my, uh Uh, whatever profiles I have, um on each of my computers Anyway, star wars, uh, you can run that and see what happens and the only other things I have Is a couple copy commands for la tech. So I have la tech templates And I sometimes just want to copy them to a new location to Create a new file. So I have shortcuts for that. Don't actually use this anymore. I should delete this and, um Source my shortcuts file. If you don't know what that is, you can check out my video on my short I think it's whatever last video I did on that. It was a couple videos ago And this thing right here, this is for downloading stuff from cy hub. If you don't know what that is. So basically Um, cy hub, you can feed it a link to an academic article that's paywalled and it will Cy hub will like, uh, bypass the paywall basically and this command you can usually Give it a link and it'll download the pdf But sometimes you need a capture or something so it doesn't actually work. So it's better to actually use cy hub manually Anyway, that's what I have in my bash rc I should say I have other stuff in my general environment But that is stuff that I have in specific shell scripts that are in my scripts folder Um, so you can check again, you can check my github out for that kind of stuff But anyway, that's this has been a preview of my bash rc and bash profile You can check them out on the github have any questions ask them and that oh perfect time to get a phone call I'll see you guys next time