Network Engineers Programme
language: EN
WEBVTT All right, well, I can see everybody is in and we'll wait for you to come in as well. Anyway, so meanwhile, as we do that, let's just take a very quick look at what we are doing today. And again, this is just the fundamentals. So I'll just quickly fire this up. As this is on Linux command line basics, as I said, we are almost seeing this as the first look at Linux. You guys are comfortable with it, so we'll probably accelerate through some of that. However, there is something that I would like you to know, which is we can always work on a system on our own. But there are some ideas or concepts that should be clear for us to probably troubleshoot when things go wrong. So we look at the Linux fundamentals from the operating system concepts, just a super quick history, understanding distributions, and then start working on the Linux command line. And as we work on the command line, the absolute fundamentals of the file system, how it works, how do we interact with the operating system, what are the different file types, many core commands that will work across most of the Linux distributions. We're going to have a look at those. Pretty much everything that we are doing will be done hands on. I would be sharing with you some, just like a lab file as well, and the content of this as well. I would say the starting point on working on any operating system is just the absolute basics in terms of the concepts. And you guys have already been interacting with the operating system, so we'll just keep it very, very quick. The core here is that the core of your operating system is what we call as a kernel. And we interface with this kernel, typically through a graphical interface or through some sort of a command line or a shell environment. As you guys already know, right now, Linux, we have fantastic graphical interfaces available, also for administration, and at the same time, we have the shell available. If you go back in the day, yeah, I think the only thing available was a shell, I'm saying, 20, 30 years ago. Graphical interfaces were not so common. Today, we have the choice of both. There are a few things you can literally do more efficiently only through the shell itself. Quick question, are you aware of different types of shells? Not on my site. No. I think the comparison that I could have is that if you go to Windows, for instance, we have one graphical interface, right? Like one environment, one type of graphical interface. And then you open a command prompt, that's your command line, maybe a power shell. Linux Unix systems are known for flexibility. So you can have different types of graphical environments. And we also have different types of shells. And they give different capabilities or different feature sets, for instance. So it's just nice to know that when we look at the OS concepts, that there are different types of graphical environments and shells available. Typically, when we use a platform like Ubuntu or any other platform, we can customize some of this during the installation as well. So today, when you work on a shell, you're working on a certain type of shell. When you're looking at a graphical interface, it's a certain type of graphical interface. And that depends on what type of Linux distribution you are working on. On a fundamental level, the shell is your interface to work with the system through the kernel, which is your absolute core. Maybe the very first thing we want to do is just get started having a terminal in our environment. Maybe we can do exactly that. You can see that in the online lab environment as well. But let me just share exactly that. Since you all are users of the Linux as well, what's the quick shortcut to open a terminal? Keyboard shortcut. Let's try Control-Alt-T and get a terminal up and running. Let's give that a try. Control-Alt-T. Let's just get a terminal up and running. We like shortcuts. Shortcuts are good. Many ways to get the terminal up and running. Let's try the keyboard shortcut. I can see Paramount has got it up and running. Control-Alt-T. Yeah. We have the terminal up and running. And Austin, yeah, is up and running with the terminal as well. Of course, the other way to get a terminal up and running, you can right-click on many of the Linux distributions. You can do that. You can just right-click the desktop, open a terminal. And I can also maybe go into my applications, the menu, and search for terminal. I see another terminal here. Here we go. So I have three terminals up and running. But they're all started in a different manner. One with the help of a shortcut, the other one with the right-click on the desktop, and the third one from the menu. Can I request you to do the same, please? Let's fire up three different terminals through the menu from the right-click and from Control-Alt-T. On the menu, where do I go? So in the menu, you can just type to search. Easiest thing to do would be to just type terminal. And you might see this terminal, made terminal for this GUI available there. You might see multiple types of terminals. We'll look into that. OK, got it. Thanks. But you might see, again, depending honestly on the different Linux platforms, they might be in different places. They might be arranged and organized under System Tools. You can see here. And then when in doubt, just search. It's the fastest way of getting into the terminal itself. So in other words, we are working in a terminal. This is a cell which provides us access into the OS. And then we can do all kinds of things from here. And as I said, once upon a time, a terminal was the only way to work. So as we work on that, quick question. What are our privileges in the operating system right now? Just by looking at the terminal, what are our privileges into the operating system? What does that dollar indicate on the shell? You can take a guess. Please don't worry about right or wrong. You can just take a guess. OK. Is it not read and write? So a dollar? Yeah, go ahead, please. Yeah, as in, OK, as I go with the read, because. I understand what you mean by read. And execute. Yes. I can execute a command. So you can execute commands on all the terminals. However, you are a normal user. You don't have what we call as the root privileges. In other words, you're not the administrator. So certain commands that require admin privileges just won't work. You are a normal user. If you have root privileges, what does the terminal look like? What does the prompt look like? What changes? So let's try that on one of these terminals. We have three terminals in front of us. I'll explain the commands, of course, as we go in. I'm going to do sugo bash. No. I can't do sugo. If I do sugo bash, and I'll explain the logic in a bit. I want you to notice if your terminal changes, the prompt, the last character changes. I believe it changes into a hash. Would you please try the same? sugo bash. So now we have one terminal where we have all the privileges. And current other terminal is running under limited privileges as a normal user. Sorry, are we doing that on all of those three terminals? Just one, please. Pick one. Oh, just one of them, OK. Just to show the difference. Just visually how it looks. Does that work, Austin? I believe it does. Yes, it did. Yes, it did. Austin, there is a way. Yeah, go ahead. Oh, no, just saying that I have to find teams to unmute. There's some open list, so it might be a little bit delayed. Yeah, so you wanted to say? No, what I'm saying is there is another name for a terminal where you have root privileges. Do you know the name of that terminal? What's the root privilege? Yeah, it is called as the CV updater because this is where you make a mess and you start looking for another job. With great power comes great responsibilities. The moment you see the hash sign on a terminal, think twice and do nothing. What that means is we work as a normal user as much as we can till we need to actually perform some system administration. We wear the hat of the system administrator as long as needed, and then we get out of that and back into the normal user. Can I request all of you here just to type exit into the terminal which is running under root privileges? OK. What changes onto the prompt? Can we go back to the last time? Yeah, we are back to the safe job because here you can't mess up everything into the system. Probably the very first thing I want to tell people is when you are working on the shell, how to recognize if you have higher privileges or not. And if you have higher privileges as root, the prompt changes. And maybe we ask ourselves a question saying, do I really need those privileges for what I intend to do on the system right now? Or is a normal user enough for me to carry on my work? We'll get more into the sudo and the other commands a little bit later on. But just wanted to bring that point across. Are we clear? Any doubts, questions, thoughts? OK, I take that as a sign. I'm going to do exactly the same. I'm going to exit and just come back to a normal terminal, which ends with that dollar. Just a little bit very quickly on Linux. I really don't want to turn this into a history lesson. But I think it's worth mentioning this. When we work with Linux, we normally hear the word distribution, Linux distribution. And fancy people use the word distro. Which Linux distro are you working on? What that fundamentally means is that there are many flavors of Linux, as it is open source. A lot of modifications have been done. Linux has been adopted and adapted for various reasons by different organizations and individuals. And all of these are considered as different distributions. Very popular distributions will be something like SUSE, like Debian, like Fedora, Ubuntu, like we have. There are many, many, many distributions around. And each has certain advantages, disadvantages, specific purposes that we have got. First question, how do we know what kind of Linux system are we working on? What is the distribution? What is the kernel that we have? How would we know what that is like? Let's give it a try. Please try this out, as you see on my screen. If not, let me just share it with you right away. So I try this command lsb underscore release dash a. Should give you a little bit of information what kind of distribution you're on. lsb underscore release dash a. Now, not to make your life a little bit difficult, but different Linux distributions have their own unique ways of getting things done, which in simple English translates to the commands, the way they work on one distribution may not work the same way on the other. It can be a little bit challenging if you jump from distribution to distribution. And you might say, oh, on one distribution I used to do this command or this tool. Yeah, there could be some differences as you jump across them. And there are certain things which are kind of common across all the different distributions. So maybe it's nice to know, hey, what kind of distribution I'm currently on in terms of the Linux operating system? What is the distribution that I'm working on? Can be quite handy as well. Let's try some very basic things right now. We mentioned I'm back to my terminal. I will minimize the other terminals. I'm happy with just one at the moment. If you're gonna make your user experience a little bit better, you can always zoom in a little bit. I do the control with the plus. Just to zoom in a little bit. So yeah, just take one. I'm struggling with audio. Hang on, is everybody else able to hear me? No, you go away and then you come back and then it goes, finish off and then come back again. Okay, yeah, well, that's not good. I shouldn't be going away. Let me just make some adjustments. I've just moved into a new home like three days ago. So still finding that sweet spot. I think now it should be better. Is the audio a little bit better now? Yeah, much better. For now, yeah, for now. So you believe that I'm a network engineer. No, you're in a new home. Yeah, you went, you as owner trying to find a sweet spot. Yes, I hope that the audio works just fine. Oh, you said control plus. Yeah, control with the shift and the plus, of course. Yeah, that should help you zoom in a little bit. Let me keep a ping up and running to the gateway. Okay, one and three milliseconds. No, sorry, GP, the same thing is happening now. I see no challenges with my network connections. It's got to be teams. Okay, let's just see how it goes because from my point of view, I just see a very happy connectivity. I'm able to ping remote network systems with eight milliseconds and I have a one gig on my upload speeds around 250 MB, so. Sorry, I had to drop the handbag. So it wasn't only was totally with audio. We can just do one thing. I'll just drop out and join back in. See if that makes a difference. Okay. Yeah, always worth trying. Let me just leave. Okay. Okay. Did you guys zoom? No, my stream doesn't do it. How's it now? Just wondering. Yeah, it's good. Let's go. Going and then. Even now? Let's see if we go. No, you can't work. You can't put it on the same page. Okay, so I'll keep talking and you can just let me know if it works. I don't know. Is the mouthpiece next to your mouth? Because now you sound far. Okay, hang on. We can always find a setup that works. Wait a second. Hey guys, sorry I just gave away. What's happening now? We're just testing out my audio. It seems they have some challenges. Yeah, still. But you sound better now than before when you came back. So I think every time I have to do a couple of pull-ups and push-ups and I come back. And it's all good. Is it better now? Yeah, it is, it is. All right, let's carry on. And then again, just let me know on the chat if there is any challenges with the audio. We'll try a different setup. But frankly, from the network perspective, I don't see much in terms of the challenges. Okay, if you're with me, let's carry on. And let's head back to the shell that we are in. So we'll continue on just discovering a little bit more about our system. And we do that. Let's share my screen. And I'm here, back here on my environment. So we did this lsb-release-a tells us we are on Ubuntu. There is a specific release. You can look at documentation. Let's try uname minus a. It gives kind of a scary output. There is a lot happening there. So what do we get from uname minus a? It tells a lot about the system, but more specifically, helps us learn about which exact kernel is running in the system. That might also make a difference to the way some commands execute or what capabilities of the system are available to us. From the basic command line perspective, it shouldn't matter. Interacting with the file system and doing basic system administration, that this doesn't really matter a whole lot. Let's see if we can find out how long our system has been up and running. So we can try a simple command, uptime. So what do you reckon that uptime is on? So it hasn't been up and running for too long. It was a seconds. Minutes. Hours. Kindly try the same. We try uname minus a, give some details of the kernel. We try uptime, tells us how long the system's been up and running. All of us will be almost identical. So I've worked on systems where the uptime goes in years. Many mission critical systems literally just don't go down unless it's planned maintenance. So we're just discovering a little bit about our system. What's the distribution? What's the specific kernel release? A kernel version? How long the system's been up and running? The architecture. Just some basic commands about our system. Just discovering it. What's going on? We might also, on most environment, just like to quickly know how the system is performing. Let's give that a try. Let me fire up my shell. All right, this will be easier to share. Just anything new for you till now? A command that you haven't tried before? Everything that you just did. Okay, listen. How about the others? Just check the things you've tried before, things you've never tried before. Yeah, maybe for me that has been... Let me share my screen again. So a very typical command, just to understand how the system is performing, is the command top. And as I said in Linux, there are many ways to go about something. Top is one of the common commands that gives you a live snapshot of system's performance. So if I just write top and press enter, it kind of fills up your screen, runs constantly. You can almost think of it like the Windows performance monitor. And we can see which application. This is a remote connection. VNC is taking around 10, 11% of the time. Of the CPU, the overall CPU utilization, overall load of the system, the number of tasks running, amount of memory, how much is free. This kind of gives you a quick snapshot into, again, in troubleshooting. Is there anything eating up the system's resources at this point in time? Top command itself has a lot of details. If I press Q, it will quit the top command. And I'll get back to my tab. Give that a go. Run the command top. You see some summary of system utilization. You can see, yes, go ahead. What command is it? Because I'm only seeing the- The running command. Top, T-O-V, top. Just run top and press enter. Thank you. So we can see now which applications are taking the most resources or which processes are taking the most resources. 10, 12% of CPU utilization. Our system seems to be okay. It's doing all right. Austin, you can try the same as well. Top command itself has many things that we can do with it. Wait, didn't you just use top alone? You already ran top. No, I already ran it. Oh, that's fine. I got confused a bit there, but that's like, oh, it's copied with us. That's the unless you're only using the environment you're saying. We just ran the command top. And if you press Q to quit, this is for everybody else. It will exit the tool and you'll come back onto the command line. All right. A quick look at the very basic architecture of Linux. Commands obviously is one aspect of it, but understanding the OS helps in understanding what the commands do. So as we saw earlier, we have the operating system kernel which manages the hardware resources and we interact with the kernel. So the kernel itself is here. It works with the drivers. For example, when you run the command top, basically you are asking kernel, hey, please give me the details of the running processes. So that's what the command is doing. The command is asking the kernel and the kernel is going and fetching all the detail. As I did mention, there are different types of shells available. We have the original shell, born shell, C shell, T shell. There are so many different variants of these shells. Typically most Linux environments have what we call as a born again shell, but it can be different from environment to environment. And there are many different graphical environments that the different Linux distributions you work with will have possibly different graphical environments. And the good part is potentially you can choose also what do you like. In terms of the architecture, there are plenty of different system tools. We're gonna try those tools. Again, we will learn not only how to execute one tool or one command, but the power comes from connecting the commands together and we're gonna have a look at that today. Can I tell you this? This is a very important slide. And the first point is the most important. Anyone coming from Windows, if I ask you what is a file, what's your answer? Windows, when you think of a file, what do you think about? Something you can read or write in your book. So you're thinking about data, right, Austin? Yes. Anybody else? What's the file? I can see you're unmuted. We don't hear you. So I think this is the thinking, right? I see the bubbles up the hill. Yeah, I know. I wanted to answer, but I'm like, it's not my people. That's fine. I encourage any and every response, it's fine. No, I thought you were fooling around. Yes, fair enough. See, in Windows, we associate files with storage. In Linux, that's a mistake. Because in Linux and Unix, everything is a file. And I'll prove it to you as we work on the system. Your hard disk is a file. Your keyboard is a file. Your memory is a file. Your user account is a file. The screen you are looking at is a file. The terminal you're working in is a file. And that can kind of make your head spin a little bit when you come from Windows, because you're like, hey, the file is for data. No, here, a file is a pointer to a resource. And it's a very broad open definition, like a pointer to some sort of a resource. The resource could be anything. Let's give that a little bit of a try. I'm gonna go to my network environment. I'm back onto the shell, as you can see. The very first thing I'm gonna do here is try a very basic command, ls, take a list. What do I see? Well, I see some resources. But I can't tell if this is a file or a folder. There are many ways to take a list. We're gonna try them all. The command ls itself, just to showcase, has many ways to doing things. What I wanna do here first, let me try this command. And it's a very interesting command that I'm writing. tty, which terminal is this? I hope you remember, we also have other terminals. I've minimized them, I find them at the bottom. And in the other terminal, I'm going to say tty, which terminal is this? And what we notice is, when I say, hey, what terminal is this? It gives me a location. slash dev, slash pts, slash one. It's literally a file system hierarchy. So what the system is telling me is that this terminal that I'm looking at is represented as a file here. And this terminal that I see on the left-hand side is also represented in the system as a file. Do you notice that there are different pointers? This is number one, and this is number two. Is that based on which one you opened first? Yes, absolutely. Just one question, just one question again. I assume the one that you're on with the desktop is the one that you opened by a desktop. Is there a reason why it's named differently? No, no, no, this is just numbering. They're both dev, pts. The type of terminal is the same. How do you do that? Also, I was just asking the question of where is the slash desktop? Ah, you have been defined. Yeah, I was just a matter of identifying. Oh, you're coming to it, okay. Okay, no problem. But anyways, the quick-shot answer is, right now the prompt is reflecting the current location you are in. Oh, so that's another thing, instead of pwd. Yes, this is just, they are being very helpful to you because they know we are all lazy people. They're like, hey, guess what? You are in that folder. Okay, thank you, makes my life easier. One of the most common mistakes in the Linux Unix world is write command, but in the wrong location. So they're kind of helping you out, and we'll come to that just in a short bit. Okay, one and two, we can see. I do have my third terminal here as well. I have zoomed everything else other than the terminal N, and I do the same thing here. What terminal is this? This is terminal zero. So there is some numbering starting from zero. This is device zero. This is device one. This is device two. Let me try something. Let me try a very simple command. I'm gonna say echo hello. Any guesses what it's going to do? It's gonna show hello to the screen. So it literally just takes this input, and the output is on the current device. So hello comes out on my terminal. What if I did that, and I said this, dev vts two. What am I trying to do here? I'm trying to put it in that vt. Hello to input net file. Or since we have two a file. But is that file really a file, how we think about it? No, no it's not. So what's gonna happen when I do this? Where does the hello go? I was in that directory. Maybe just list everything. Look, look here. The hello showed up in the other terminal. Wait, oh is it? I just saw that now. Can you guys try this out? I just saw that you actually listed a different path. I didn't see that it was on zero, but it's still true, okay now I just saw that. Can we try this please? Send a hello from one terminal to another terminal. Mention the file that represents that terminal. And just writing tty will tell you what is the identity of that terminal. The example is in front of you. Just give it a try. Guys, I hope you don't mind us doing these things because all of you have said you are a bit comfortable with Linux. So I'm just expanding beyond the little bit of comfort that you have with Linux with some core concepts. No, we are good. You want us to follow you also? Yes, yes, yes. Okay. So arrange your three terminals. Find out their identity, which file represents them. And try the echo command, just as you see. So we should redirect it to two, even though I don't have it. Oh, I can do one. Yeah, any other terminal is fine. So normally we just click right. We right click when we want to paste something. Does it work here? Sorry, could you repeat that? When we want to say you've copied something, you want to paste it. Normally we just right click. So we need to find out for this. We can distribute it as it works also. You can try that out. That depends on the terminal and the type of terminal application as well. All right, quick question. Do we understand everything is a function and file is not just data storage. The very important in the Linux world, even devices are files, physical or logical. I might say Unix by mistake, but I mean same thing. Basic principles are the same. So we answer a very fundamental question. What is a file? And the answer is this. So what we would like to know, let's just bring this up one second. So let's have a look at what is a file and then we'll explore it in our operating system exactly the same way. I'm just gonna run the figure again. Look at the file types. Here we go, and let me just share. So let's say we have a file type. So files that contain data, we call them as ordinary files. Even folders are considered as files. Then we have files that represent devices or drivers. We call them as device files. The example we saw right now was for terminal. And we have like shortcuts in the Windows world. We call them as links. And we have different kinds of shortcuts, soft links and hard links, and we're gonna have a look at those. So let's just see the file types and have a quick look at the, what we call as the directory structure. Here is what we need to know about the directory structure. And I would say like this is the starting point for your journey. In the Linux world. Let me share my whiteboard here with you. And let's just take a closer look at the Linux file system. And obviously the starting of the Linux file system is what we consider as the root. Don't confuse the word root. Root can be a term used to describe the file system. And root can be used to describe the user. Who is the super user? The super user is super chill. Here we are referencing the root in terms of our file system. How things are laid out. And the root of the Linux file system is represented by that forward slash. This is the top of the hierarchy. Every resource in the system is somewhere down there. So for instance, under slash, I see a folder ETC. This contains all kinds of configuration files. Similarly under slash, I'm gonna see a lot of other folders. And learning Linux is half learning this hierarchy. What is where? The important thing is what is the top of the tree. Or the root depending on how you wanna look at it. So if we go to our live environment, let's try some things out. The very first thing we would like to do, I'm just happy in any one of these terminals, the very first command is writing PWD. And I think many of you know that. It means print my working directly. Where am I? The thing to note here is what is the starting point on the left hand side is that forward slash. So under the root, there is the home folder. Under that is the student folder. This is where I am currently at this point in time. If I write CD backslash, this is literally going to the start of the file system. Everything is under this structure. And if I say, hey, print my working directory, it says, well, you are at the start. Everything is under this hierarchy. So this is the root of the file system and everything is under this root as a file system. And part of learning Linux is learning navigation. Does anyone know if I just write CD and press enter, what will happen? Here is a command. Many commands would need a parameter. What happens if this command, I don't give any parameters. Change the directory, but I don't tell you where. It doesn't do anything. Just be the same directory. It takes you to your home directory. Okay. Can you try out exactly what you see in front of you? Go to the root CD slash. Verify that you are in the root with a print working directory. Just write CD and press enter. And you are magically transported to your home directory. What character represents the home directory? Look at your prompt carefully. What do you call the character again? For what it is called? Can you guys still hear me? Yeah, we can hear you. Can you hear us? Yeah, all well. Because I was tweaking it. I was just saying the character for what it is called. Ah, tilde. Yeah. You know why I like Linux? It makes you realize we don't know our keyboard. You just know where to press it. That's all that matters. Never mind the memes. Do you know the story of the Q-W-E-R-T-Y? Why those characters are up there on the first line of the keyboard? No. If you pay attention, you can type the word typewriter from the first line on the top. So back in the day when typewriters were becoming popular, they designed it this way so that the sales people could go and pitch to everybody, look how quickly we can type on a typewriter. And they would type typewriter and people would be impressed. Scammer. And people would be like, wow, yeah, that's so fast. They didn't realize that typewriter could be typed just on a single line. All right. I hope this worked for everyone. So the character tilde represents your home directory. And P-W-D kind of tells you what is your current directory. And what that means is when you're working on the command line, you need to know three things. Commands have parameters and options. Let's take a look. What do I mean by commands have parameters and options? OK, I'm going to just share my environment just a little bit. And we'll take a break shortly, I think around 15-odd minutes from here. We'll just stick to your regular break size. I'm happy to take any suggestions as well. Here, a quick one. So here is a command cal, prints out calendar. Now in this case, it says, hey, you don't have calendar. Here is a command date. What does date give me? Let me clear the screen. Well, date does a lot beyond date. It actually tells you time. And what does the command time do? Just a quick one on that. So the time zone is takes it away from the system. Yes. The system, OK. Yeah, it's got nothing to do with your time zone. It's the time zone set during the installation of the system. And in these cases, these are virtual machines running on a hypervisor. So typically, they borrow it from the hypervisor. So this would represent which part of the world the infrastructure is running on, for instance. All right, so a very interesting operating system. I say date. It tells me date and time. I run the command time. It tells me something I don't understand. With the command date, what happens if I do dash dash help? Some of these helps are a few pages long. But the important thing here is how it's supposed to be used. So it's saying there is a date, and then you can mention the options. Options can be short or options can be long. But the important thing is the options begin with a dash. And there are many options available. So let's try something. We're going to make sure you are in your home directory. If not, just type cd and press enter. You can obviously verify that, that you're in your home directory. Let's try the command ls. That gives us a list of resources. And in my home directory, there is desktop, music, public picture. Many of these look like these are folders. But I would like to learn a little bit more about how to use the command ls. I'll try some help. I do a quick dash dash help. A long list of help shows up. Basically it tells us all the options available. And as an argument, I can mention which folder I would like to see. Or which file I would like to see more about. Couple of interesting options that we see there. Minus f, minus g. Human readable, minus h. So there are plenty of them as well. We have the long list format. I'm sorry, how did you zoom in on the terminal? Control with the plus, with the shift. Or plus with the shift? Or with the view. Okay, that is better. Okay, thanks. First thing that you want to do is customize it. So let me run the command ls minus l. When you do ls minus l, pay attention to the very first character. This is a long list. We are looking at the very first character. So what does d represent here? All of these are directories or folders. In Windows you use the word folders. Typically in Linux you use the word directory. These are all folders. Okay, let's very quickly create a file. What is the command to quickly create a file? Which has nothing in it. The command to do what? To create a file, an empty file. It's mkdir. That would make a folder. I want to create a file. Touch, touch and the name of the file. Let's have a look at the long list again. What's different about my file? By the way, everything I'm doing, I'm expecting you to repeat along with me please. Right now? Okay, what's different is the size and also the rights. Look at the first character. Yes, it doesn't have a d. So that dash indicates an ordinary file. Just a file that contains data. Do you remember the file that represents a terminal? ls minus l would give me the details of that file. What is the first character? It is not a minus, isn't it? It's some other character. And it's not a d either. If it starts with a c or a b, we call it as a device file. A file that represents a device. So the very first command that you probably would like to learn when you're working on file system is simple. ls minus l. What am I looking at? Is it a folder? Is it a regular file? Is it some special kind of file? Is it a link to something? ls minus l gets us that answer. For instance... Yes, go ahead. A device file. There are characters and blocks. What about the one with t? A directory or a folder. And a dash is an ordinary file. I think, see, writing commands on Linux is not so difficult. But understanding the logic behind it helps. Makes us more comfortable with the platform. Because Linux can be a bit complicated as well. Alright, before we go any further, just a quick check. Are we all good so far? There's Andre, Austin, Caroline, Faith. Oh, Colorfula, we just saw you. Sorry, just happy morning. Yeah, I'm so good on my side. Yes, what I wanted to know is that dash dash help brings up what? I know it brings up a lot of info, but what would the show description be? So yeah, so dash dash help. You're asking what does it do? Are you looking for something? Yes, yes, no. So dash dash help tells you about the command and tells you about all the options for that particular command. Some of the commands, if you ask for help, you get a book as a response. And then we just Google the option. They're like, I'm not reading this. Thank you. I'll just Google how to do something. And of course, these days, your deep mind will work just as well. There are commands like tar for which you can actually read a book. Yeah, but it does give you help on that. How about the other space? Too much, too little. We know all this. I just need to know. I'm here on my side. However, I think maybe when we come back, I just wanted to know more about the list because I just wanted to know the difference between the ls minus ltr and that one ls. So different options. And what happens when you combine different options? We're going to have a look at that. All right. So maybe a good time for a short break. How about 20 minutes? I'm very generous. No, no, I'm kidding. 15 is fine. After lunch. Now we have six. All right. Then a short 15 minutes break. See you guys in a bit. OK. Thank you. OK. Cool. OK. OK. Go on. All right. All right. All right. OK. All right, back with all of you, if you're around. All right, here we get a big thumbs up from Coloferlo. Big! All right, Carol Mung is back as well with the second cup of coffee, I assume. Not yet. You're saving it for later. Yes, maybe in about 30 minutes, because I had it later, like half past nine. We have to be careful with the caffeine dose, right amount, right time. Yes, and the thing is, I don't drink coffee for the next three months. So I'm not enjoying this tea, like coffee. Of course you're not. Sometimes I can live with it, without it, two hours or three hours away. Any particular reason for giving up coffee for three months? I'm on a diet. They didn't know coffee was part of any of this, but good to know. Yeah, you know, I don't know. My dietitian said that. The dietitian has to say something, right? So they have to be creative as well. They're like, what else can we ask this person to not do? How about coffee? Yeah, let's go with that one. Yeah, no, I also don't trust her, but she's a producer. She's the best in the game. Welcome back. Hopefully you survive without a bit of caffeine. Yeah, no, I have my water here. All right, that works. I once gave a break and someone came back with a kale juice and I said, you win. Anyone who can come back with a kale juice just wins. I know. They're on another mission. It's a different level when you're on kale juice. Faith, Lissandra, welcome back. Hopefully you're around. Hi, Mia. I see Austin and Faith and Mute. Hopefully they'll be back soon. Just give them a few minutes. So just talking about what we were doing earlier, as I said, I would highly encourage you to try things out along as well. I once said to some group, Linux is not a spectator sport. It's the easiest operating system to watch somebody else do things. And when you do it, nothing works. You know, uppercase, lowercase, spaces, and you're like, well, when that guy was doing it, everything was working. What's going on? So you do need to try it, to make your own mistakes and then learn from it. Yeah, that's true. I would encourage you to do the same as well. OK, hopefully the others just join us just in a bit. Let's see where we are at. So we're looking at different file types as such. Ordinary files start with a dash. Directory starts with a D. We saw the devices start with a C or there is a B as well. And we will get into the links as well shortly. We're just familiarizing ourselves right now with the directory structure as well. And some of the basics on the commands as well. And I think part of that is just over a period of time, you kind of create a memory map of which folders are important, why they are important. And that's mostly true for administrative side. If you're working in your own home directory as a user, working on something, we'll answer some of the questions in terms of LS and a few other basic commands. First, let's just take a quick look at the typical directories. I'm going to share my screen in just a bit. All right, I'm going to get back to my terminal. Let's share this. So we looked at the root as such. And we were looking at the command LS. We were looking at the options of the command LS. And I will dive into that shortly as we get back into the commands. The important thing I wanted as a message to come across is the idea that you have commands. We have options. And we have parameters. So in this case, LS is a command. Minus L is an option. I have a long list. And then maybe the location. Are you moving away again? Sorry, can you hear me? Very fast. I can promise you I'm right where I was. Let's just see if the audio. No, no, I'm getting the same idea. I can hardly hear what you're saying. All right, so let me leave and come back. Okay. All right. Let's see if this is any better than earlier or if it is the same. It's definitely better for my end. All right. Let me also try another trick. Wait, wait. Okay, how about now? It's soft, but I think we can hear. I don't know if the other guys. It's softer than the other guys. Okay. It's all right. I can always try something to make it better in terms of the audio. Could just be a setting in teams. You can always give that a try. All right. I'll just keep on talking and just let me know. If any better or worse. Yeah, definitely better now. All right. Okay, since we are spending time on the command line, it kind of helps seeing what I'm doing. All right. So back to the idea of command options and argument. LS is the command. Minus L is the option. And the root file system is the argument. I want to see a long list of the root. And I kind of get something like this. We can also see here. There are a couple of files that begin with an L. This is the fourth type of file. Shortcuts or what we call in the Linux Unix world as links. Begins with an L. So we have D for a directory. We have dash for a regular file. We have C or a B for devices. And we have L for the links. This is how you know what is the type of file you are looking at. Just to take a quick note. What happens if I swap this? If I say LS slash minus L, would that work? Command, argument, options. Any guess? Let's say it's argument, options. Ah, okay. It's time to go back in. And guess what? If you try the same thing on older Linuxes or older Unix environments, it just won't work. So Linux has become friendlier and friendlier and friendlier. For instance, you have some color coding in a terminal. I don't remember seeing this in the 90s. It was nothing like this. So the operating system, especially Linux, is a bit more friendly than typical Unix, which is a bit more hardcore. And it is the way it is with very little flexibility. Your comfort and ease of use was not the top priority. But here it is. Coming at the other files. Go ahead. Are you happy with the improvements? Why not? That's progress. There's no need to be a snob about it. So a lot of people will have that snobby attitude. You know, the elitist, if you don't know VI, you are not a Unix guy. And if you cannot compile the kernel, yeah, well, it doesn't matter. Most of those people are irrelevant now. This is getting the job done. Understanding the architecture is always helpful, no doubt. Especially in troubleshooting. Austin, that's where I make a distinction between a user, an administrator and an engineer. So user is just using the system. Administrator is managing it. An engineer understands under the hood. And in the olden days, I really sound old saying that. But you couldn't be an administrator if you were not an engineer. If you didn't know how it worked. These days, not so much. You don't need to look under the hood. You can just do the system administration without taking deep dives. This just means more productivity from an organization perspective. As far as you can produce faster, that's all that you can say. So cloud automation, all of this is a result of that, right? OK. So we see a lot of folders here. And again, we see slash home. This was where the user's home directory was. ETC is where a lot of configuration files are. Almost like the registry of Windows. MNT is where you get mount points, basically access to any storage or other volume. My computer, C drive, D drive, and others. We have the bin. This is where the actual applications or executables are located. And many others are where log files and other structures are. Over a period of time, as I did mention earlier, you get more and more comfortable with kind of what is where. Just to show you a reasonable mind map of that. It's not easy to memorize everything all at once. The more you work with the system, you kind of figure out this location. ETC is configuration. Boot is where the kernel is. Bin is where the typical executables are. S bin is where the system administrative tools are. And other locations, you kind of discover them over a period of time. And this is more, again, for administrative purposes. You kind of get used to them as well. And then over a period of time, the more you use the system, the more you start realizing what is where. That's part of learning Linux and Unix. That has not changed. The exact structure of the file system could be slightly different depending on the distribution and other variants within Linux world. Fundamentally, it remains similar, but not always the same. So yeah, there are certain directory structures that you can get. Let's look at some basic commands. But before that, also look at the how do you work with the files. Let's go back to the commands bit. And we start our journey very quickly with the command ls. So here, take a list. The implied argument is the current directory. We saw dash dash help. Minus r, give me a reverse order if I'm sorting. l, give me a long list. Because it's case-sensitive, it's not always the same parameters. So minus i lowercase is not the same as i uppercase. rst, I'm sorting by time. The newest first. This is my home directory. Let's do this option. I can do it two ways. I can separate the options out. Minus l, minus r. I can also just combine them together. So a quick bit of help might come in handy. And of course, there are detailed helps available, which we will get into. This is what we call as the man page. Basically man is short for manual. And the man page is quite handy. So any command typically you want, we can open the manual page for it for a quick reference. What is the difference between the manual and the help? Some commands don't have that detailed dash dash help. Most would have a manual page. And man page is literally like opening a book. So it's easy to jump from topic to topic. Dash dash help is just a quick output on the screen. Man itself is a tool. Yeah, would we be able to jump from topic to topic? So if you look at the help for man, we will talk about this as well towards the end. But man page itself has a lot of commands. You can find what is related, the pattern search. You can generate an index. So there are many ways to use. So man is a powerful tool all on its own. So for example, while I'm reading the help, I can actually execute a command. While I'm reading help. So it is very interactive, very useful. Maybe towards the end of the session, we'll have a quick look at man in depth. Once we have seen all of these different commands, we can see how man pages can be helpful as well. It's almost the cornerstone of Linux, Unix environment, which is going through the man page and looking for what you want. Again, remember this is before Google and all that. So it's just the built in into the system. But man is big. It's got a lot of commands built into it. And it's not the only help system. This is the code that you will find. Man is something you expect in every Linux Unix platform. We'll dive into man as well. You'll see some examples of how it could be useful. Maybe I'll give you some small challenges as well along the lines. As we start to work within the file system, maybe it's good to start with understanding paths and what we mean by absolute path and relative path. So let me explain that. First thing, I recommend that everybody is in their home directory. And let's create a quick file. Let's create a folder. Just a simple file that contains hello and an empty folder. Right now, when I have mentioned the path of file one, this is what we will consider as a relative path. I have not mentioned the exact location of file one. So the system assumes in the current location. When I'm making a folder, also I've mentioned the system assumes current location. The only reason for that is very simple. And you need to pay attention to this one. Any time you mention a path, if the path begins with that slash, then it doesn't matter where you are in this question. Your current location is not very important. What matters is you are giving the system the absolute location based on the hierarchy. You are mentioning the full location, the full path. In other words, if I go here in my current directory, one way to create a file is just say echo hello file one. What if I want to do this is the absolute way. I'm going to say echo hello. But now I'm going to mention the absolute path. That means starting from slash home slash file two. The end result in this case is the same. There is a file in my home directory. The only difference is here where I mentioned file one, I did not start with the root. This is relative to where I am. And here I mentioned the exact location. Any time you want to be sure about the location of file system object, you can start with slash. Then you know for a fact exactly where that resource is. So for instance, right now, if I say I want to see what is in file one, very simple command cat to catalog to read a text file. And it works. If I change my location to another folder. And if I say cat file one, that's probably not going to work unless there is a file called as file one in that folder. It is able I don't know where that is. I can always mention the exact path, the full path. So in that case, my current location has no meaning. What the path begins with. So this is called as absolute path. And there are many other ways to mention the path relative to where you are. So other way to think of that, I'll give you some time to now try this out. But the other way to look at this would be, yeah. Colorful, please go ahead. Hi, good morning. You have to be found that already. Oh, no, no. Can you change the part? Sorry, I missed that part. But you changed the part to it. Okay. Makes sense. Good. Anybody else? What you're looking at is very important in the Linux Unix world. Where something is located. How do I mention where something is located? Recommendation is simple. When in doubt, start from the slash. Start from the root. Let's have a look at the whiteboard and understand that better. So let's say, can you see my whiteboard? Can I get a quick thumbs up? All right. Thank you. So let's say under the root, we have a folder. Under the folder home is the folder date. Under the root is also the folder war. And under war is a folder log. If my current working directory is home. How do I refer to the other locations? First of all, I can refer to home, which is my current location with a dot. I'll explain that in a bit. That's a current location. If I want to refer to a directory under home, I can just say, for example, CD data. Where does it assume data is? It assumes data is under my current location. That works. I can also say CD slash home slash data. That will always work because I'm giving the full absolute path. How do I change to the log directory? If I want to give the absolute path and just say, CD slash war slash log. That works, correct? Important thing is I started with that. But if I don't want to give a full path starting from the root, I want to give it relative to where I am. How do I tell on the file system that from here we need to go up and then go down? For example, how do I go from home to the root? Let's try this out. We're going to do this right now. We're going to create a simple structure and we will try just maneuvering and moving around. Can I request everybody to make sure you are in your home directory, please? Just type CD. Make sure you're in a home directory slash home slash student. Any of you know this? How do I go one step up in the hierarchy? CD dot dot slash. So if I do nothing else, CD dot dot simply means go one level up, correct? Yes. So I'm here in the home directory slash home. From here, how do I go one level up? I should be in the root. There is no further up to climb. This is it. Let's go to our home directory. From here, how do we go to the var folder, which is under root? Remember, we are two levels below root, right? Where will that take us? From here to here. So let me first of all just do a quick print working directory to prove that I am in the student folder under home. What happens if I do this? What does that mean? Who's space is that? Take me to the root, correct? And then slash var. Now I'm climbing down the hill. All the way up to the root. And now I'm going down into slash var. Let's have a look. From slash var, exactly the same way. How do I go into the home student folder? Not giving the full absolute path starting from slash. So what do I start with? What do I say? One level up. That will take me to the root. And then down. Can you please try this out on your own? Make sure you are comfortable navigating around. Try exactly what we have done. Please move around a bit. Once we are comfortable with navigating, then we're going to move into all sorts of commands and working on the system. But this is the basics. And you will realize what happens when you do or give spaces. No spaces in the path. Keramang as you do CD dot dot. You know why I said this is not a spectator sport. When you watch it, everything works. When you do it, nothing works. Great. I can see that works. Austin, are you back with us? Is Andrea just checking? Yes, I'm here. Give it a try, please. Exactly what we are trying. I think I did. Yeah, I was following. An old trick. Let me see if that works. CD dash. It just takes you to the last folder you were in. Just CD dash. Just takes you wherever you were earlier. It's a quick way of jumping. All right. Could you please come back to your home directory? Let me also show you the use of dot. I want to copy. Something. Let's say I want to copy some file. What's missing? If I just say, hey, I want to copy this file. It's not happy. It says one parameter is not enough. I need two parameters. You want to copy it. I just want to say I want to copy it here where I am. One way of saying where I am is just a single dot. I hope that's clear. Dot dot is the directory above. Dot is the current directory. So when you do this in your home directory now, there should be a hosts file. Could you please try the same? Copy the ETC hosts file into the current. That should work. You should have a hosts file in your current home directory. Please give it a try. Here dot means current directory. And take a list wherever you are. You should have that file. Brilliant. I can see it works for Austin. Works for Keramon as well. Faith, give it a try as well. Faith says she's coming back. I can see her working. Maybe it's the spirit within the body cells. Works for Faith. Works for Austin. Brilliant. Works for me too. Don't forget. What if I was... Again, this is just a demonstration. If I want to copy that host file, what happens if I just put that tilde? What does it do? That represents... The home directory. Yeah, that represents my home directory. But that would fail because of... We didn't have a file like that. Did it say that? No, no, just take it on your site. Yeah, yeah. Do you see it saying that here in my terminal? No, it didn't. Linux generally, and Unix in particular, doesn't question you a lot. You are responsible for your actions. If you want that friendly option, please try this one. Minus i. What's the difference when I do minus i? Now it cares. Otherwise, it just does what you ask it to do. Now it asks the question, hey, do you want to override? So what happened? It overrode... Imagine doing that under the root privileges. I told you why we call that as the CV updater. You can wipe a system clean with one wrong command. Is there a way of falling back? That's easy. All that's done is done. No, what's done is done. Fall back is update your CV, sir. Sometimes, and we will see this later on, we will create aliases that make it a little bit easier. You can try this on the terminal. And I'm going to talk about this because it's a very important point as well, related to commands. Do you see some aliases here? LL is the same as this. So maybe I can create an alias that says CP is the same as CP minus i. Now, if I repeat that command, sorry, if I repeat the simple CP command. Oh, it's doing something helpful. How long does it keep the alias full? This is temporary. It's a temporary environment, unless you put it in some files which make it permanent. Okay. It then forgets. The shell is a programming environment. You can program it either temporarily or permanent. Can I recommend all of you to try this out? Check the current aliases, create a new alias. And then try the regular CP command. And see that it is automatically adding the minus i. Even if you don't do it, the system's doing it for you. Pay attention to the quotations. Quotations, spaces, cases, these are all very critical. Sorry, GP. Minus i. Just a question. Go ahead, please. Okay. Just a question. The up arrow and the C, why does that happen? That happens to me a lot and I don't always know why or understand why. Not sure if I follow the question. Third line from the bottom, right? With the CP override, home student dose. And then at the end of it, it's an arrow up and a C. Why does it do that? Let me just look at your screen. No, it's on your screen, actually. Okay, hang on. Yeah, at the bottom is third row at the end. The up arrow and the C. Ah, that is me interrupting the process. Control C. So what happens is when you're reading documentation about Linux online, you might see a screenshot like this with a Control Z or a Control C. So Control C is your best friend. When in doubt, if you're stuck somewhere on a terminal, just press Control C. It basically interrupts that process if you're stuck somewhere. Here is an example. I don't know if it's going to work. Let's say sleep for 100. Literally, I'm asking the terminal to go to sleep for 100 seconds. Okay. Or I could just do Control C. To break that process. 100 seconds of sleep, basically. Lissandra, is it clear? If you're stuck in a loop or a process is taking very long, then you can... It's like end task of the windows world. Okay, I see. So you get back to your terminal. I lost you at the beginning when we did... The alias? Yes. Before we got the alias, we were asking to overwrite those. Yes. So after that... That's all right. Let's just quickly have a look. So when you... Go ahead, Austin. Now, I was asking the command to Jeff, are you then reversing the alias? No, I'm reversing it. Is it only going to focus on all of the only aliases or can you specify which one... I specify the exact one. So Lissandra, this is what we were trying to do. We copied some file from the ETC folder into the current location. Now, if we repeat the command again, it seems to not care. It is just overwriting the file again and again, which is typical of Linux. They don't always question you a lot. If we use command like minus i as an option, it seems that it prevents us from overwriting. That sounds like a good idea saying, hey, this is going to accidentally overwrite the file. Would you like to do this? Yes or no? So maybe we want to replace that every time we type the command CP, it actually executes this one with this option. For example, I always like to do LSLTR. This is my favorite way of taking a list. If I just type the command list, it says, well, there is no such thing. What I can do is I can make an alias where I can say list equals to LS minus LTR. I'm just making a shortcut for a command. Keep in mind, as I mentioned to Austin right now, this is just temporary on this level. Now, if I type the command list, it should execute that alias. And I can also double check the aliases currently on that system. You can try this out, please. And that should work. I'm sorry, I just want to see the alias list command that you used. You think command just try exactly the same thing, Austin? Just type an alias and the alias you created. An alias and the alias you created was list, right? No, I mean that list, yes. Then you just say CP, right? An alias CP. That's the one you created. So CP will be replaced with the CP minus I. Alias is just make your life a little bit easier. So Karamang, you're experiencing something on the shelf. You started a quotation, but he did not close the quotation. When you press the enter, you started seeing weird new lines coming up. And you said, let me get out of here with a control C. Which is fine. So that's a perfect example of when to use control C. You might have to unalias it. I think that alias never got created, right? Because you did control C. Yes, but then I just typed it. You tried it again, alias. Ah, too many spaces, Karamang. You love spaces, get rid of the spaces. After list. That's why you have to look a bit more carefully. It's just pretty small. I meant in general. There is a space after list as well that you want to get rid of. Now you know. Watching it is the easiest thing to do. There is a T missing before you press enter. Missing windows already. I'm just out of curiosity. Yes. You can just mention the path of anything. So that will kick off that particular script. It doesn't matter what you're executing. Are we all good? So that's alias can be handy. However, this ties into a very important concept, which is. When we are executing commands, where are they actually located as executables? Let's have a quick look at that. Give me a quick second. Hello. Yes. After. From. Sir, bye bye. I'm in a meeting. Thank you. So there is an interesting command called as which. And what it shows is that the command Alice that you're executing on the file system, where is it found? And turns out it is found in the bin or the binary folder. What if I look at tools which are meant for let's say. The administrator. System administration tool. This system administration tool is in another location called as S bin. Basically, this tool. Sits in a folder which contains like management tools or administrative tools. Now, why does it matter where something is located? Well, one is that it gives you an indication that this is not an average system shell. But this is mostly a command for the administrator to manage the system. Also, sometimes if there is an alias, you can ignore it by directly executing the command from where it is. Let me show you what do I mean. I'm going to show two quick demonstrations here to get. The first thing that I'm going to do. Is I'll just keep two terminals just side by side. In the first terminal. First up. Let me look at the aliases. Let me create an alias. CP equals to. CP minus I. And I can prove this that. Now, if I copy. Something into my current directory, you can see that it is asking, hey, do you want to override? So clearly the replacement of the command has worked. But what's this? I want to know where this command actually is and directly run it like this. I mentioned the full location of. What happens when I directly run the command from a location? Let's see. Does it care about the alias anymore? No, it doesn't. But if I run the command CP again. The alias is working. What have we learned? If you want to be 100% sure. That you're not using any shortcuts or aliases, you can always mention the full location of the application that you're executing. Because sometimes these aliases can be annoying, but we want to temporarily avoid them. Does that make sense? This is temporarily avoiding the alias. If I just run CP, it will be replaced. But if I want to run CP without this alias. Austin, I don't have to unalias it. I can keep the alias just temporarily run. But how do I know where does the binary exist? So guess what? All you have to do is this command. Can you try this out, please? Just to ask, just one thing. So most of the commands that you normally use, like your list, copy and all of those, they are all sitting underneath that path. In bin, in binary directory. That's correct. In bin. Under USR. And the administrative tools are in SBIN. Please give it a try. I'll be back in just a minute. And back to you all. Let me check out how things are. So very nice command. Which, where is this command located? In which folder is the command located? And quick short summary. Typical system tools are in the user bin directory. And administrative tools are in the user SBIN. And again, at any point in time, if something is not clear, please ask. We explore a little bit more of the fundamentals and move into the other aspects of managing or working with the command line. OK, I can see this is working for most of us. All right, back to my terminal. A few other quick basics on working on the system itself. Maybe we have seen already how to identify some basic parameters. Maybe one of the other things we want to know is who are we? And there is a very nice command. Who am I? And it says you are student. If I write the command ID, it tells me a little bit more about my user. What is the ID of my user? And what is my main group and other groups that I am part of? So it gives a little bit more details about the current user account that I am in. Very handy command. I can't wait until you show us if you are root, if somebody is suited as root, right? And yes, can you if you are suited as root, can I still write the command that will show me my home? Home account. If I am suited as root, can I remember what my original username is? I am looking forward to learning about that command. Sure, let's just take it out right now. So right now, who am I says I am student, correct? And my ID shows 1000 as my current ID. And if I try to run some tool to manage the hard disk, it says OK. That's the tool. And if I try to actually work on the disk. Let's try something. I'm going to switch using the sudo tool. I'm going to run the shell and that shell will have the privileges of the root user. Now, if you do sudo bash, I think we can notice first up that in the profile, the way the prompt shows on the terminal gives me an indication. Also, it tells me I am root at the rate, the name of that system. That's another indicator. What if I say, who am I? It says, well, right now, you are root. If I type the command ID, it says you are root. The question that you had was like, who I really am. Try this one. This is like literally shouting at the system. Who am I? And it is fine. You are student. Give that a try. Linux is fun, isn't it? So you must shout if you want it. Yeah, please don't tell to others. What did you learn in the class today? You have to really shout at the system and then it will give you the real information. Yes. I mean, that's one way of remembering it. You literally have to shout at this. Hopefully that answers the question. Yes, it does. Yes, it does. Can it be used in scripts? Anything and everything can be run in script. Script is just a shell environment which is programmed to execute. Anything and everything can be in a script. And I'm happy if we can continue. Many things you can do in the system. Linux is still programmable. So hopefully this tells us again who we are and what we are executing the command as. We know a little bit about now the options, the idea of commands and options and printing our identity. Let's try a few other simple commands just working on Linux as well. Just familiarizing ourselves, so to speak. Since we are still working on the file system, let's just also have a look at just the idea of creating links. I think this might be a bit handy. Let's have a look at that. Then we look at the file system like copy and move and all of that. We can quickly try this out since we are already onto the file system and a little bit comfortable working with the commands themselves. So some basics. Let me switch back to where I was. So I have a file here. First of all, I can just make sure that I am exiting out of root. Just making sure I'm back as a normal user. I'm happily sitting in my home directory. I can execute as we saw different commands and I can create some files. So for instance, if I have a quick look at this file. And I think we currently have a host file already in our home directory. So I already have a file in my home directory. So what I can do here is I can create what we consider as links and we can create links. We have to be careful when we use the word link because it's not exactly how we imagine it works in the Windows world. Let's give that a try. I'm going to use the command LN and LN says make links between files. Careful, folders are also links. So when it says files, don't just think of stroke. Couple of options. I'm going to try them out and here is an option that says minus S symbolic links. Let me explain. So I'm saying there is a file hosts already and I would like to create a link to it. I will just put a little asterisk so any and everything that starts from hosts will show up. I can also put it in. It may not be very happy with that, but that works. So if you just do what I have done right now, which is make a link from hosts to new hosts. And you can kind of see that here. It actually says this one points to that one. If I read this file, cat or more or any of these tools will work. If I read this, it displays the content. So that means we can say that or we can argue that the shortcut is working. When I work on this, it reads from there. Just a quick question as you try this. What happens if I delete the original file? The link will still be there, but there will be no source. So it wouldn't work, isn't it? Yeah, it wouldn't work. I'll just wait for you guys to try this part out first. Make sure you are a student, not as root, not as root. Call a fellow. Thank you. Are you awesome? She wants to be fired. Hey, it's not a fire. Maybe, you know, just looking for a promotion. We do need to scare people away from root. So I believe the shortcut kind of works, right? It just works. And faith, I did the star host star because any anything it starts with. And in the middle is hosts. So that will give you both the files. So you made a mistake with the source host faith. You mentioned the source as host, not hosts. It still followed your order. It said, yes, sir. But the trouble is the original file doesn't exist. The terminal is very kind to you, showing in red. I wish things were like this 30 years ago. Green and red, but doesn't exist. You can repeat the command again or just pick another file. Yeah, so if you try faith, you're going to get an error. Try to read that file. It's fine, which is the perfect example of what we want to show. So here. I have the host file. The new host file, which is a link. Starts with an L. What happens if I remove the host? It's not very happy. Of course, if I try to read it, it doesn't work. So there is another concept. Which we call as hard links. Let me explain what is the hard link. Suddenly you won't have to read too much about it. The idea of the hard link is something like think of the file as a room. So let's take a room and. All right, let's take a room and paint it blue. Now, if I create two doors in this room, does it matter which door do I enter from? What color am I going to? Doesn't matter, right? I enter the same room, isn't it? It just has two doors. This idea is called as hard link. If I close one door, do I have another? What if I create many doors? How many doors I need working to access the room? Minimum one. As long as there is one door you are in, isn't it? This is the idea of what we call as a hard link. Let me show you. OK, I'm going to copy the original. Host file. And to the current directory. I'm going to make a link, but this time I will not use the option minuses. I will just say host host one. Do you notice there is a number here which is incrementing? Now it is two. What do you guess that number two is? Think of my analogy I just gave you right now. Two doors? Absolutely, these are two doors. What if I keep saying, Ellen, host one to host two? Look at the original file. Three. If I get rid of that first file, that's OK. We still have two more doors. And it will still work. Can you please try this out? This is called as hard links. You can do that in Windows as well. Just to show you the concept. Please give it a try. CPE slash host. You got it right. It's important that we try things out. So if you make mistakes, we learn from it. It's under ls minus l host star. So you see all the files where the name begins with hosts. I'm not sure if I was supposed to press enter because I did. And then all of these came up. After cat there is one. Right. Just looking at what you. Yeah, yeah. So this is the content of that file. Yeah. So cat is just a command to read a text file. So one command that generally comes in very handy. We will have this here as well. Is this. Just this file. If you want to know what type of file something is. Have you noticed in Linux we don't really have extensions. In Linux there is nothing called as file extension. So I can literally create a file like this. The only trouble with that is. If there is a file, we don't know what is in it. Here is an example. What type of file is this. This is an executable. What type of file is ETC host. That's a text file. What type of file is my file is so cool it's empty. So the file command is very handy in knowing what is the file. What type of file it is. Is it a PDF? Is it an image? Is it text? Since extensions are not really a thing. I like that people are creating the file exactly as I said. My file is so cool. Appreciate that. Okay. That's fine. Can we create it with our own. Yeah. No need for extension. There is nothing called as extension. So if you are looking at something and you don't know what it is. Use the file command. Of course, please use the tab to autocomplete. If you are writing the path. If you are writing a command. Just use the tab. It will autocomplete. And it reduces the number of errors. Just under file and extensions there, right? So if you want to create a file for PDF as an example. How would you go about creating that since you are not including the extensions? Because most of the time I've noticed that. For me I always just take a shortcut. I just find a file with the same format and then just copy it to use it. But I've never actually created a file with a different file extension there. Yeah. So the only thing we can create is just an empty file or a text file. Other files you will create using applications. Nothing different there. But these are the basic things that can make it very confusing when you work on Linux operating system. It looks very different than the OS windows that you are comfortable with. Yeah, that's true. Extensions are a very big thing on Windows. So now if you don't have them, yeah. Sometimes you will have them. Sometimes you may not. So that's cool. All right. So that was a little bit about the links and a little bit about just navigation generally speaking. Let's just work on the command line a little bit more so that we can do like copy paste, just move things around a bit. Manipulate the contents a bit beyond what we have just seen right now. So we'll just have a quick look at the copy, the rename and other things so that we feel comfortable with that process. All right. Back to my terminal. So we are comfortable moving around. Again, I'm making sure I'm a student. I'm in my current directory. First, let me very quickly handle renaming and moving because the command is same. What does that mean? Let me create a file. Data one. If I say move data one to data two. MV is not moving it because there is nothing called as data two right now. So MV says, OK, in that case, you want me to rename it. I'll rename it. If I say MV data two to data three. It does the same thing. It says there is nothing called as data three here. So most likely you want me to rename it. I will rename it. Wait a second. What if I create a folder called as data five or data four? And I say, let's MV data three to data four. Something is different now. The command is the same. But what is different is what I have mentioned as a destination actually exists as a folder. In Linux, a file or a folder cannot have the same name in the same location. So if I do this, what it has done is it has taken this. That is my data four. You can see that that folder now contains this file. So it's the same command is for renaming and the same command is for a move as well. The key here is, does the destination already exist? If it doesn't, it just doesn't. If it doesn't, then it's a move. Because the fundamental idea is that you cannot have a file or a folder which has the same name. Here is an example. I'm going to create a file. I'm sorry. So you say you moved that file into the folder. But if you already had a file or had a folder with the same name, what would have happened? For example, if you are moving the data three right into into data four and I need a data four folder. You already have a folder named data three. Same as before. It won't it won't bother unless you do the minus i. It just won't bother. It will override happily. So minus i is your friend with these commands. Okay. Careful with that one. Okay. So let's say I create a file called as July. This is a file. I can verify that, right? There is a dash here. It's a file. What if I want to create a folder called as July? Should it allow you to do this or not? No, it shouldn't. So there's the same thing. Because a folder is also a file. In the Linux, everything is fine. So you get a very confusing message, right? Cannot create a directory because the file exists. And then you'll be listing and not seeing it. And you're like, where is this file July? I don't see it. There's no other folder called as July. It's just that we cannot have the same name because the system treats them as the same. Just something for you to notice. So that's MV can be used for rename. Can be used for a move. You can also obviously use commands like CP. Call a fellow. Please go ahead. Before we move on. So what if I touch July dot extension? Like maybe CSV and I make a folder called July. Will it still be the same? Yeah. So the idea here is good that you mentioned it. If a folder already exists. Let's take an example. This is my current home directory. I see there is a folder called as the. Or data for. And I have a file here as well. Right. So let's take an example. You can see this. I'm going to start scratch. I will just do something very quickly. I will get the host file in the current folder. And this minus this host file works all as well. What would happen if I touch this file right now? The file already exists and it has some content. Any guess? Overwrite this file. Not really. It will only update the date and time stamp. That is a non destructive command. What happens if I touch a folder that exists? Same thing. It is only going to update the timestamp. If you create a file first. It won't let you create a folder with the same name. Because another file exists. Does that answer your question? I think. Let me try it out. Try exactly what you see. Same for the others. Feel free to try. And I appreciate the questions coming in. Okay. I know you can't see me. But I'm shaking my head vigorously. Linux is fun. It takes a while for you to warm up to it. But it's all right. Let's try a little bit more just on the file system. Similarly, let's just have a super quick look. And how you will copy things. We have already seen CP. But as we work on CP again. I'm making sure I'm in the current location. By the way, you can make an entire directory structure with a minus P. For example, in the current folder. I want backup. Slash. Files slash January. So what it does. Is this just creates the whole path for me. I don't have to do it step by step. It's kind of nice. When I'm doing a copy, of course, I can use the wild cards. Can be useful. For example, I can say, let's copy from ETC. Anything that ends with the dot com. So multiple files might match this filter. Where do I want them to go? I want them to go into my backup files. Jen folder. Just a quick copy. What if I want to copy a whole folder? It says I don't like copying folders till you mention minus R. Fine. We will mention minus R. Recursive. I have two folders. So that's a simple example of copying files and folders. Please try both. Can you please go up a bit? Let's see if. I didn't miss anything. Yeah, there was one folder path that we created. Yeah, which is that. That's one. Good works for this Andre. Call a fellow. I appreciate you guys doing everything with me live. Yeah, Mohammed trained as well. He'll be back with you. Don't worry. Just we're not complaining. We're not complaining. That as well. If you see any errors, just revisit and one more suggestion. Use the tab to auto complete, especially if there is a path file names backup files. Is there a folder like that? Yeah, should be Jen. And then later on, you're copying that folder to another. I'm just one thing. What would cause a delay? When you're in the training room, I'm struggling to see your screen anymore. I think we still see connecting and connecting, but it's not showing up. Is anyone still in the training room? That's true. That might be a network issue, right? I'm just trying to refresh. Yeah, I did that. I just want to do something. They can fall. I mean, we should think to a different browser sometime. Could just do the trick as well. Okay, I just need a second. I can see it works for everybody else. Yep. Wait, so minus R is forcing it to do it for a folder as well or a directory. Yeah. Austin, let me know if it works. Yeah, let's switch sometimes. All right, let's copy and move a little bit. Some other file system level tricks. What if you want to get rid of things? So we have the command RM. Thankfully, it does not assume anything. It says if you want to remove, well, what do you want to remove? Maybe I want to remove a file. No questions asked. Maybe I want to remove all the files that begin with hosts. No questions asked. What if I want to get rid of the folder? Doesn't like it. Hey, it's a directory. Okay. How about now? Well, that is fine. If you insist. We'll get rid of that. Give it a good go. And it can't remove what you don't have. So I can just do LS minus L to see what files you have. You can remove something that exists that you created. I have data three file one file two. Good for most of you. Right. That's frankly more on the file system. And then obviously there are lots of tips and tricks in terms of reading the files. We're going to try those out as well. There are some other just I would say shell related tricks. Simple things that you probably can try out. If you remember that was the command date. This was the who am I. What happens if I do this? Wait. And who am I? Executes multiple commands at once. Nice to get many things done at the same time. We can execute multiple commands. And there are other interesting ways to kind of chain the commands together. Do the second one only if the first one works or do the second one only if the second one or the first one doesn't work. There are many ways to chain these together. But that's the easiest of all just in terms of executing kind of commands together. And I may have executed many commands earlier. I can have a look at the history. And it's a long history. And maybe I can repeat some command from the history. Let's say my command number 174. That I copied a file. So I check the history. Just do that. I write the command history. Figure out a command I would like to repeat. I can just do exclamation mark and put that command number. Saves time. Nice one. But first please check your history before you execute. Type the command history first. I can't hear anything. You guys are getting nothing when you do history? I'm saying I can't hear you. So I don't know what I'm doing at all. What I need to do. Wait, can you not hear me? Oh, is that history? No, we couldn't hear you. Okay, now we are back. I said write the command history first. To get the list of all the commands. And I picked one of the commands where I was copying a file. So I executed that command again. Just by writing exclamation mark. Don't do that. Because it's your history that you need to follow. I think she wrote line 144444. That's a very long training course. Just have a look at my output. I just did a bit of history. Any command. Let's say there is a command that says who am I. 199. I can just repeat any command with an exclamation mark and the command number. Pick a command of your choice from your history. So that's kind of handy. And again, just repeating anything that you might have done before. And saves us time. So there's a bit on the file system. It's also a little bit also on just working with the history itself. And then comes in working with the text command and so on and so forth. What's a good time for your lunch break? Typically, is it now? I'm happy to have a lunch break. We're squeezing just another 30 minutes of this time. That's about 27 minutes. You want to carry on for another half an hour? Half an hour is too long. 25 minutes. Oh, wow. That's such a big difference between 25 minutes and half an hour. I'm learning things about South Africa. I thought I didn't know. Five minutes is a lot. Five minutes is a lot. Yeah, yeah. It's a mind thing. Don't tell us 30 minutes. Five minutes. Yeah, that is very true. And I have clients that I work with and there are amazing people sometimes I work with. There is a meeting invite that they send you. They send me like a meeting invite. Three weeks from now. And between now and then I'll receive at least 10 changes of the schedule time. Up until like a day before it. I'm not entirely sure what the purpose of sending the invite out was. It's just to make sure all the resources invited have that exact opening. Yeah, you can't say I didn't know. That's it. Yeah, we told you a month ago we're going to meet sometime. That's it. That's good enough. Work with it. That's fine. Happy to carry on. So that was a little bit on just in terms of tips and tricks on the show. We're going to see a bit. Hopefully we are comfortable with the navigation of the file system itself. And frankly, every single command has many options that you can explore. And that's part of as you work with the system. We learned based on what we need. So we don't open the main page and read the 10 million options. We go based on the task at hand. If needed, then we look into the options and we learn more about the options. So this is more about just familiarizing the file system with the shell, the way to move around and so on and so forth. OK, a few more. Go ahead, please. What is the command that you screened at the machine there? Because the way I'm typing is not going through. Are you writing it? No, not that one. The shouting one. The who, M, I? Who, space, M, space, I. That's it. Don't type that. Let me check. OK, thanks. The one we equated as shouting at the system. Wouldn't do much if you're already signed in and that you're not going to see anything. Oh, it didn't show anything. That's why I was asking. They say what is this would make it like that? When you are switched to another user using Sulu and other tools, then it will show you the original user ID. OK. OK, now look at that. All right. Working with, as we are currently on the file system, just a quick look at how do you work with text files. First quick reminder. The command file can tell you that you are working with what type of file in this case, a text file. We have many commands. So let's check out, for example, this file. ETC password, which contains everything except passwords. If I want to look at that file. I can get it. Basically, it reads the text file and shows it to me. But if it's the long file, it just kind of runs through the screen. Instead of cat, which is good for small output, I can use the command more. Which allows me to read the file kind of step by step. I can press enter or space. Here I'm pressing enter. Line by line or press space page by page. And this is just an example of reading a text file. So we have cat for things that fit in a page. If it's a Musbiger file, you can use the command more. If you want to read the. Let me try this out. If you want to start reading from the bottom up, you can sort it out. We have cat, we have tack. This is literally the opposite. So here tack reads from the bottom. Cat reads from the top. Each has its own advantages, what you want to read. Sometimes, for example, if I say cat slash hosts. Or if I say tack slash etc slash hosts. I start from what was the last entry. Maybe that's what I want to see. In many Linux configuration files, we make changes by editing the file and making some entry into it. So for instance. Let's take an example. You can try all of these commands, cat, tack, more. One of the very useful commands is the one that counts how many lines are in a file. Here is WC word count. If I just press enter and I write some. For example, this is sentence one. This is second one. There are 12 words. And if I do like control C or control D here, end of file. Control D is end of file. You don't see the control D that I am doing. What word count is doing is taking the text and saying there is one line. Four words. 18 characters. So what if I do word count for an existing file? Let's say etc hosts. Hosts. I just want to see how many lines. And it says there are 14 lines in that file. In Linux, many commands on their own don't make a lot of sense. Like why would you care about this till a day you care about? There is some use and you're like, oh, I wish I could count the number of lines. For example, how many users in this system? Well, I know that this file has one line for every user. So this tells me that there are 50 users defined in the operating system. So counting can be very handy. If I want to read the file, I can use the command more or the cat to read. Remember, this is for text files, not PDFs, not executables. We are looking at text only. You can try this out. It doesn't work on executable. The word count, because this is for executables. So executables like binary files, this won't work. You will see each image. Your terminal will kind of freeze. Happy to show you that. Let's try to get the second session. And then. Sorry, could you could you say it again? No, I didn't want it to freeze. I tried on the PDF. Yeah, it won't work on binary files very well. It's for ASCII text. Faith, after you write a couple of lines, press control D. Control D is the character for end of file. OK, thank you. That's OK. Back in a quick second. Just underneath yellow, how are you? Those numbers, what are those for? Because I know it reads how many characters are there. But the 1 and the 4, what are you going to do? Say it again, please. On the WC, right? In the last sentence. Again, you do the control D to count the number of characters. And the total weight is 80. So what does the 1 and the 4 actually represent? Because that's where I'm lost now. Oh, the WC dash L. Or the 1. I don't know. The 1 and the 4. That's what I want to understand. I think it's one line. It's one line, four words, 18 characters. Oh, four words. OK. So if you do it again and maybe have multiple lines, it might return. Because I didn't do a different thing. You gave me five. One, two, three, four, five. Oh, yeah, I should write. I didn't completely do the other sentences. I did. OK, thanks. I don't know. OK. So I WC then wrote two lines. And control D, I get. It seems to only count at the last line. Let's see. Let's see. Color. Yes. No, what do you say you counted? So I run around the command and I wrote two lines of what? Not two lines. And then the count only return the last line. Is it? All right, so back with you guys Yes, press enter press enter go to a third line and then do the control D What is the definition of a line Anything after and anything at the end there is a carriage return CR IBM terminology We need a carriage return. We need an enter for it to be registered as a line. So guess back in the Unix days Administrators will edit a configuration file Type a new line at the end of it save it and the system later on will generate an error And you will read the file through the cat command and you're like what is incomplete about it What it won't tell you in simple English is a man just go present Austin now try control D So I mean it's improved quite a bit in the new generation of operating systems but back in the day this enter was Let's put it this way. There were 10 million ways of me. So that's why Austin, you know Unix Administrators will look down upon the Windows administrators saying you guys are just clicky clacky. You don't know anything So I'm just also suffering Unless you know the true hierarchy of how the kernel works. You're not a true admin. Yeah, that's look There is some truth to it, but then it's about being productive Hopefully that answers the question if there was a question in the first place Yes, even this the shift and I also get recognized Right, so that's a little bit of cat and more and word count and all of that Just from the file system and working from or working with Text now why we care so much about working with text. It's because a lot of not a lot pretty much the system Configuration is spread across in text files So in back in the day you would have to know every text file where it is and for what purpose What changes have to be made into it today? You use graphical tools to do administration, but behind the scene Many of them will go and update the actual files hence the You need to know how to work with text file was an important bit Still to some extent still very true So for instance Let's have a look at this file And this file simply has a mapping for your own network engineers So I have the IP address and a hostname And if I do let's say Let's try The current hostname Let's look at the existing host file That works and if I ping DD node That hostname works as well If I want to add another local hostname entry for that, I'll have to edit that file So working on text files kind of an important aspect at least from the configuration perspective for instance These days you're gonna find Graphical editors, so let's choose like nano It is a player again Is it the audio or the interface? No, it was only the audio the interface is still there, but I can hear you again Okay So I hope you can still hear me Let me know if I am audible a quick thumbs up would work. Yes Yeah I'm just a clip one. Yeah, just you access the GNU there The graphical editor, yeah, yeah, I'll just show it again. I'll just show it again So, let's say I create just an empty file file X I Can use a graphical editor like nano, let's say I mention nano file X. I Type a few things in this And again for others that character means control So control X is exit Control K All of these are shortcuts here is a control X do you want to save Yes What's the file name file X and let me read that file? Okay, there's gibberish in there, but can you just do exactly what I did? Just create a blank file use the editor nano to open that file Type something in use control X to exit save Once you are back just verify that the file contains that content The nano is a friendly tool. There are many such friendly text editors. I Have to be honest. I am not used to the friendly text editors. All I know is the super old-school I am also not very familiar with Friendly, yeah, yeah. I am I feel uncomfortable in friendly editors. I'm much more comfortable with me But it's a matter of what do you start? Can you do like a line come to it man on There's a lot you can do with VI as well That colon set and you Million things you can do with it again We I the only reason someone like me would prefer me I because that kind of works in every distribution that I work on So when I used to work on solaris it worked their HPU exit work there Every flavor every distribution of everything. I know that that classic tool just works Control I Have saved buffer as an option as well as you're working an existing file you can just say I want to say Or actually I don't know what I did that time but you didn't give me that option anyway Yeah, yeah, I don't know what I did that time but it's fine. All right that works for you. How about the other? Please give nano a quick try if you're already used to it and you use it on a daily basis, then it's fine But showing you that there are text editors Nonetheless and depending on the distribution that you're on you might find some tool You have no no you have G edit there are many tools Again they all range in the level of Friendliness and then the commands that they support Just pick the one that works for you if you don't want to deal with a million command something like nano and G edit I can give you I can give an example if I work on I don't know if you can see my screen if I work on I Was I have to type I to insert something right? Yeah Let's say I accidentally said today is 91st, but what I wanted to say was today is 19th Here I can Work Go here escape XP I can just quickly transpose if I need to How many people need to switch the two characters I Want to make this 32 Yeah, I can I have many tricks in vi Oh But then well not everybody needs those tricks So Let's come on so please pick a text editor that But you can install some of these but because Nano is already there that kind of fits the bill So various different text editors which can come in Is this the time for lunch or we are on the 26th or 27th minute I Can see you guys enjoy meetings quite a bit Question All right, so we take a break now I think by now we have a Fundamental level of comfort just working around in system. We come back We look at more commands other things on the command line that make our life a little bit easier Will be coming back in typically is it 45 minutes All right, nobody's saying anything so it's 45 minutes Oh Fair enough are you taking advantage of the fact that I don't know We do that with us It's in the SLA is it okay All right, it's part of our KPI is it all goes on I get it. I get it. I Live it I live and breathe in the same space that you guys do I'll probably sign in again later. Yep makes sense I Oh my god! Who put this here? They put it here to see the curtains. This is the food and the other one is the lift. This one is for drinking alcohol. The delivery has started. Follow up press 2. The delivery has started. How did it come so fast? It was their field trip today. But now they come by themselves. That's why it takes so long. Did you go to the washroom? Yes. Let's go. Oh my god! Oh my God, what a cold girl! Surprise! My... There were only four children in the bus. Really? For the children. What do you mean? Like, there were only four children. Were there four children in the free trip? No, there were four children in the bus. Okay, to take you guys there. Yeah, that's right. Can you please wash your face? I need water! Good job. So, after we came back from the free trip, it was practically free for the whole day. She was not to make a study and she was outside and she didn't care. Like, me, Ethan and Parneka were playing ball in the corridor. She didn't go in the corridor because in the fourth day, I think some teachers had a meeting. So we weren't allowed to go there. No. I don't want to go to the park. Will you come? Can I take a picture? Yeah, put up when I just come. She also needs to know. But you won't come first, you'll eat and then you'll go. So, me, Parneka, Ethan and Parneka were playing in the corridor. So, Parneka threw it and it hit Ethan's head. It went like this. It hit here. It was so high that it bounced off. And it hit Royce, the sixth grade footballer. It hit his ear. And we were like, who did that? And he went down to pick up the ball and his trousers split. It was so hilarious. Then his trousers split. Then we ran. We went to the staff room and we couldn't stop laughing and laughing. And then when we came back to class, I was like, why are you in the sixth grade class? I was like, why are you laughing so much? I was like, why are you... Till you wash and come, I'm not discussing anything. So, I have to do my night right now. I promise I can go to the park before eating. Before eating? Yes, early in the morning. You didn't eat anything? Did you take something with you? Yes. What did you take with you? I didn't take anything with me. And I also... You finished everything? I finished all the stuff. Okay. Do one thing. Wash your hands. And I'm fine. Wash your hands. Take your aunt with you. Play. Come and take a bath. Okay. I'll have tea. First, check if your aunt is free. Yes, until then, eat your aunt's food and then take her. You can go change your clothes off. Yes, listen. Let your aunt eat first. You go after 10 minutes. Let's have a food. You go after 10 minutes. You go after 10 minutes. Let's have a food. You go after 10 minutes. You go after 10 minutes. Let's have a food. You go after 10 minutes. Let's have a food. You go after 10 minutes. Let's have a food. An ethernet port, a quarantine input, an optical audio out for connecting a sound bar, and two USB ports. The included fiber optic cable is only 5 meters long and isn't rated for in-wall use. For in-wall installation, Samsung sells a longer and in-wall rated cable. Next we have the Slim Fit Wall Mount. Mounting it isn't the most exciting part, but Samsung makes it easy. First, attach the bracket to the back of the TV with the provided screws. There are two lengths. Longer screw for the use with the spacers if your wall isn't flush, and the shorter screws for flush walls. The bracket might seem loose, but that's intentional for flexibility. Mount the wall bracket using the provided template. Connect T1 and T2 based on your TV sizes. Tape it to the wall and mark the start point. Use a start finder if necessary. Drill pilot holes, ensuring they are level, and attach the wall bracket with the provided screws. In my case, I used a magnetic laser level to make sure that the bracket was leveled. The end-to-end bracket length for a 65-inch TV is 42 inches, which you can confirm from using the template or by measuring the TV bracket. I also installed a 14-inch structured media enclosure from Leviton behind the TV to house the One Connect box, with power and two ethernet cables for a wired connection. I prefer admiring my devices whenever possible. Before mounting, I placed the One Connect box in the recessed enclosure, connected all the wires, and installed my Apple TV box. I also ran an HDMI cable through a PVC flex for easy future connections without removing the TV. Then, we mounted the TV. The bracket works like a picture frame. Without these two people, lift the TV, align the wall and the TV bracket, connect the power cable, and place the hook into the wall bracket. There's a magnetic piece between the wall bracket and the TV that ensures that the TV sits flush against the wall. Okay, coming. I can't do it here. So you sit on it. Oh, these are the people falling over. Oh, that's perfect. I tried before. Go around and sit on that. Oh dear, oh dear, oh dear. You sit on it, and then you go... Oh, no, no, no, no, no. I don't know. You don't have to be so comfortable. You don't have to be ready for something like that. So you're there, and that's it. You're just waiting for it to work. Yeah. All right. Sir? Hello? Sir? Okay. What's up? Brand new tiles, son. I have some sense of responsibility towards your house, brother. The general recommendation for TV-mounted eyes is at the center of the screen at eye level. There are only seven children in our class. The other parents come because the trip was excuse. Like the last time they already went for a day one, but that day I came two hours later and I'm over it. Mmm. Okay. Okay. It's not always a term used in the right sense. It could be considered as rude. It's just like a girl who's a little bit more boyish in behavior. Yeah, because if my friend told me that I was a tomboy, I would like to take football and basketball and keep on getting hurt. That's it. And that is rare. We need to learn how to just ignore... I didn't think it was mean. That's okay. I'll just think of it. There, there, there. There we go. That's it. That's it. In the morning. 11 o'clock on television. What kind of video? Because I want to see, No, I don't wanna No, I don't wanna What have I told you about touching anybody's screen now? He was trying to get out of there on the top. And he is calling others. Oh, oh, oh, okay. Okay. It was so disappointed when it came down and there was nothing there. Why is it disappointed or disappointed? It would be like disappointed. It would be like this. Look. See like this. And then you see the second one join the first one. One and two. Look at that. One, two, three, four. And then it was a reflection. This one was hitting him. It's the funniest thing I ever saw. They were sitting together. This one took off. And he pulled him from behind and went down. This is a video from Sanjana. Try going up and down. The door is open. Look down a little bit. But it didn't come down. Both of them kept trying to go from the top. But it could have been smarter than us, to be honest. It could have been smarter. He was sitting on top. Did you get water? You're not coming down. Look at both of them. I wonder how we get out. Well... 30 centimeters down. The door is completely open. They're sitting inside for 3 minutes. How do we get out? What do we do? How do we get out? You're done. The meeting is over. You have to charge your phone and then go out on your own. That's not happening. Will you go with your auntie? You can charge your phone and then go. I'll tell you a funny thing that happened in my school. Surya went to the real park. Huh? Bye bye. Bye bye. Bye bye. Bye bye. Bye bye. Bye bye. Bye bye. Bye bye. Lovely. Thanks for letting me in. Welcome back. Hello. Welcome back. Welcome back. Welcome. Welcome. You're the one who's letting us in. Yes. I think the whole people are late. That thing was come to me. I don't see KG. I think maybe she'll be joining in a while. Just give a few minutes for others to be here. I recorded, but need to drop for a while. I recorded, but need to drop for a while. Yes. So now we are left with Faith and Austin. Faith, you're around? Yes, I'm here. Is everyone here from Cape Town? Joburg, where are you from? I'm from Cape Town. Lisada as well. Coffee time, Faith. Coffee time. She just came from lunch. She's busy with some work. I didn't get a chance to go on lunch. Lunch breaks are for meetings without eating. Lunch breaks are for meetings without eating. Yes, they are for meetings without eating. It's literally the time to just get work done, I can imagine. It's literally the time to just get work done, I can imagine. You're in a call while you're on another call and now you can't keep track of which calls you're in. You're in a call while you're on another call and now you can't keep track of which calls you're in. I can relate. What was for lunch? For those who ate, Austin? Lunch is just the name of the time to not eat. There's no contract, is it? The contract is lunch break will be provided. Lunch is not guaranteed. Terms and conditions apply. It's just time to get other things done with people running after you. It's just time to get other things done with people running after you. It's always difficult, I understand that. Nobody cares, you're in a training. You're not our problem. I think it's interesting that you shared those things with us to be joining in a few minutes. Sure, lovely, that sounds good. Share my environment. Let's see as people come in. All right, Karavan is back. Welcome back. Thank you, thank you. That's all right, we'll just give everybody a few minutes. We might get one more. Give me a second, hold on. I can't see right now. What's the matter? I'll be back, give me five seconds. Hopefully others will just join in. Let's see where we are at. Let's share a couple of tips and tricks. Where is my screen? Hopefully this one. If you could confirm that you can see the screen. We're looking at the different ways to interact with the command line. What I want to share now is actually some of the common tricks on the command line that generally help when you're working onto the system. We saw earlier that we could take multiple commands. Let's take date. Who am I? That was great. We could take multiple commands and run them together. But there are a few other things related to how to work on the command line. And this might come in very handy. Probably the very first concept is running things in the foreground and background. And there are many tricks around it. Let's just give it a try. If I run the command jobs right now, it kind of tells me that there are currently no jobs running. What it is talking about is in the background. Typically what might happen is some commands that take long time to execute something. For example, if I use the command find and I'm looking for a file. Now this command can take quite some time to execute. Right. Because I'm doing a search across the entire system. Now, while the command is going on, I don't have access to my terminal. Because the system itself is keeping the terminal busy. Anyone knows how do you deal with such a situation? So you want to execute a command, but you want to keep the terminal available to you to do other things while that command is working in the background. Not even as a script, just on a normal command line. So let me explain what do I mean. One way to explain this is to use a simple command like sleep. Because as I mentioned earlier, literally all it does is just sleep. You use this in script sometimes to just pause for a while. So for instance, if I ask the terminal to sleep for five seconds, you can see it keeps the terminal busy for five seconds. Now this could be any command. Doesn't matter. But here the command took five seconds, for instance, to complete. If I did ten and replace with any other command that takes some time. Now right now the terminal is not really available to me. The terminal is available to me once the command is done. So let's say if I say a command that takes forever. At this point in time, if I write who am I, press enter, nothing is going to happen. Nothing is going to happen because it's busy executing that command first. So some cases where we don't want to wait, we can abort. We saw control C earlier, but that's not the ideal situation. I don't want to abort the running command. So what I want to explain to you is there are things running in the foreground. There are things that could be running in the background. And I want to help you understand how to work with that. Step number one, just keeping a command running as you execute it, running it in the background. So what do I mean by that? I take a command like this. And if I know that this is going to take time and I need my terminal, I put an ampersand sign. I want you to notice that now when I did the sleep command, the terminal is available to me right now. I can continue to work. And if I write the command jobs, you notice something is in the background and it is running. And whatever is running in the background might finish someday at some point in time, depending on what that is. In my case, I have set sleep for 50 seconds. At some point in time, that command will complete. And let's see if the job is still there. Can I request you to please try this out? This is running a command in the background, making sure the terminal is available to us. You might notice now the job says done and now it's clean. Done. This is exactly what I want you to see. And Austin, if you just say five, it's going to disappear very quickly. The command itself won't. No, that was a point. I just wanted to check something. So I'm thinking now, in what instance would you need this to be sleeping? Unless you're running a very long command. Yes. So the point here is not to you. The point is not of the command sleep. Actually, the command sleep here is just simulating here for us something that takes time to execute. That's it. So the idea is you could be running any command that just takes long, long time. And for me to simulate a command that takes long time is a command sleep because it literally does nothing but just take time. Would you still have to specify the time? No, any command that you execute, just put M percent at the back of it. The command will execute, but in the background. So your terminal is free for you. Oh, OK. OK, that's fine. That's noted. You know, you know, sometimes you'll be using commands for so long whenever you want to do something, but not necessarily understanding exactly what that actually is. This is one of those pieces. Yep. I've used this multiple times. Yeah, OK. I can see it's working for others. So the job kind of sleeps, sleeps and then, you know, it just disappears. So this is if you knew when you started the command that you wanted it to run in the background. But that's not always the case. Sometimes we just execute a command. And then we sit there waiting and we're like, ah, now I don't want to kill this. If I wanted to kill it, I'll just do control C. So instead of that, I'm going to do control Z. The difference here is it has sent the command that was running. It has sent it to the background. The foreground is available to me to do whatever I want. But actually in the background, that process isn't running. It's just been sent back and paused. So I can continue to work. I have the terminal available to me, but I probably at some point in time want to run what's sitting there in the background. So I can use the command BG. I'm hoping it works the same way on Ubuntu as well. And you see that number one job number one. I can just mention percentage one. Run this command in the back. The difference now is in the jobs, it's actually running in the back. So in this scenario, we started a command normally. We changed our mind. We threw it to the background with a control Z. Keep that in mind. The terminal is available to us. We can verify something is in the background, but not running. Then we made it run. Continue to run in the background. Basically, we resumed it. Please try this out. If you have multiple jobs in the background, that number will simply increment. It stopped. We run jobs to see. There is something in the background we can run. So you have a lot of jobs already done. Now that is number one, which has stopped their faith. Yep. Check jobs again. And it will be cleaned up. If you run multiple background jobs, you will see many. Now, if the ones that I have already projected. The one that I ran earlier for five seconds. I was doing that to check how long it would take before it deceptions from. Yeah, it's gone instantly after that done. So now when you see number one, it's another number one. Not the same. Yeah, because I'm looking at this now because I see all that's gone. It's going to clean up. Yeah, because I saw a few seconds, then it's gone. All right. It's not going to show you the history of terminal jobs. It's just right here right now. So you will only see pretty much the current status at this point. All good. So we have seen two things at this point in time. Just a quick recap. We started by running things in the background directly. We also did run in the foreground and change your mind and send it to the background. What if there is something running in the background and I want to bring it to the foreground? So let's say if I say. Sleep on three hundred. And one way or the other, it has gone into the. And the terminal is available to me. What if I want to do the reverse? Something is in the background. I want to bring it into the foreground. We can generally do the opposite. And now you notice my terminal is not available to me again because that command has. I can again change my mind and do control Z and punch it back. Do keep in mind though it's stopped. If I want to run it in the background, I can do that. If I want to get rid of. Please try that out. Should we check something? I've been writing the background and. For what? Does it teach them that nothing is happening? Back with you. Tell me. Go ahead, please. Yeah, I was saying that I've been ready to sleep. This is the part of the background. But now whatever under command. Percentage one. That does not. Yeah. First, write the command jobs, please. Are there any jobs at all? Stop. Two and three. So you need to bring that one back, sir, with the same idea. FG percentage two or three. Look at the number on the left side. Yeah. Yeah. Yes. Yes. We have to refer to the job ID. Oh, that's why. I've been wondering. What's going on? Why is it not showing? OK, same for faith as well. And then mention the job ID. OK. No, it's not here. Thanks. Yeah, I just lost a bit there. Yeah, just do first run the command jobs. This is for everybody. Yeah. So caramong. You have no jobs. There are no jobs. There is nothing to kill in the background. You run something in the background just like the sleep with the M percent sign. Eat for long, like 200 or 300. It simulates something that takes time and do that with an M percent sign. If you don't do that. Yes. And caramong. That's fine. We can do control Z for you. It will run the command. It will stop the command. Throw it in the background. And if you want, you can kill it now. OK. Try that out, please. Yeah, that works. And then. Yeah. And terminated, as you can see on caramong and also for faith. And for Austin, it's been terminated. There we go. So that's one trick. And this usually helps as well. So I think this is handy when working on the command. All right. Some of the others. Yeah, this would be very useful, especially if you're adding scripts. Sometimes you realize that you've got to write it out, maybe into a file. So now it will be hiding the background to make things easier for us. And a little bit quickly on just a few other tips and tricks. Also working on scripts and otherwise as well, which is redirection and also working on what we call as piping. These are, I would say, almost essential skills on the command line. I mean, not just about what commands, but. How do we connect the commands together? So what do I mean by that here is. Let's have a look. For instance, earlier. We did the command. Let's say cat. Of ETC. So this is one command. It produces an output. We also know that there is another command like word count WC. What if I was to do this. And use a pipe. And then do a word count. Now word count normally is waiting for an input. Would you agree? If I just did word count minus L and I press enter. What is it waiting for? This is a lot. What do I count? Give me something to count. If I say line one. Line two. And then I do control D. It says aha. These are two lines. So the point is the command is waiting for an input. What if I did this? This command produces an output. What if I pipe this into the next one? That means the output of this becomes the input of next. This piping becomes very, very useful with a very specific command on the shell. Which is to filter out the text. A command called as grep. Here is an example of what grep can do. Let's have a look at this file. We looked at the file that contains all the users. And there are a lot of users in this file. I want to filter out any user which has no login. That means these are not normal user logins. These are for service accounts. So they can't interact with the login. In any output, I can pipe and give it to the command grep. What do you want to filter out? What if I say I want to filter out no login? What it does is in the output, it only shows me those lines which contain that specific set of characters. Think of it like a simple filter. Takes the output and filters something in that output. What if I want the other way around? A reverse filter. What do you notice now? It does not show me any user who doesn't have the no login. It's the opposite filter, the inverse filter. Piping is very useful because you can chain the commands together. And one of the very nice things to pipe is the command grep because it can filter things out. Show me all the users which don't contain the no login. And here is a beautiful part. Watch this. How many such users are there? So what am I doing now? Taking the output of this text file, giving it to the grep which is filtering out, and giving that to the account. And what the account is going to tell me is that there are ten such users. Please give it a try. This is a quick history of my commands. And it's not just about executing the command. It's also you checking out what the output looks like. Let's see if that works. Where are the other people who are joining in some time? I see Austin, Faith, and Karaman. We are missing a couple of the others. You are low again. I was saying that you are low again. I think you are asking us about people who are going to join. Liz did say that she will join later. And I think a little before she left, she did say that she might not join the afternoon session. Can you hear me better now? Yeah, now you are better. Have you guys tried this out? Does it make sense what we have done? Yes, I tried it out. So piping one command output into the other. And then one of the nice things to do is to use grep as a filter, which is very, very handy. Some simple examples of the same. Let's say ls slash etc star dot com. Give me a list of all these files. It's a long list. Do you notice there is some month here? Feb, July, April, August, June. So I can simply say, OK, I would like to see all of these files. If you don't care about the upper case or lower case, just you can do minus i to ignore. In Jan, there is only one. In Feb, there are quite a few. How many? Let's do that. So... Give that a try, please. So obviously, as your use case, you will start to figure out. I think learning Linux fundamentals is the same thing. You don't have the recipe, you have the different ingredients. And then as you spend more and more time, then you have your own use case. What do you want to achieve? And then you use a combination of these commands to get that. You just go piece by piece and then you kind of string it together for your purpose. So it's more about like, what do I want to do? And what's the way to get it done? Cat slash etc slash password, grep. Maybe you can just do minus i, Austin, if you don't care about upper case or lower case long. And no need for wild cards for that. It's not taking it as a word, it's just taking it as a string of characters. You want a word, you use minus w, if you're looking for like spaces around it. There's a long story, there is grep, there is e-grep, there is f-grep. And if you read the help of these commands, it's scary. Yep, that's the simplest way of using that. Very nice. So I'm hoping that as we are diving through this, like in the morning you guys said you are, you have worked on Linux, you are comfortable with the command line. I'm hoping that some of these tricks are just helping maybe close a bit of those gaps. Or just make us a bit more productive. Yeah, no. This will help you because some of these commands, some of them you will find it's been running for years, but you didn't really understand to an extent of how you can manipulate it better also. So this is really nice. It's going to set things up for us. Yeah, and also if there are scripts with existing commands in it, it helps to interpret those better as well. And we always have the case of, it's always the case of somebody did something and then you are dealing with work done by somebody else. And since we're all network engineers here, you know how much we love documentation. So it's not always that readable. Yeah. Yes, you want a command that was used 30 years ago. It's been passed down and passed down. Yeah, do this. When that happens, do this. It's like this. Yeah, is that control panel mentality, right? Which button to press? Just press this button. Don't ask questions. And then you wonder like what exactly does this thing do? Sometimes it looks so mysterious. And then once you learn what it is, you're like, that's what it does. That is something amazing. Could be quite simple as well. So this again goes into the extension of your ability to be more productive onto the command line. Now, you saw a redirection a little bit. I'll just touch upon that as well and see how it can be handy as well. Earlier, what we did was, for instance, we took any command and redirected the outputs to a file. So, for example, I can say let's take the output of date and put it into the file. Now, that's a simple example of a redirection. But when we do a redirection, we have to think it in different ways. Input as well as output. And maybe we want to split a good output from the bad output. Let me explain. I'm going to run this command ls slash mnt. There is nothing there right now, but the folder exists. If I say ls slash opt, there is nothing in there as well. If I say ls slash etc, there is a lot of things out there. ls slash var, couple of things there as well. Now watch this. ls slash var 1. Does such a folder exist by default? It doesn't. What am I going to get when I execute this command? No big surprise. I'm going to get an error, isn't it? What happens if I do this? What will this command produce? You have a space between the var. So there are two parameters. One command with two parameters. By the way, I can show you. Both? Yeah, I'm just saying both of them. But the question is, is it going to execute one and ignore the error? Is it going to say because there is an error, I'll do nothing? Or is it going to give me both the outputs? I think it's going to give you both. If there is nothing on the other one, then it will go to the next one. So what do I get? I get the error. As well as I get the good output. Correct? Yeah, correct. Now let me do exactly the same thing and redirect this. Into a file called as output log. What do you expect to see in the output log? It will just be what you just showed there. Error? It will not access that error. Just one question. If you're using two greater sizes, what's the difference between that one and the other? We'll show you that as well. That will just append to the end of the file rather than overwriting and creating a new one. Oh, okay. I'll show you that in a bit as well. Just a quick one. Faith, Carol Wang, still with me? They call it as show me a sign of life after lunch. Same as a hostage situation, right? Where they demand sign of life. It's after lunch and I'm demanding a sign of life. Faith, I need to get that coffee there. Did you get it, Faith? No, I just went to plug on water. Electricity just came back now. I'll be fresh in a few minutes, I know. Yeah, I know. I'll be good. And mine left just before two. Oh, yeah. But we are here. I appreciate it. Please ask questions or just slow me down if it is too fast. Yeah, I know. I think I was going to get it right because I wanted to answer this one. That you were going to get the contents of the first part. Yes. But something interesting happened. The output log only contains the good news. Where did the bad news go? On the terminal. Oh, that's lovely. I run a script. I capture the output of that script. Everything looks amazing when I look at the log file. Because the errors that happened just showed up on a terminal. They were never recorded in this log. Okay. So if you want it to be locked also, what would be the hard command to use? Yes, so you are just a step ahead of me. So we're going to now break it down. Let me stop with the questions. No, please go ahead. It's good. So what we're going to do is I'm going to run exactly the same command. In which we know that it produces a good output as well as the bad output, isn't it? But what I'm going to do now is I'm going to do this. I'm going to use the sign 1 greater than file 1, 2 greater than file 2. And now let's see what's... So first of all, did you notice that no errors showed up onto the terminal this time? Yeah. Okay. I think it's because of you. We have two files. So this is file 1. What does it contain? The loud information. This is the good output. That's called a standard output and this is called a standard error. Okay. So 1 is a specific identifier for standard output and 2 is the identifier for the errors. I can split and redirect the standard output and the standard error differently. Can I recommend you please try this out? Yeah, go ahead. I was trying the other one. This one. Redirecting it to what? Okay. Can you repeat that? Sorry. Maybe it's possible that you can run your history so that I see that it's true. Yeah, that's correct. So I'm just looking at your screen, right? LS var, var log, output. We saw that earlier that the errors will show up on the terminal. And the good output is going into the log file. Yeah. Now if you look at my screen, I'm splitting the standard output and I'm splitting the error. By looking at my screen, my terminal, you saw 1 greater than and 2 greater than. So this 1 and 2 are standard identifiers. 1 means the good output, 2 means the errors. Okay. So do what you see on my screen. I'm here with you. Give me just one sec. Yes, tell me. Is everything done? Is everything finished? You go upstairs and clean it. We have to clean it for 2 hours every day. Yeah, he's saying like that. I have to clean it for 2 hours. My wife has to clean it for me. I have to clean it. I have to clean it for 2 hours. Clean it. I have to clean it. I have to clean it. If I don't clean it, I think it won't be working. I have to clean it. Is it the address? Yes ma'am. Do it again. So the error is on the terminal. Yes, it's on the terminal. So that's why I can't find it's a picture and also that the air I can be specified somewhere can be written somewhere instead of just Oh, okay Austin you can be my translator tomorrow as well Oh That's all right happy if it is clear Yeah, I know All right appreciate that So one of the things that we do sometimes when we are scripting Is that we simply want to ignore the errors? Okay, so let's have a look We saw that there are all kinds of interesting devices right your terminal is a device Everything is a device There is another device Hopefully still there Yeah, and any idea what this device does take a wild guess look at the name dev null It is quite literally a black hole Anything you send there just disappears So I could run that command Any command Here we know that this command has a standard output as well as a standard error What if I run the command and saying I'm not in a mood to seeing the errors? By the way, that's not how you should run every command on linux, but What happened now And try this out What happened to the errors? Are they recorded anywhere are they on the screen? Are they in a log file? Or they are simply sent to a black hole where they disappear forever Give that a try Also basically you are sending that to indicate because we are using true to send whatever whatever Yep, okay Because sometimes we don't want to see all the errors coming up on a terminal like we expect to see some errors We know that there are certain files which will not be found or there'll be some error which is known So we simply want to ignore all of them also this this command you only use if you know exactly That the response from that one is going to be an error Yeah, or you know, you simply do not Uh care Generally, this is done when we have known Challenges with a certain script we know there are some outputs, you know, one of the most difficult things in linux world in my experience Is knowing which error Is really critical And some errors sound like it's the end of the world And then the experts tell you yeah that one. Yeah that you can ignore And there are other errors which which sound just harmless And then they're like, oh my god, how could you ignore this and you're like, well, how am I supposed to know? Like which error is the end of the world? And which one isn't and and that frankly comes from from experience So something sounds like oh my god, that's it And then the experts come and say yeah that you can ignore. This is normal. This happens all the time So you can't retrieve them if they're there Sorry now i'll say you can Well, maybe gp can't depilite so it's like you've recycled or recycled Um Yeah, okay that one it takes a person who understands the error because I would want to keep all the errors So that it guides me to where the issue is Yes, you can always refer back to it So at least now you know how to do that like how do you take the output any errors in the output and then You know keep them somewhere for the safekeeping and then go back and look at it Your system on its own itself maintains tremendous logging capability as well All kinds of logs exist Every component every service typically has its own logs So there are all kinds of you know Logging capabilities which are part of the system and that's part of learning as well Are all available Through the logging demons So yeah, I think many different ways to see that Uh Let me see if I can show you especially on open two. Uh, the reason I mentioned this is that there are different kind of logging I would say mechanisms across different uh distributions but generally And also the path is unfortunately sometimes different I want to show you something Uh Log I think in these it might be in var ADM Uh, we have the var log itself and you can see all kinds of logs are here For the graphical interface authentication kernel logs all kinds of that as well Uh, we have syslog can also be used as you guys already know to centralize Any logging so we have a couple of these Different logs for different systems available as well. There's a lot you can do here in basic troubleshooting Let me show you there are some commands that we can use and there are some Uh log files that we have so your syslog Would be your starting point So in terms of practical how do you see the log I will show you now Uh, there's something we can just try so there is this is like the main log file Into an open to system some unix machines will have var log messages, but So this is the main Log file as you can see here. I can't access it And I think you know the reason why So Just a normal user As root I'm gonna try the same So this is the main log file now it can be a bit scary if you look at the size of this log file So maybe what I want to do is the opposite of cat which or more Tail so tail shows you as the name suggests the tail of that file i'm looking at the last few entries If you can look at those timestamps so very handy I can just say show me the last five Entries into that log file So Besides this there are other tricks, but this is one so can you try this please switch to root sudo bash And look at the last few errors Into your log file Again different linux distributions maintain logging slightly differently at times Yep, I can see everybody's trying it out And besides this if you do know like which log file you want to look at and that happens different Components have different log files as well There's another little nifty little trick, which is this I'm just gonna exit back. I have two terminals As the same user I am a student in both of these And What i'm gonna do here I'll just make sure I am in the home directory on just to make it easier frankly the actual path doesn't really matter So let's say I create or there is a log file Right now the log file is empty And let's say some errors are coming into the log file And can you just try this bit Then we will see the double arrow as well what happens one second Wait, did you do something that i'm not aware of why are you getting an error while trying to get that fire pp? Hello? Everybody All right, does that work No, wait, I was asking what did you do? Why are you getting an error now while trying to access that log file now? You're pitching something on it or what? Yeah, so what i'm trying to Showcase here. Let me just switch to my screen So I have a log file and what we are simulating is that some error is getting recorded into that log file So you might have logs for specific applications or it might just be the main File that we saw the var log syslog itself the trouble is any file that I want to look at Oh Yeah, so So we're just simulating some errors coming in through the log file Hmm But the trouble is I am not looking at the log file in real time So what we normally do Is this? Ah, what am I doing? Okay, and what we're gonna do now if you look at the tail in the options It says f Follow the file So tail minus f the log file what it is going to do now You notice that the terminal is busy It's keeping that file open. So as new errors pop up I'm doing this from the second terminal you watch that happening there And what I'm going to do Austin is I'm going to add to that file I'm not going to override that file Here is a new error here is one more new error And one more do you notice that on this terminal it's keeping the file open I'm watching it live As new events happen I can watch it happen Oh, but you're still cheating. Yeah So minus f keeps the file open the log file open that you can keep watching So if you are running a script And you are taking all the errors into a log file. You can watch that log file live also here when you're Redirecting just keep in mind that I don't want to override it I want to keep what is there and just add something to it. Can you try this out? Yes boss And keep the two terminals make sure you are in the same home directory make sure you're just a student Just to keep things as simple as possible Austin on one you are as root in a completely different folder, maybe just make sure Uh, you don't have to be in the same root, but i'm just saying just easier Hey don't talk i'm in the workshop quickly Yeah, what is it Oh, yeah, come on quite try that out get two terminals up and running And see if that works so in one you are in the backup folder austin yeah Always make sure you are, you know, where you are at caramel. Are you trying this out austin? Can you hear me just confirming? Yes, I can yeah good and now from the second terminal I think he did mention that about uh Electricity issues. I see she's not on the corner now This is also an old For now for the time being it's just me and is here the challenge Is this common power issues? It we haven't had it in a long time so Yeah, the problem is starting at a long time It seems okay also nuclear on what's happening now Yeah, I know until what's happening and it was actually my fault You gave us instruction and I kept on knowing you that Is that the price I paid for ignoring you? No, that's fine You need to experiment also because sometimes when you make a mistake and then you realize why then you tend to remember it So it's okay That is yeah, okay Experimentation is highly encouraged Initially when you're learning sometimes then we recommend that you follow Precisely what we are doing so you can see it exactly as it is but it's okay Yeah Because part of that then you learn like why this is not working the other guy is doing it It's working for him. Why is it not working for me? And then you realize oh i'm in the wrong location or my syntax not correct. Whatever it is Just a question on this, uh, just check on this on the screen of mine here On this terminal here. I see it says Uh tail lock file file Conquered it has appeared That's because do the same thing for you Yeah, because see what happened on the on the terminal on the right hand side you did greater than right? So it kind of closed the old file and created a new one I Delivered it. Okay. Let me just do this quickly Oh, yeah, now we took you okay. No, thanks I think these guys are gone Yeah, Liz is it losing I I just from my side i'm trying to catch up because I got a call from the office so to drop off a bit, but No, i'm Yeah, i'm also not not we'll be supposed to be But yeah, just go back to my laptop Um, that's all right, so just open two terminals as you can simply see on my screen And i'll just take you through it hang on give us Okay Okay Okay Okay Okay Okay, yep as you see two different terminals open them side to side What we are really trying out is the command tail that shows the end of a file The trick here is the option minus f So you can literally watch a file live as errors or data comes into that you can see it So on one terminal you're keeping a log file open Uh create that log file, please if it doesn't exist use the command touch to create that log file on one terminal And then watch it with the minus f Faith you are also in the backup folder on the terminal that you are in Please take a note of your current directory. I'm sorry. I didn't get that I think in one terminal you are in the backup folder in the home directory Okay Keep the two terminals side by side if you can so it's easier just the way you see it on my screen Okay, yeah just restore the window again get side by side Okay That shortcut we did this morning to open up a terminal what is the first one control alt t Control alt t. Okay. I like that. I like that we are ending with where we started Life's come full circle Yes Looks like you guys are struggling with power issues I'll take uh There will be a word document Which contains many of what we have seen today? As well as the deck the slide deck which summarizes the core commands and some of these core tools that we have seen Uh, it will be in the same folder that kubeb normally shares with you Through his cloud storage I'll just make sure that the same link is Active for you so you can use that as a reference if you want to go back To these documents the other recommendation I have is that you can History that you have Like in my case, let me go to the third terminal One nice thing is you can also open tabs now You Could if you want just take your entire history in the terminal where you have been doing everything you can save that as well But this is just an example of watching a log file Since we are In ubuntu in this particular case there are specific commands like general control These will also print out any errors Onto the system as well So that's a little bit of a trick on how do we operate onto the command line How do we Operate with lock files just keeping an eye on the errors which are going on And obviously there are a lot of tools a lot of Options and over a period of time just a bit of practice and you're all good of course, uh We have some ways to get some help as I said, you know manual pages One way Many linux distributions also have something called as info pages. I think man pages can be a little bit Intimidating Just because of the detailed nature, right? So If I look at the the tail command here is an example. I'll just do ctrl c to close this Uh tail if I look at the man I'm going space by pace If I press h there is a help of the man page itself How do you move forward and back but man pages can be quite intimidating as well Many linux distributions contain something called as info And you're considered as the The you know the the successor as well the advantage of man page of course is that also with info If i'm looking for something specific The output itself is so big but you can type slash and search for something Go up and down So there are some tips and tricks. So if I just run man without asking for Help on any particular command It says well What man page do you want? Well, what if I want the man page of the man command itself? That's matrix for you right there And we go in and it says okay, this is how to use man page This is how you read the manual pages and it gives you some basics It says man page has many sections So It's like reading a book has many chapters Are you shaking your manual of the manual? Yes Because how do I use the man command well check the manual of the manual But it is actually useful because it's telling me that the manuals are divided in many sections Yeah Are you looking for shell commands? Then this is section one Are you looking of help in files? I'll give an example, okay? Password is a command also which you use to set your password And password is a very important system file as well. So now if I say man password, which one The street It says Do you now understand what that number one means here? That's the first example the first section which contains help for commands So what if I say well man minus l password I'll have to read the man on man on this again So Here has many sections You can choose this one From which section So I can say man password dot and I can mention the section which is for configuration files Okay This is a long list but minus l should have worked for us as well Should print out the topics So yes, you're right it's a bit strange to be reading the man page of the man page But it is useful to learning how to navigate it how do you search the man page? How do I filter what I'm looking at? I just tried I just tried what we have the um regarding the man Wherever you can specify You can specify the section. I said the man man space password It didn't work Yeah, I tried man password dot one Because it was section six that it was section one that that was showing the But it's not showing No, let's just check again. I think we'll just double click. Yeah. Sorry double check here Executable I should be five I think for passwords Yeah, oh it's five so I don't have the one so why are you unable to pick that one? No, no, that will just make sense Is it Yeah That's not what you said Let's be men. Okay. I'll just set your screen. That's okay Yeah, set my screen please What did I do wrong? It's men Oh, no, I see why no my bad as I typed out the password Password It's pa double sorry pa double s w d we pronounce it. It's a very bad habit Yeah, it's built over the last 30 years and for last 30 years people are telling us You don't pronounce that password and we say well we do Um Yeah, sometimes it's easy to me specifically after about that to see that okay Is it typed out as a password or as something else? So if the for the password it is section five because we are looking for password the file the path or the file Okay. Yeah And there is password the command Which is section number one? Yeah Okay, thanks But is it minus capital n one second this one happens when you don't see all the sections Isn't it man minus k? How come it's not working. Wait a second. What am I trying? Ah, yes, come on. Okay. Yes So if you try man minus k it kind of lists Like a search in the whole man pages Anything to do with possible so you see here is password number one, this is a command Yeah, and here is password number five, this is the five So you can search for a keyword so here for example if I search for a keyword like this With a minus k So this is not searching for the command name but searching for the concept This might be useful to you because I think sometimes the problem is sorry go ahead No, no, no missing anything I'm hearing things that's a bit scary Uh, I think one of the bigger challenges in linux and unix is not knowing what command To look for for example, yeah, because I don't know what is the command for something So I look for what man page of what? I don't even know. What is the command for it? The thing with this is most of the time you'll you'll have waited to use the menu just go to google Wherever you have all the details that you essentially need there Sometimes you find it easy to go one Very important word of advice for you austin and everybody else the trouble is When you google for it, you may not be looking for something specific to your distribution for this particular kernel version So in 99 percent of the cases it wouldn't matter But in one person that was once And if you are reading forums Uh, no, no, so what happens is we we We do what the first guy says in the first post I guarantee you Maybe 99.99 percent of the time. No one tells you how to undo what you just did Yeah No chip on taping messages there. No one responds and then you scroll 10 pages down and the guy says oops my bad This messes things up and you're like geez. Thanks Something And frankly this is where uh Generative ai your chat gpt is your deep seat. They are brilliant But you do need to be very clear and specific to like this version this kernel blah blah Yeah, because also that also some of the Exactly what you need and you might want something that destroys So you just have to be careful also with that So any we'll never recommend you to make any changes to any production system anyways Yeah Change control All right, hopefully, uh, you can you can see man minus k this is for everybody you can search for a key word So if you don't know exactly what command to use It's very hard to get help on it if I say man minus k network i'm going to get a long list of things But the good part is I see many things related to that for example here ip So man minus k could be handy It may not always give you exactly what you're looking for Yes, in that case a quick google at least for the basic commands will be So for us that is ip address I have the loop back I have a simulated ethernet interface. I have the v4 and the v6 up and running The very classic, uh networking command will always work Next step Is not here but we can add that Most distributions will have their own tools ip is the tool of choice And initially it might look A little bit confusing but actually instead of having 10 different commands. It's easier to have a single command And just work on different objects That makes it very easy to program as well And scripting becomes a lot standardized Yeah, so this kind of comes in handy So These are some of your interface os tricks that we can try onto the command line And then yes from here you try as I said I I there is a reason we believe in the main page of the system Just because it matches exactly what you have on your system Even a slight mismatch sometimes Between one kernel and the next kernel or one one release to the next release the files can change the configurations can change Again we are thinking is thinking more in terms of system Basic navigation and working on the os principally remains the same and is generally backward compatible, right? So you're gonna see If I look at the root Of my os I Can see there is a link Well, why is that link? well Why is there a link This equals to that Well because long time ago 30 40 years ago when we wrote the scripts They mentioned this path. Although the path has changed We have still maintained the links So that even your 30 year old scripts don't break they are portable so typically they try to keep things portable So even if the os has certain changes the older locations as pointers Just take you to the newer location and it makes the scripts a bit more portable Across distributions and so on and so forth But other than that, please look for very specific documentation Linux basics will kind of remain the same the moment you step into the system administration As basic use is just Questions doubt thoughts You Express yourself is the one judge I just want to say I really enjoyed today I thought that that was part of a class It's very informative listen stop putting me on the spot Because what I see so I had to make sure that at least I'm calling names And you're getting back at each other are we that we're getting back at each other are we Yeah, no today's session was very helpful Because because this has some of things that we use are these are what we use on a daily basis You always have to go to the Linux to check certain things are not not and although you usually have our own Command that you normally run at least you found out you showed us Better ways of doing them and also again, which is more important understanding what you are running true Because you normally know like okay This is what you run to get a specific thing, but you don't really understand every parameter on that On that command that you write so at least today you manage to see certain things like oh, okay I've been running this for years, but now if you understand how you can actually even manipulate it even better Make sure that you get the best of what you need on that So yeah This is gonna be only for one day Yes, so I think the command line bit is Yeah I'm not so sure if that's down the line, but not so sure if it is frankly at this point in time So I think this day one is command line basics really go ahead listen Now once you know, are we gonna get any of this info like I saw you were sharing some slides Oh, yes, so both of the recording. Yeah, so there is a small word document which contains like some command samples and output samples Just to kind of summarize some of the core commands that we have seen And the deck has a summary as well. So i'll make sure that both of these Uh are there in the cloud storage so for you to refer it any other time later on as well Thanks You're meeting kobe on Friday Well, I wish you guys very good luck And can I be very honest like Maybe like if I go 20 30 years ago You had a few choices in in your career in it used to be like you're a programmer Like that was a very separate stream And being an infrastructure that system was a very separate stream And it was very clear that these paths are very separate paths, but the world has completely changed now. It's it's everybody is everything so I know that the journey from your network into development. It's it's a challenging one so I commend you to be For for being part of it and going through with it Always good to see yeah But I guess it's what the future is gonna actually be about anyway to make sure that we just brush up on certain skills But yeah now now the jobs are not really like before but you know when you are Yeah waking as a developer for example, just about development system is there you're just system is there now You have to be able to take everything and work on everything at all at the same time Yeah, so a lot of automation scripting. It's all embedded everywhere now So it's almost a core skill To the extent yeah, I wish you guys all the best for the capstone as well You'll get the resources from kubeb as well when you meet up with him Is there anything else I can tackle? In the dying hours of where we are at The graveyard shift as they call it. Yeah, it is when people go to sleep It's that you need a lot Yeah Too much coffee All right faith any questions lissandra anything on your mind Oh, yeah, no, I just wanted to see on the file issue that we discussed here on remember when I asked you regarding Writing because the challenge I always have Is that whenever I want to have the same type of file? I usually just copy it whenever it's there somewhere and I'll just copy it But i've never been to a point where I I create it in that Less informed as the other one for example You'd use that for your shell scripting for example, whether it is.sh When you create a file with the dosage it's not the same as When you have the one whereby it's already an sh whereby it's green in color Because the one that you create just gonna be because like you said the extensions are not really Taking into account when you're doing this. It's about permission Yeah, so what would be the best thing to do in the converter to create it? Because that's why I usually flop I usually just go and copy for that With the speech that I want that is green and then take it from there and change whatever I have to change in there Yeah, so it's more to do with the permission on that file So the idea here is that you can take anything and write a bunch of commands in it but What you want to do? Just very quickly here Right, so if I go to let's say nano My script And my script is quite boring it just says who am I and shows the date Now how do I make this as an executable So Maybe I can execute it by giving it the full location River slash home. This is how you executed binaries also, right? You just mentioned the path But if I do that it says hey you're not an executable What if I mention a shell and call this one Oh wait, what is in my file, but why are you not having permission to just Check that file. Sorry. I'm just working on the wrong file Uh, it's my script Let me just run this under students. Yeah, I just made I just mentioned the wrong file So home student my script You see that works right I had to do nothing in terms of permissions and it's not Any separate color what it is is a matter of Is it marked as an executable? So if I look at this file my script What most likely people do is this? I want to take this file. Oh, you're just making it executable. Just making executable. Let's see if that makes any difference Stern green If I mention the exact location now That works Or I can just call it like this And that works Yes I mean Yeah, because i've been talking I thought maybe can hear me Sorry, can you can you hear me? I don't know why I have been muted. No You were gone for a while there because I was asking the also I see you're having the check mark to make it executable So it doesn't matter even if it doesn't have the sh Yeah, yeah that that matters not at all That is it is just so that you know as a human being that this is a shell script. That's it Yeah, yes Because I think that was us like I know you already told us and I even mentioned that there are no extensions on this So right now i'm thinking I know I know the other one's always executable one of it is sh So I think that's what usually usually just gets me on that because I'll be like why is this not executable now? Whereby the sh is not there Okay. Ah, okay You have no idea how much I Hopefully that's clear now so you take any text file that doesn't matter how you make it Just make it executable with that little plus x on that Once it's executable you can call it directly or Yeah, okay I was gonna ask you why did you have permission issues when you you're trying to access this Yes, because it is not executable Oh no, oh I thought maybe you're trying to see the internet and you see that you're executing it Yeah, if I do this and press enter I am saying I want to execute this just like a binary Yeah Mmm, it works now because I have marked it as executable earlier. It was not happy to execute it Okay, okay now So if you pay close attention to the output of ls minus l Just after we have done what we have done You see a little x Everybody everybody can execute this Before the script did not have the x mark Yeah Okay Just do scripts like this But it's usually each on my site Like the basic the simple basic that you've taught us now the fact that there are no Extensions to to linux. That's something that was every time i'm trying to uh To the f or whatever case it might be and it will just be failing and failing so many times Which is because sometimes you work into these things But you don't really they're not really taught the basic basics to say like oh no. No, just look. This is like this So I guess yeah, that's the difference between Uh doing something and knowing exactly what's happening behind the scene Yeah, yeah, that's true and that fundamental helps. That's the objective frankly of the session today So i'm glad that it has helped Uh faith, uh, I know you said you'll be right back. Uh, listen to any questions from your end No, nothing nothing anymore. So I guess the only question is when does this end Yes, yes Appreciate you guys being here. Thank you so much. Good luck on your project. See you around someday No, thank you How would say Now I am done i'm going to now arrange this room every day i'm arranging this room for the last seven days I don't know Oh Oh I Oh Oh Oh Oh Oh Oh
on 2025-02-19
Visit the Network Engineers Programme course recordings page