fedora login:
This is actually one of six virtual consoles that Fedora provides for your use. After you have accessed a virtual console, you can use the Alt key and F1 through F6 to switch to a different console. If you want to get back to the graphical interface, press Alt+F7. You can also switch between consoles by holding the Alt key and pressing either the left or the right cursor key to move down or up a console, such as vt1 to vt2.
Fedora is waiting for you to log in as a user, so go ahead and enter your username and press the Return key. Fedora then prompts you for your password, which you should enter. Note that Fedora does not show any characters while you are typing your password in. This is a good thing because it prevents any shoulder surfers from seeing what you've typed or the length of the password.
Pressing the Return key drops you to a shell prompt, signified by the dollar sign:
andrew@fedora ~]$
This particular prompt tells me that I am logged in as the user andrew on the system fedora and I am currently in my home directory. (Linux uses the tilde as shorthand for the home directory.)
Navigating through the system at the command line can get confusing at times, especially when a directory name occurs in several different places. Fortunately, Linux includes a simple command that tells you exactly where you are in the file system. It's easy to remember because the command is just an abbreviation of present working directory, so type pwd
at any point to get the full path of your location. For example, typing pwd
after following these instructions shows /home/yourusername,
meaning that you are currently in your home directory.
Using the pwd
command can save you a lot of frustration when you have changed directory half a dozen times and have lost track.
Another way to quickly access the terminal is to go to Applications, Accessories and choose the Terminal entry. Fedora opens up gnome-terminal
, which allows you to access the terminal while remaining in Gnome. This time, the terminal appears as black text on a white background. You can choose to access the terminal this way, or by using the Ctrl+Alt+F1 route; either way you will get to the same place.
Navigating Through the File System
Use the cd
command to navigate through the Fedora file system. This command is generally used with a specific directory location or pathname, like this:
$ cd /usr/share/doc
Under Fedora, the cd command can also be used with several shortcuts. For example, to quickly move up to the parent (higher-level) directory, use the cd command like this:
$ cd ..
To return to one's home directory from anywhere in the Linux file system, use the cd command like this:
$ cd
You can also use the $HOME
shell environment variable to accomplish the same thing. Type this command and press Enter to return to your home directory:
$ cd $HOME
You can accomplish the same thing by using the tilde (~) like this:
$ cd ~
Don't forget the pwd
command to remind you where you are within the file system!
Another important command to use is the ls command, which lists the contents of the current directory. It's commonly used by itself, but a number of options (or switches) available for ls give you more information. For instance, the following command returns a listing of all the files and directories within the current directory, including any hidden files (denoted by a . prefix) as well as a full listing, so it will include details such as the permissions, owner and group, size, and last modified time and date:
$ ls -al
You can also issue the following command:
$ ls -R
This command scans and lists all the contents of the subdirectories of the current directory. This might be a lot of information, so you might want to redirect the output to a text file so that you can browse through it at your leisure by using the following:
$ ls alR > listing.txt
Table 4.1 shows some of the standard directories found in Fedora.
TABLE 4.1 Basic Linux Directories
Name | Description |
---|---|
/ | The root directory |
/bin | Essential commands |
/boot | Boot loader files, Linux kernel |
/dev | Device files |
/etc | System configuration files |
/home | User home directories |