Introduction
Unix takes the approach of giving you a set of building blocks and letting you put them together to deliver things to suit your exact needs.
From the tutorial, you will learn about the Linux command line (Bash). It contains clear descriptions, command outlines, examples, shortcuts, and best practices.
Why bother learning the command line at all? For specific tasks, such as word processing and video editing, GUI is a better option than the command line. However, some tasks, such as data manipulation (reporting) and file management, are more suited to the command line. Think of the command line as another tool you can add to your belt. As always, pick the best tool for the job.
Outline
This Linux tutorial comprises the following sections:
- Command line explains what it is, how it works, and how to get to one.
- Basic navigation introduces into the Linux directory system.
- More about files highlights peculiar characteristics of files and directories in a Linux environment.
- Manual pages details how to make the most of Linux commands.
- File manipulations teaches how to create, delete, rename, copy, and move files and directories.
- Vim text editor describes a powerful Linux-based text editor.
- Wildcards explains the notion and provides usage recommendations and examples.
- Permissions tells how to identify and change the permissions of files and directories and explains potential consequences.
- Filters introduces into various commands that allow us to mangle data in interesting and useful ways.
- Regular expressions and grep allows you to master a powerful pattern-matching language helpful in analyzing and processing data.
- Piping and redirection teaches you how to join commands together in powerful combinations.
- Process management explains how to see what is currently running on your Linux system and what state the system is in, how to kill hanging programs and put jobs in the background.
- Bash scripting highlights how to get the computer to do tedious and repetitive tasks for you.
- One-page cheat sheet is a quick reference covering the main points from the tutorial.
The general recommendation is to look through them one-by-one, but if you've come here to learn about a specific topic, feel free to go straight to that one.
Section structure
Each section is structured as follows:
- An introduction outlining what you will learn.
- Details on the topic, including extensive examples.
- A summary of covered programs and the most important concepts.
- A set of activities to help you solidify your knowledge and skills.
Think of the activities not as tutorial questions, such as you may get in a class at school, but as directions on where to explore in the Linux environment to benefit from your new knowledge and skills. Treat the activities as a starting point for exploration.
General rules
Reading the tutorial, pay attention to the following:
- For any Linux reference, assume Unix as well. Linux is an offshoot of Unix and behaves pretty much the same.
- Whenever you see
<something>, you are to replace this with something useful. Replace the whole thing, including<and>. If you see something, such as<n>, this usually means: replace this with a number. - Whenever you see [something], this something is optional. When you run the command, you may put in the something or leave it out.
Obtain Linux
Learning Linux is like riding a bike: you can only become proficient by actually doing it. So, before getting started, make sure you have access to a terminal. Luckily, you have several options available:
If you are on a Mac, you already have a terminal pre-installed.
Another option is to run Linux. Linux is completely free, and there are many good distros, for instance, Ubuntu or OpenSuSe. In this case, you also have several variants:
- Install the operating system on a spare machine.
- Create a dual boot system when both Windows and Linux are installed on the computer, and you choose which to run when you boot.
- Run Linux in a virtual machine. VirtualBox is an excellent tool to use for this, and it's free, too.
The third option is to have access to a machine remotely. If you do, then remote login into these to access a terminal is an option as well.