An overview of basic UNIX commands

On this page, I'll try to sketch an overview of basic UNIX commands you should be able to handle when starting to use a UNIX (or Linux) machine. The commands are all pretty basic, but they'll give you an overview of what can be done, how to walk around in the directory structure of a UNIX file system, and gives you pointers on how to learn more UNIX commands on your own, when needed.

You can use this tutorial to get used to the command line of a UNIX machine, but also of Linux, Mac OS X or specific Windows command lines. I give an overview of supported OS'es at the bottom of this page.

Parts

I have seperated the tutorial in a couple of parts. If you're new to UNIX, you could start with the first part, and slowly continue down to learn more about the commands in UNIX. I have organized the parts in a chronological order, so you can start with the first part explaining the very basics of the UNIX commands. If you're already experienced with the UNIX command line and some of the UNIX commands, you can skip to the parts you're interested in.

Basics

These parts give you the very basics of walking around in a UNIX file system, and working with some of the very basic UNIX commands.

  1. What the heck is a UNIX command line?: This part introduces you to the command line, and why it is such an important part of a UNIX system in order to get things done. It also gives you some pointers on how to start using a command line using a terminal emulator. I'll also give a very vague introduction of what a UNIX command looks like.
  2. Walking around in a UNIX file system: Similar to other operating systems, the UNIX file system is build up as a hierarchical structure. this part introduces you to the very basic commands for walking around in a UNIX file system. (pwd, ls, touch, cd, mkdir)
  3. Copying, moving, removing and linking of files and directories?: This part introduces the basic commands to handle files, copy them, move them around, remove them and make symbolic links. (cp, mv, rm, ln)
  4. Handling text files?: This part explains you how to display and work with text files in UNIX. (cat, less, grep).
  5. Getting help?: This part explains how to get help from the UNIX command line on various commands, and learns you how to figure out new commands without really knowing how they should be called. (man, apropos)

Advanced use

The topics in these parts are not really advanced, but they'll allow you to do more with your UNIX command line. The commands in these parts might be more advanced than the commands in the previous section, but they can make your life a lot easier when working with a UNIX command line.

  1. Advanced walking around in a UNIX file system?: We'll get a deeper look into the file system of a UNIX machine in this part, learn something about the global structure of a UNIX file system, and learn how to move around in bigger steps, in order to move quickly from place to place, or to find documents. (find, locate)
  2. Managing processes?: This part explains you how to work with running UNIX processes. (ps, top, kill, bg, fg)
  3. Pipelines?: Commands in UNIX can be put in chains to create pipelines of commands to solve all kinds of problems. This part introduces you to using pipelines, and sending the results to files. (|, >, <, >>)
  4. Advanced handling of text files?: This part gives and introduction to more advanced commands to handle text. (cut, rev, sort, uniq)

Supported OS'es

Linux

Most probably you're using Linux and want to learn something about Linux commands. Note that Linux is just one of the members of the UNIX family, so all the commands you can learn about in this tutorial can be used in Linux as well. SO if you want to learn about the Linux command line and Linux commands, you are pretty safe with this tutorial. I'll always be refering to UNIX commands instead of Linux commands, as all of the commands are universal to UNIX, and thus usable in Linux too.

Linux is a free version of UNIX that was originally built to make UNIX available for free on i386 processors. If you want to install UNIX (or Linux) on your home computer, I would advise you to install a Redhat Linux distribution, which is freely available from http://redhat.com. There are plenty of other freely available and downloadable distributions too, some of them are easier or harder to install than Redhat. If you want to get started with Linux in 5 minutes, without having to mess up the partitioning of your hard drive (in order to install Linux on your home computer, you normally have to install it on a partition next to your other OS, like windows), try knoppix (http://www.knoppix.net). These guys offer a Linux install on a single CD (freely available, of course) that you insert into your cdrom drive, boot your computer, and you're running Linux, without your Windows install even noticing it.

Mac OS X

You might not know this, but Mac OS X is a member of the UNIX family too. More so, under the hood, Mac OS X is based on (BSD) Linux. So similarly to my discussion of Linux, you can learn to use the command line similar to any other UNIX variant. This tutorial can thus also be used to navigate around your OSX using the command line and the UNIX commands.

Windows

Nope, Windows is not some sort of a UNIX clone. The commands and ("DOS") command line is different than the UNIX command line. There are, however, packages available (http://www.cygwin.com) that allow you to simulate a UNIX command line and UNIX commands on a Windows machine. However, I am not familiar with this and can therefore not really tell how this tutorial can be used on Windows. I, however, suspect that most of the commands explained in this tutorial are perfectly usable in such a simulation.


comments powered by Disqus