Linux Begins

Once you have a sense of the vast potential of Linux, you may be eager to experience it for yourself. Considering the complexity of modern operating systems, though, it can be hard to know where to start.

As with many things, computers can be better understood through a breakdown of their evolution and operation. The terminal is not only where computers began, but also where their real power still resides. I’ll provide here a brief introduction to the terminal, how it works, and how you can explore further on your own.

Although “terminal,” “command line,” and “shell” are often used interchangeably, it helps to learn the general distinctions between these terms. The word “terminal” comes from the old days of Unix — the architecture on which Linux is based — when university campuses and research facilities had a room-sized computer, and users interacted with it by accessing keyboard-and-screen terminals scattered around the campus and connected to the central hub with long cables.

Today, most of us don’t deal with true terminals like those. Instead, we access emulators — interfaces on Unix-like systems that mimic the terminal’s control mechanism. The kind of terminal emulator you’re most likely to see is called a “pseudo-terminal.”

Also called a “terminal window,” a pseudo-terminal is an operating system application on your normal graphical desktop session. It opens a window allowing interaction with the shell. An example of this is the Gnome Terminal or KDE Konsole. For the purpose of this guide, I’ll use “terminal” to refer exclusively to terminal emulators.

The “command line” is simply the type of control interface that one utilizes on the terminal, named for the fact that you write lines of text which are interpreted as commands.

The “shell” is the program the command line uses to understand and execute your commands. The common default shell on Linux is Bash, but there are others, such as Zsh and the traditional Unix C shell.

 

File Organization

The last thing you need to know before diving in is how files are organized. In Unix-like systems, directories are ordered in an upside down tree, with the root filesystem (notated as “/” and different from the “/root” directory) as the starting point.

The root filesystem contains a number of directories within it, which have their own respective directories and files, and so on, eventually extending to encompass every file your computer can access. The directories directly within the root filesystem, in directory notation, are given right after the “/”.

For example, the “bin” directory contained right inside the root would be addressed as “/bin”. All directories at subsequent levels down are separated with a “/”, so the “bin” directory within the “usr” directory in the root filesystem would be denoted as “/usr/bin”. Furthermore, a file called “bash” (the shell), which is in “bin” in “usr” would be listed as “/usr/bin/bash”.

So how do you find these directories and files and do stuff with them? By using commands to navigate.

To figure out where you are, you can run “pwd” (“print working directory”) and you will get the full path to the directory you’re currently in.

To see where you can go, run “ls” to list directory contents. When run by itself, it returns the contents of the current directory, but if you put a space after it and then a path to a directory, it will print the contents of the directory at the end of the path.

Using “ls” can tell you more than that, though. If you insert “-l” between the command and the path with a single space on either side, you will get the “long” listing specifying the file owner, size and more.

 

Commands, Options, Arguments

This is a good time to explain the distinction between commands, options and arguments. The command, which is the program being run, goes first.

After that you can alter the functionality of the command by adding options, which are either one dash and one letter (“-a”) or two dashes and a word (“–all”).

The argument — the thing the command operates on — takes the form of a path. Many commands do not need arguments to provide basic information, but some lend far greater functionality with them, or outright require them.