In this movie, Sandra walks through your new installation of Red Hat Enterprise Linux.
- [Narrator] In this chapter we'll examine our new installation more closely using the console. To get started let's talk about the most common working environment for a Linux admin, the shell. The shell is where commands to the os are entered by the user. There are actually lots of shells included in your Red Hat Enterprise Linux System, but bash is the default. Bash is a common shell used across several of the Linux versions. We will be using bash but there are other shell programs that can be installed in a Linux system. Some examples of other shells are dash, which is a less complicated and faster version than bash, tcsh which incorporates some c programming, and zch which incorporates elements from korn shell, bash, and ctsh.
Now over to our new operating system. We'll start by logging in. I'm gonna log in with a simple user account. The shell prompt usually shows your user name and the name of the machine followed by a dollar sign. This is where you type commands. When you see it on the screen it means that the computer is ready and waiting user input. Before we start let's talk a little bit about the syntax of a Linux command. The command syntax can vary. The simplest way to use most commands is to type the command at the prompt and hit enter.
Let's start with a command to see what machine you're on. To run this command just type host name and press enter. Now let's double check the user that's currently logged in. You can do this by typing the who am I command. Now let's see the same information using a different command. The id command provides more detailed information about the current user than who am I. Let's run the id command with two options. First, type the command id. Next, add the options, type a dash followed by the option characters.
In our case we're gonna run the id command with the options u and n. The u option will make sure that the output includes only the identification for the current owner of the session. The n option tells the system to present the id as the username. I made a mistake in typing the command. This is a good opportunity to show you how to retype a command without actually having to type it. If you hit the up arrow button while at the command prompt your last command will appear.
Now let's try this again now that I've added the important dash for the option. Again it showed me the same information as the who am I command but I used a different command and added options. In addition to the command in some cases you can also add an argument. If you run a command against a file, you would type the command and use the file name as the argument. For example, if you run a change to a specific directory you would use the cd command to change directory and then use the target directory as your argument.
First I'll enter the cd command. Next, I'm gonna enter the target directory as my argument. I can tell that that command executed successfully because my command prompt now includes the home directory. There's another way that you can figure out what directory you're currently in. A directory is part of a Linux file system and we'll talk about elements of the file system in greater detail in another video. When you first log on to a Linux system the working directory is set to your home directory.
From anywhere in the Linux command line you can type pwd, or print working directory, to find out your current location. Now that we know we're in our home directory, let's run another command to see what else there is. Type ls to list other files within the same directory and hit enter. You might notice that as I type in different commands the results will show in different colors. Usually those colors indicate different file types. Given that it can be configured differently from system to system, the color of each file type can be configured by an administrator.
That being said, the color of a file may not mean what you think it means unless you verify. With our recent commands we've verified our current directory and we've looked at what else is in that directory. Now, let's move again to another directory. Again, we're gonna type the command cd slash usr. You can see that in the command prompt the change to directory is present. I'll just verify this again by running the pwd command, print working directory. You can see that we've now changed to another directory.
For the Linux command line there is a ton of commands. The best way to get comfortable at the bash command line interface is to use it frequently. Practice navigating and working with the directory hierarchy and file structure. In the next video we'll work with more commands.
- Learning the RHEL environment
- Planning and installing the network
- Examining the RHEL operating system
- Executing basic commands
- Editing files
- Creating and managing user accounts
- Configuring file systems and local storage
- Managing logs, software, and other systems
- Implementing local RHEL security