Join Scott Simpson for an in-depth discussion in this video Working at the command line, part of Up and Running with Fedora Linux.
- While it's pretty easy to use Linux desktop environments these days without ever needing to use the terminal, many power users, hobbyists, and others find it pretty handy. I've opened up the terminal application here, and I'll tweak it a little bit to better fit my screen. I'll press ctrl, shift, and equals, which is ctrl plus, a few times to increase the font size. And I'll drag it up to the top of the screen to maximize it. In this chapter, I'll go through some of the basics of working with the command line interface. If you're already a command line ninja, a lot of this will be review for you.
But if you're new to working with the command line, it may help to understand what the point of all the cryptic looking text really is. Long ago, the only input interfaces computers had were text-based consoles. Systems didn't have the pretty windows or clickable interfaces that are prevalent today. An operating system is a bunch of software called the kernel, which interfaces with the hardware and other software to get things done. One of those pieces of software is called a shell, or an environment where the user can issue commands and see output. Over the years since the development of UNIX in the 1970s, there have been a number of different shells that were widely used.
But perhaps the most widely used shell nowadays is called BASH, or the Bourne Again Shell. BASH is the default shell on Mac OS X, Ubuntu, Red Hat, and since Fedora is derived from Red Hat, it's here in Fedora as well. Just like any other software, the ins and outs of BASH could be a whole bunch of courses on their own. But let's take a look in general at how the BASH shell and many others work. It all starts with the prompt, or a string of characters that can be customized to show you various information. Usually the prompt shows you your username, the name of the computer you're working on, and the working directory, or where you're currently working in the file system.
Oftentimes you'll start out in your home folder. The other thing the prompt does is provide a place to type commands that you need to issue to the system. It's prompting me for information. The cursor here indicates where I'll type when I enter a command. And so I'll do that. I'll write "ls -lr /etc". But before I press enter, let's take a look at what all this means. The "ls" here is the command, whatever action I want the system to take. In this case, list the files in a directory.
In some cases, you'll just use a command by itself without anything else. Other times, you'll need to pass some more information to the command, such as how you want it to behave, by specifying options, preceded by a dash character. That's what I have here with this "lr". "l" will give me a long listing, and "r" will show me the files in reverse order. This could just as easily be written "-l -r", but we can collect the options together here in one statement. Furthermore, many commands need an input such as a file name or a string of text.
Here I've specified a path, the etc folder. So all in all, this command says "List the files in a long format, sorted backwards, inside the etc folder." Let's see that in the terminal. And there we go. This output shows a few different pieces of information about each file. Don't worry about all that right now. I'll go through that in just a little bit.
- What is Fedora Linux?
- Downloading and installing Fedora
- Navigating the GNOME Shell
- Working with files and folders
- Working at the command line
- Configuring Fedora Server