Why You Should Learn Linux

Tux, the Linux penguin mascot.

I originally wrote this for a class I’m TA-ing, and thought I’d share it here as well! –SL


You probably already know that Linux is a free computer operating system, and that it has a reputation for being difficult to learn. You may not know, however, that Linux is actually only the latest (and most popular) member of a family of operating systems that dates back to the early 70’s. The history is interesting, but I won’t bore you with it here.

In brief, you need to learn Linux because:

  • It powers the web (your website is going to end up on a Linux server)
  • It has powerful (and usually, free) tools to help make software development easier
  • Some of the more involved aspects of web development require spending time on the Linux command-line.

Plus, it really does look great on a resume!

Linux powers the web

So why do you need to know Linux if you want to be a programmer or web developer? Take a look at this page that measures how many web servers use each operating system. At the time of this writing, Windows is used by less than 2% of the servers on the internet. Every other operating system on this list (Red Hat, Debian, Ubuntu, etc) is some version of Linux.

If knowing what is going on with the servers that are powering your clients’ applications isn’t reason enough, consider also that the number of desktop users of Linux is also growing.

The terminal (aka the shell, aka the command line)

When people say, “you should learn Linux”, what they often really mean is, “You should learn to use the command line in Linux and know the basics of the Linux file system,” and this is also what I mean, because Learning (with a capital “l”) Linux takes years and years. But learning the basics of the command line is relatively easy, and if you plan to do any amount of web development, the payoff will be worth the effort.

Now that every operating system (including most distributions of Linux) default to a desktop environment, fewer and fewer people really need to get acquainted with the command line (also known as the shell). When faced with something that looks like this

slebeau@Tiptop-107653 MINGW64 ~

most people feel completely lost (except, of course, for those of you who have used PowerShell or are old enough to have used MS-DOS.

There are powerful command-line-only tools for web developers

What made the original Unix operating system so popular and powerful was how it let you get complex work done by chaining the input and output of different utilities together. For example,

$> ls | more

takes the output of ls (which just lists the files in a directory) and pipes its output to more, which is a program that prints text to the screen one page at a time. That | symbol is called a pipe.

These chains can become pretty complex and hard to read for a beginner. Here’s a bash one-liner to convert some AVI files to MP4 using the command-line version of Handbrake:

$ for INPUT in *.avi ; do echo "${INPUT%.avi}" ; done | xargs -i -P9  HandBrakeCLI -i "{}".avi -o "{}".mp4

You can even create your own small utilities and chain them together to help you get work done as a developer.

You don’t need to be an expert!

You don’t need to understand what’s going on here–I’m not trying to frighten you off, but simply to show the immense power available to you on the command-line.

Imagine you were working on a project that had thousands of files (not uncommon), and you discovered that you needed to rename a function called StevenFunction to BillFunction. The problem is, now that you’ve changed the name of that function, you’ll need to change every instance of StevenFunction in thousands of files. While you could certainly open each file and manually do a search and replace, you could just as easily fix all of those files in one go using a single line of code on the command line. These kinds of one-liners are so common that there are websites dedicated to them so people don’t have to constantly re-invent the wheel.

Linux was primarily designed for power users and programmers, and most distributions of Linux come with a set of powerful tools. Many of thees tools date back to the original Unix mainframe days.

Linux can be kind of dangerous

With great power comes great responsibility. Since Linux will let you literally do anything, you do have to be careful when running code you’ve found online. You need to know at least the very basics of how the terminal works, what rm and chmod do. Just as you can get a ton of work done by typing in one line of commands at the command-line, you could also wipe your entire hard drive by typing in less than ten characters. Still, if you get to grips with the basics and always back up anything important, you should be fine.

You don’t have to replace your current operating system

Virtualbox is a free virtualization package that allows you to run different operating systems in their own virtual file system without having to erase your current operating system. This is a great way to get started learning Linux, because even if you do manage to permanently destroy your Linux environment, the worst that will happen is you will have to delete it and start over with a new virtual file system. Not only that, but you can have as many “boxes” as you want, each running a different operating system.


Say you are a web developer and you develop websites for multiple clients. You have to work on all these sites locally, but you don’t want to have all of these projects sharing the same MySQL server. Besides, these sites all have to be hosted with different companies running different versions of PHP, MySQL, Linux, and Apache.

Vagrant (which uses Virtualbox) allows you to create a virtual local host for each of your clients, each with the same exact (or close) settings as the host server. You can work on each project in its own “sandboxed” environment, meaning that each project will be isolated.

Additionally, Vagrant works well with version control systems like Git and Github, which will allow you to make snapshots of your web projects at different points, and revert back to these earlier snapshots if you mess something up. Version control also makes it easy for multiple people to work on the same project while minimizing conflict issues.

Conclusion and some advice

I was originally going to write specifically about Linux and why it’s good to learn, but in working on this post, I realized there are a lot of Linux-related (but not exclusively Linux-related) things you need to know if you want to be a web developer. The best advice I could give you is to simply download Virtualbox, download a distribution of Linux (I would recommend Ubuntu), and just start finding your way around. If you are on a Mac, you already have a Linux (well, BSD) system of sorts, but you should still download Virtualbox and Ubuntu so you don’t do any permanent damage to your host system.