Part of the TechTarget Network of Enterprise IT Web Sites
Home > 77 useful Linux commands and utilities
Technical Guide:

77 useful Linux commands and utilities

03 Dec 2007 | SearchEnterpriseLinux.com

Linux administrators cannot live by the GUI alone. That's why we've compiled the most essential Linux commands into this convenient guide. We designed this guide specifically for Linux managers and system administrators as a reference library of only the most useful utilities. By learning a few simple tools, command-line cowards can turn into scripting commandos, getting the most out of Linux by executing kernel and shell commands.


 
Browse Linux command guide:  A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
 


alias
Alias allows you to substitute a small or more familiar name in place of a long string.
More on this command

apt-get
The apt-get program searches for and installs software packages on Debian-based systems.
How to manage software on Ubuntu Server with "aptitude" and "apt-get"
More on this command

aspell
GNU Aspell is a free, open source spell checker. It's known for its stellar list of replacements for misspelled words.
More on this command

awk, gawk
Awk searches for patterns in a file and processes them. It enables a programmer to write small programs in the form of statements to make changes in text files when certain patterns appear or extract data from those files. This command simplifies a process historically done in C or Pascal languages.
More on this command on Awk

Gawk stands for "GNU awk" and is commonly used in Linux.
More about gawk

bzip2
Reduce the size of backup files by by compressing them with bzip2, which can also be used for decompressing files.
More info:
Try before you buy with Linux 2.6
Beating Trojan horses and backup blues
bzip.org

cat
Abbreviated from the word "concatenate," which means to link things together, cat is used in Linux to link file contents and output them for viewing or printing.
'Cat' is where it's at

cd
The cd command sets the working directory of a process.
More on this command

chmod
Chmod is a utility that changes the permission of a file.
More on this command

chown
Chown is a utility that is also used to change file ownership.
More on this command

cmp
Cmp compares files and lets you know if two or more files are identical.
More on this command

comm
Comm compares sorted files and selects or rejects lines common to two files.
More on this command

cp
The cp command is used to copy files.
Cp is used to copy the kernel to the boot area in "Try before you buy with Linux 2.6."

cpio
Back up empty directories with cpio, which restores files from an archive or creates an archive.
Moving files in a Unix-to-Linux port
Samba-E: Windows files and directory ACLs

cron
Cron is used for scheduling tasks.
More on this command

date
An essential command to set the date and time. Also a useful way to output current information when working in a script file.
More on this command

declare
Declare variables and/or give them attributes with this command.
More on this command

df
The df command reports filesystem disk space usage.
More on this command

echo
This command lets you echo a string variable to standard output.
More on this command

enable
Enables or disables a printer.
More on this command

env
To check environment variables on another account to troubleshoot dotfiles.
More on this command

eval
This POSIX special built-in command evaluates several arguments by reading them as one concatenated argument, then reports on that argument's status.
More on this command

exec
Short for "execute," exec replaces the parent process by whatever command is typed.
There is more than one use for exec. Learn some new ones in this excerpt from Unix Power Tools, 2nd Edition.
More on this command

exit
Allows you to exit from a program, shell or UNIX network.
More on this command

expect
Use expect to automate repetitive tasks.
More on this command

export
Export sets the value of a variable so it is visible to all sub-processes that belong to the current shell.
More on this command

find
Find searches the directory tree rooted at each given file name by evaluating the given expression from left to right, according to the rules of precedence (see section OPERATORS), until the outcome is known (the left hand side is false for and operations, true for or), at which point find moves on to the next file name.
This manual page documents the GNU version of find.

for, while
The commands for and while are used to loop through a list of items and do something for each one.
More about for
More about while

free
The free command enables admins to find statistics about memory usage, showing the total of free, used, physical, swap, shared and other memory used by the kernel.
Put these troubleshooting tools in your toolbox

gawk
See awk

grep
Grep is a command used for searching one or more files for a given character string or pattern. It can also be used to replace the character string with another one.
More info:
Put these troubleshooting tools in your toolbox
Ask the expert: Trouble with the scheduler in RHEL 2.6

gzip
gzip is a compression utility designed to be a replacement for compress. Its main advantages over compress are much better compression and freedom from patented algorithms. It has been adopted by the GNU project and is now relatively popular on the Internet. gzip was written by Jean-loup Gailly and Mark Adler for the decompression code.
More on this command

ifconfig
ifconfig checks a network interface configuration. It can be used, for example, to verify a user's configuration if the user's system has been recently configured or if the user's system cannot reach the remote host while other systems on the same network can.
More info:
Unix-to-Linux migration: Setting up a network
RHEL4 review, part two
RHEL4 administration tools: ifconfig, arp, tcpdump and iptraf

ifup
Starts up network interface.
More on this command

ifdown
Shuts down network interface.
More on this command

less, more
The less command lets an admin scroll through configuration and error log files, displaying text files one screen at a time. The command will enables a search for text within files.
For more about the command less, see Put these troubleshooting tools in your toolbox
More on this command

More goes hand-in-hand with the less command and displays text one screen at a time.
More on this command

locate, slocate
Locate lists files in a database that match a pattern.
More on this command
Slocate, or secure locate provides a secure way to index and quickly search for files on your system. It uses incremental encoding just like GNU locate to compress its database to make searching faster, but it will also store file permissions and ownership so that users will not see files they do not have access to. This site gives variations on locate and slocate and how to use them. It also offers different methods for finding files in Linux.
More on this command

lft
lft is like traceroute but gives a lot more information for debugging connections or just finding where a box/system is.
More on this command

ln
The ln command makes new, alternate file names for a file by hard linking, letting multiple users share one file.
More on this command

ls
The ls command shows information about files. With it, admins can list the contents of a directory in order to determine when the configurations files were last edited. There are many subcommands under ls, such as ls-r, which can reverse the order in which files are displayed.
The ls command is also discussed in this tip: Put these troubleshooting tools in your toolbox
Debugging IPC with Shell commands from "The Linux Programmer's Toolbox Get advice about utilities for debugging communication between processes, find out how to handle open files and dumping data from files, discover commands and more from Chapter 8, Debugging IPC with Shell commands, in "The Linux Programmer's Toolbox."
More on this command

man
Short for "manual," man unveils information about commands and a keyword search mechanism for needed commands.
The man command is also discussed in this tip: Put these troubleshooting tools in your toolbox
Information about the Unix/Linux man command

mc
A visual shell file manager.
More on this command

more
See less

neat
Neat is a GNOME GUI admin tool. Among other things, net lets admins specify information needed to set up a network card.
More info:
Setting up an NTL Cable Modem on Linux using an Ethernet Card Unix-to-Linux migration: Setting up a network

netconfig, netcfg
Netconfig, a command used in configuring a network, displays a series of screens that ask for configuration information.
More info:
Unix-to-Linux migration: Setting up a network Linux Forum netconfig page Network Configuration Using Red Hat netcfg

netstat
The netstat command shows the network status by symbolically displaying the contents of various network-related data structures. There are a number of output formats, depending on the options for the information presented.
More on this command

nslookup
Look up the name of a computer
More on this command

od
Used to dump binary files in octal (or hex or binary). Debugging IPC with Shell commands from "The Linux Programmer's Toolbox Get advice about utilities for debugging communication between processes, find out how to handle open files and dumping data from files, discover commands and more from Chapter 8, Debugging IPC with Shell commands, in "The Linux Programmer's Toolbox."

passwd
A quick and easy way to change passwords on a system.
More on this command

ping
The ping command (named after the sound of an active sonar system) sends echo requests to the host you specify on the command line, and lists the responses received their round trip time. When you terminate ping (probably by hitting control-C) it summarizes the results, giving the average round trip time and the percent packet loss. This command is used constantly to determine whether there is a problem with the network connection between two hosts.
More on this command

ps
Get details on a specific process.
More on this command

pwd
pwd is short for print working directory. The pwd command displays the name of the current working directory.
$ PATH vs. pwd
More on this command

read
Used to read lines of text from standard input into shell variables for further processing.
More on this command

rpm
The Red Hat Package Manager (RPM) is a command-line driven package-management system capable of installing, uninstalling, verifying, querying and updating computer software packages. Each software package consists of an archive of files along with information about the package like its version and a description. RPM.org Learn more in this white paper: Maximum RPM: Taking the Red Hat package manager to the limit Expert response: Yum vs. RPM

rsync
Rsync is focused on synching data from one disk location to another. It was created by Andrew Tridgell, one of Samba's core team.
Learn more in this tip on Rsync and Amanda
More on this command

screen The screen utility is a terminal multiplexor; in essence this means that you can use a single terminal window to run multiple terminal applications.
More on this command Learn more in this tip: Screen: The terminal baby-sitter in the sysadmin's toolbox

sdiff
sdiff produces a human-friendly description of the differences between two text files. It shows the files side-by-side with the symbols to indicate lines only in the left file, lines that differ between the two files and lines only in the right file. Much easier to read than the output of diff.
More on this command

sed
Sed (streams editor) isn't really a true text editor or text processor. Instead, it is used to filter text, i.e., it takes text input and performs some operation (or set of operations) on it and outputs the modified text. Sed is typically used for extracting part of a file using pattern matching or substituting multiple occurrences of a string within a file.
More on this command

shutdown
Shutdown is a command that turns off the computer and can be combined with variables such as -h for halt or -r for reboot.
More on this command

slocate
See locate

snort
Snort is an open source network intrusion-prevention and detection system utilizing a rule-driven language, which combines the benefits of signature, protocol and anomaly based inspection methods. With millions of downloads to date, Snort is the most widely deployed intrusion detection and prevention technology worldwide and has become the de facto standard for the industry.
More on this command

sort
Used to sort lines of text alphabetically or numerically; supports multiple sort keys.
More on this command

sudo
Sudo (superuser do) allows a system administrator to give certain users (or groups of users) the ability to run some (or all) commands as root or another user while logging the commands and arguments.
More on this command

ssh
Ssh is used for secure network connections and tunneling of TCP services.
OpenSSH is one open source SSH version.

tar
The tar program provides the ability to create tar archives, as well as various other kinds of manipulation. For example, you can use tar on previously created archives to extract files, store additional files, or update or list files. Initially, tar archives were used to store files on magnetic tape. The name "tar" comes from this use; it stands for "tape archiver." Despite the utility's name, tar can direct its output to available devices, files, or other programs. Tar may even access remote devices or files.
More on this command

top
Like vmstat, get a view of how the system is performing, see which processes are hogging all the memory.
More on this command

tr
Used to translate or delete characters from a text stream.
A little devil called tr

traceroute
Traceroute determines a route to the host and is very useful for distinguishing network/router issues. If the domain does not work or is not available you can traceroute an IP.
More on this command

uname
This command is helpful when working on different computers which may not be in synch at the OS level. Also, you can print information about those systems.
More on this command

uniq
Used to remove duplicated lines from a list.
More on this command

vi
Vi is a screen-based editor preferred by many Unix users. The Vi editor has powerful features to aid programmers.
Learn more in this tutorial: Mastering the vi editor

vmstat
The vmstat command is used to get a snapshot of everything in a system, helping admins determine whether the bottleneck is CPU, memory or I/O. Run this command to get virtual memory statistics.
How to keep an eye on Linux performance.
More on this command

wc
Word count, used to count words (and characters, and lines) in files.
More on this command

wget
Wget is a network utility to retrieve files from the Web using http and ftp, the two most widely used Internet protocols. It works non-interactively, so it will work in the background, after having logged off.
Information on GNU Wget
More on this command

while
See for

whoami
Tells you what userid you are running under
More on this command

xargs
xargs create command line from data on standard input.
More on this command