Introduction to the 10 Most Useful Linux Commands

Article by Josef Nankivell (4,324 pts ) , published Dec 29, 2008

Maybe the command line isn’t your favorite place to hang out, but to be an effective Linux user, you need to be able to wield a few essential commands. These 10 are guaranteed to simplify your Linux admin life — and I'll explain why?

Introduction

I understand that many of you don’t want to use the command line in Linux (or in any operating system for that matter). But the truth is, to be a good administrator, you have to know the command line. Why? Well, with Windows there are times when the command line is the only thing that can save your skin. With Linux, the command line is vast, reliable, flexible, fast… I could go on and on.

Of the 2,119 possible commands from the /usr/bin directory (in Mandriva Spring 2008) and the 388 commands from /usr/sbin/, a few are crucial. Here are the top 10 linux commands that should make Linux admininstration easier, and help introduce you to the Linux command line.

I could make this easy and go with the most used commands (cd, ls, rm, etc — okay, 'etc' isn’t a command, but you get the point). Instead, I am going to go with the most useful, and I’ll keep it as distribution-neutral as I can.

1. Top

I figured it was fitting to put the top command at the top. Although top is actually responsible for listing currently running tasks, it is also the first command Linux users turn to when they need to know what is using their memory (or even how much memory a system has). I often leave the top tool running on my desktop so I can keep track of what is going on at all times. Sometimes, I will even open up a terminal (usually aterm), place the window where I want it, and then hide the border of the window. Without a border, the terminal can’t be moved, so I always have quick access to the information I need.

Top is a real-time reporting system, so as a process changes, it will immediately be reflected in the terminal window. Top does have some helpful arguments (such as the -p argument, which will have top, monitor only user-specified PIDs), but running default, top will give you all the information you need on running tasks.

2. In

To many administrators, links are an invaluable tool that not only make users lives simpler, but also drastically reduce disk space usage. If you are unaware of how links can help you, let me pose this simple scenario: You have a number of users who have to access a large directory (filled with large files) on a drive throughout the day. The users are all on the same system, and you don’t want to have to copy the entire directory to each user’s ~/ directory. Instead, just create a link in each user’s ~/ directory to the target. You won’t consume space, and the users will have quick access. Of course when spanning drives, you will have to use symlinks. Another outstanding use for links is linking various directories to the Apache doc root directory. Not only can this save space, it’s often advantageous from a security standpoint.

3. tar/zip/gzip

Tar, zip, and gzip are archival/compression tools that make your administrator life far easier. I bundle these together because the tools can handle similar tasks yet do so with distinct differences (just not different enough to warrant their own entry in this article). Without these tools, installing from source would be less than easy. Without tar/zip/gzip, creating backups would require more space than you might often have.

One of the least used (but often most handy) features of these tools is the ability to extract single files from an archive. Now zip and gzip handle this more easily than tar. With tar, to extract a single file, you have to know the exact size of the file to be extracted. One area where tar/zip/gzip make administration simple is in creating shell scripts that automate a backup process. All three tools can be used with shell scripts and are, hands down, the best, most reliable backup tools you will find.

More to come...

Part 2 will continue to show you the top commands for Linux!

Comment

Jul 8, 2009 4:17 PM
JJ
RE: Introduction to the 10 Most Useful Linux Commands
these commands are good but could be better if u could put at least one example for each command