Linux Crash Course

The Linux Crash Course playlist from Learn Linux TV is a beginner-friendly series of standalone episodes that make learning Linux simple. Each episode focuses on a specific Linux command, concept, or topic, explained in a way that’s easy to understand. Since every lesson is self-contained, you can watch them in any order and build your skills at your own pace. In this playlist you’ll discover: • Linux command tutorials with clear, step-by-step examples • Beginner-friendly explanations of Linux concepts and features • Bite-sized lessons you can watch independently • Practical tips to help you feel more confident with Linux Perfect for: Linux Beginners, Students, and Curious Enthusiasts who want to explore Linux commands and concepts without needing a full-length course. ✅ Easy-to-follow Linux crash course lessons ✅ Hands-on command line demonstrations ✅ Clear explanations of Linux concepts and topics ✅ Expert guidance from Learn Linux TV Whether you’re brand new to Linux or just curious about specific commands, this playlist is your go-to resource for Linux tutorials, tips, and demystified concepts. #Linux #LinuxCrashCourse #LinuxTutorial #LearnLinux #LinuxCommands #LinuxForBeginners

Curated by: Learn Linux TV (85 videos)


Currently Playing: Linux Crash Course - Setting the Hostname of your Linux Workstation or Server

The "Linux Crash Course" series (formerly known as the "Linux Essentials" series) tackles important concepts around Linux, one video at a time. In this video, I show you how to set the hostname of your Linux server or workstation, with a full walkthrough of the commands required to do so. We will also take a look at editing the /etc/hosts file as well. This video is part of the Linux Crash Course series. *🚀 Level Up Your Linux Skills* • Linux Commands Cheat Sheet ➜ https://learnlinux.link/linux-commands • Linux Foundation Certifications (Use code "LEARNLINUXTV for 30% Off) ➜ https://learnlinux.link/lf • Get $100 Credit to Practice on Akamai (Linode) ➜ https://learnlinux.link/linode • Monitor your Infrastructure like a Pro with Netdata ➜ https://learnlinux.link/netdata • Check out TinyPilot, a Pi-Based Remote Access Solution ➜ https://learnlinux.link/tinypilot *❤️ Support the Channel* • Enjoyed the video? Your support keeps this channel independent! • Become a Channel Member (Ad-Free & Early Access) ➜ https://learnlinux.link/join • Support on Patreon ➜ https://learnlinux.link/patron *🛍️ Featured Merch* • "apt install coffee" T-Shirt (My personal favorite) ➜ https://learnlinux.link/apt-install-coffee • Proxmox T-Shirt ➜ https://learnlinux.link/proxmox-shirt • Explore the Full Shop ➜ https://merch.learnlinux.tv *🎓 Full Linux Courses* • Getting Started with Ansible ➜ https://learnlinux.link/ansible • Linux Essentials Certification Guide ➜ https://learnlinux.link/linux-essentials • Linux Crash Course ➜ https://linux.video/cc • tmux ➜ https://linux.video/tmux • vim ➜ https://linux.video/vim • Bash Scripting ➜ https://linux.video/bash • Proxmox VE ➜ https://linux.video/pve *🎓 More About Learn Linux TV* • Main site ➜ https://www.learnlinux.tv • Community Forums ➜ https://community.learnlinux.tv • Github Account ➜ https://github.com/LearnLinuxTV • Content Ethics ➜ https://www.learnlinux.tv/content-ethics • Request Paid Assistance ➜ https://www.learnlinux.tv/request-assistance _Note: Some links mentioned here are affiliate links. If you purchase through them, it helps support Learn Linux TV at no additional cost to you._ ⚠️ Use Content Responsibly Learn Linux TV shares technical content intended to teach and help you, but it comes with no warranty. The channel is not liable for any damages from its use. Always ensure you have proper permissions, follow company policies, and comply with all applicable laws while working with infrastructure. #LearnLinuxTV #Linux #Networking

Video Transcript

[Music] hello and welcome to linux essentials a brand new tutorial series that'll contain short and sweet tutorials for all kinds of things that i think every linux administrator or potential linux administrator should know how to do that i can refer people back to later i came up with this idea because there's some topics that i go over more than once in some of my videos such as setting the host name setting up ssh things like that and rather than repeat that content each and every single time i do a tutorial i wanted to have a tutorial series that i can easily refer people back to for common topics so for this series there's no particular upload schedule and i don't think there's going to be a ton of episodes in this series either basically anytime i discover a topic that i think is going to come up again and again a routine task if you will i think it makes more sense for me to create one video to refer you guys back to rather than go over that same content again and again in every video so one topic that comes up again and again is how to set the host name of your workstation or server and that's exactly what we're going to cover in this video alright so let's get right into it so here on my laptop i pulled up a terminal and depending on how you have your shell configured most of the time the host name of your server or workstation is going to be shown right in the bash prompt as you see here so mine is called studio hyphen laptop clever i know now if for some reason the hostname is not shown in the prompt you can simply type hostname with no arguments or options just like that and it's going to print the hostname of your computer or server if you are curious where that is actually stored then let's take a look at the etsy hostname file and as you can see here it's shown right there there's the hostname yet again so let's take a look at how to actually change the host name now i'm running on ubuntu but it really doesn't matter because the commands that i'm going to show you should work on just about any distribution nowadays there might be a few out there that don't have the command that i'm about to use available but all of the major distros should support the command syntax that i'm about to show you and the actual command that we're about to work with is the hostname ctl command and if you enter that command by itself it'll not only give you your host name but it's also going to give you some additional information about your machine as you can see here now as you already know my host name is studio laptop so the first line gives us that information but this same command is actually used to change the hostname as well in order to change the hostname you'll either need to be logged in as root or you'll need to use sudo and my user is j so i'm going to need to use sudo because i'm not logged in as root and the command that we're working with is again hostname ctl and then the option to actually change the hostname is going to be set hyphen hostname and then we type the actual hostname that we want our workstation or server to have so for example i'll rename mine to my hyphen laptop so i'll press enter and it kind of looks like nothing happened because we still see the old hostname right here and that's just because this terminal window was opened before i changed the hostname so if i open a new tab for example you can see that the new tab actually has the correct hostname so terminal windows that you currently have open will not show the new host name just keep that in mind and if you want to you can kind of force it along by doing exec and then bash assuming that bash is actually a shell that you're using and you can see that my hostname was updated now again the command that i used was this one right here sudo hostnamectl set hyphen hostname and then the hostname that you want to set it to and if we take a look at the etsyhostname file again we can see immediately that it has the new hostname there now if you actually use a domain then you might want to actually include that in the name so for example mine is my hyphen laptop so it could actually be myhyphenlaptop.mydomain.com and we can see here that the hostname was changed so again if you have a domain consider using that when you set the host name of your server or workstation now notice if i do exec bash again the host name in the bash prompt didn't actually update and the reason for that is because the bash prompt is only going to show the host name up to the first period so basically everything after my hyphen laptop is essentially truncated but if we type the hostname command we can see that the entire hostname is shown so basically by condensing the hostname in the bash prompt it's just making sure that it's not too long but that's not actually the only change that we should make i mean yes we did just update the host name and i could actually end the video right here but there is one more thing that i recommend you do if we take a look at the etsy hosts file we can see that the previous host name is still in this file so even though the hostname ctl command allows you to set the hostname and it did let us do that it doesn't actually update the etsy host file we have to do that ourselves that's pretty easy to do so i'll go ahead and open it up we just do sudo nano and then slash etsy slash hosts now on your end you're probably not going to have that second line that's just something that i do you'll probably just have this first line right here and then you might have your host name either as localhost you might have something after that it varies from one distribution to another but basically the easiest way to facilitate editing the nchost file to reference your new hostname is to definitely change the hostname from the old to the new if it's already in the file but if it's not we could just simply do this 127.0.1.1 which is a localhost ip address still in the same range and then right here we could type the preferred name and if you don't have a domain then you're done you could basically just type your hostname as i've done here and that's it but if you have a domain what you should do is also type that here as well and then space and then the shortened version in addition so this way localhost actually resolves to the fully qualified domain name which is the hostname.domain that's the fully qualified domain name but it also resolves to just the hostname as well so regardless of which i type it should be recognized so if i save this and in the case of nano to save it you hold ctrl and press o to bring up the save dialog you press enter and then ctrl x to exit out we should be able to ping the fully qualified domain name of this instance so i'll just type the entire thing and you can see that it's responding now what i should also be able to do is take away the domain name and still get a response which i am so basically to recap we can use the hostname ctl command to set the hostname if we enter hostname ctl by itself it'll give us the current hostname and some additional information as well but the set hyphen hostname argument that you see allows you to permanently set the domain of the computer or server to whatever you type at the end and then we ran this command right here to edit the etsy host file which is optional but highly recommended you might actually get some errors in the terminal if you don't actually set it here it's just good practice so we edited that file as well to reference the same hostname that we set earlier as you can see in the second line and that's basically all there is to it so there you go as you saw setting the host name on your linux workstation or server is pretty easy and straightforward and as a linux administrator or potential linux administrator i think it's something that you'll find yourself doing every now and then as your career progresses so i hope this video helped you out and as always make sure you click that subscribe button if you haven't already done so and i'll have more videos in this series very soon in fact i also have another video in this series already uploaded so be sure to check that one out as well and i'll see you in the next video thanks for watching [Music] mm-hmm [Music] you

Tracks in this Playlist