Difference between revisions of "Linux Useful Commands"

From CsWiki
Jump to: navigation, search
(Created page with "== Storage Policy == === Backups === First of all, it is important to understand that none of our main file systems are backed up on other devices. This means that in case of ...")
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
== Storage Policy ==
+
== A ==
=== Backups ===
+
=== alias ===
First of all, it is important to understand that none of our main file systems are backed up on other devices. This means that in case of a hardware crash data will be lost.  
+
A way to run a command or a series of Unix commands using a shorter name than those that are usually associated with such commands.
  
=== Snapshots ===
+
=== apt-get ===
Some file systems, have snapshots, which allow a rollback of the file system to a certain point in time. Snapshots reside on the same file system as the data itself, and without backup will be lost as well if a crash occurs.
+
Apt-get is a tool to automatically update a Debian machine and to get and install Debian packages/programs.
  
The main storage systems are:
 
 
'''Home directories''': These reside on a highly capable file server with provided snapshots and
 
have the lowest chance of crashing but are relatively more limited in space.
 
  
'''Storage for labs''':  These are directories that reside under /cs/labs. They provide snapshots
+
=== Aspell ===
and are the volume of choice for large amounts of data.  
+
GNU Aspell is a free and open source spell checker designed to replace Ispell. It can either be used as a library or as an independent spell checker.
  
=== Storage limits ===
+
=== AWK, Gawk ===
Each faculty member is allocated up to 2 terabytes of space, which should cover most users. Anyone requiring more space will be asked to pay a yearly amount that will cover the price of additional storage resources. It is important to note that for each terabyte of data 500 gigabyte is reserved for snapshots.  
+
A programming language tool used to manipulate text. The language of the AWK utility resembles the shell programming language in many areas, although AWK's syntax is very much its own.
 +
----
 +
== B ==
 +
=== bzip2 ===
 +
A portable, fast, open source program used to compress and decompress files at a high rate.
  
Other file systems can have varying snapshot policies. Contact us if you want to better understand their status.
+
== C ==
 +
=== cat ===
 +
A Unix/Linux command that can read, modify or concatenate text files. Cat commands are most commonly used for displaying the contents of a file.
  
=== Additional recommendations ===
+
=== cd ===
To safely store code, we suggest using our [http://wiki.cs.huji.ac.il/wiki/Github Github]. The github virtual machine and data are backed up on two different file-systems, providing high-level resilience.
+
The cd command changes the current directory in Linux and can toggle between directories conveniently. Cd is similar to the CD and CHDIR commands in MS-DOS.
  
Another easy backup option is using the unlimited space Google provides along with your mail HUJI account. Some students and faculty members are using this option and are pleased with the results.
+
=== chmod ===
 +
Chmod changes the access mode (permissions) of one or more files. Only the owner of a file or a privileged user may change the access mode.
  
Snapshots do not behave well with heavy writes. If your lab needs to write a lot of data or do heavy reads please contact us for further assistance.
+
=== chown ===
+
Chown changes file or group ownership and has the option to change ownership of all objects within a directory tree, as well as having the ability to view information on objects processed.
== Disk quotas ==
+
  
Users are allocated disk quota as follows:
+
=== cmp ===
 +
The cmp utility compares two files of any type and writes the results to the standard output. By default, cmp is silent if the files are the same; if they differ, the byte and line number at which the first difference occurred is reported.
  
<table class="wikitable">
+
=== comm ===
<tr><th colspan=2></th><th colspan=4>File System Type</th></tr>
+
Comm compares lines common to file1 and file2.The output is in three columns; from left to right: lines unique to file1, lines unique to file2 and lines common to both files.
<tr><th>Account type</th><th>Group</th><th>Primary</th><th>Safe</th><th>Secondary</th><th>Tertiary</th></tr>
+
<tr><td>undergraduate</td><td>stud</td><td>1G</td><td>200M</td><td>0</td><td>0</td></tr>
+
<tr><td>graduate</td><td>grad</td><td>2G</td><td>2G</td><td>0</td><td>0</td></tr>
+
<tr><td>doctoral</td><td>phd</td><td>4G</td><td>0</td><td>4G</td><td>0</td></tr>
+
<tr><td>post-doctoral</td><td>pdoc</td><td>5G</td><td>0</td><td>5G</td><td>0</td></tr>
+
<tr><td>visting lecturer</td><td>visitor</td><td>5G</td><td>0</td><td>1G</td><td>0</td></tr>
+
<tr><td>faculty</td><td>staff</td><td>20G</td><td>0</td><td>-</td><td>-</td></tr>
+
<tr><td>guest</td><td>guest</td><td>1G</td><td>0</td><td>1G</td><td>0</td></tr>
+
<tr><td>external graduate</td><td>cgrad</td><td>2G</td><td>2G</td><td>0</td><td>0</td></tr>
+
<tr><td>external phd</td><td>cphd</td><td>4G</td><td>0</td><td>4G</td><td>0</td></tr>
+
</table>
+
  
To see how much quota you have, type '''nquota'''. Note that the data for nquota is updated once every few minutes.
+
=== cp ===
 +
The cp command copies files and directories; copies can be made simultaneous to another directory if the copy is under a different name.
  
== Home directories ==
+
=== cpio ===
 +
Cpio copies files into or out of a cpio or tar archive. A tar archive is a file that contains other files, plus information about them, such as their file name, owner, timestamps and access permissions. The archive can be another file on the disk, a magnetic tape or a pipe. Cpio has three operating modes and is a more efficient alternative to tar.
  
User's home directories are located as follows:
+
=== CRON ===
 +
CRON is a Linux system process that will execute a program at a preset time. To use CRON, a user must prepare a text file that describes the program to be executed and the times at which CRON should execute them. Then the crontab program can be used to load the text file that describes the CRON jobs into CRON.
  
<table class="wikitable">
+
== D ==
<tr>
+
=== date ===
<th>File System Type</th><th>Path</th><th>Shorthand</th></tr>
+
Date sets a system's date and time. This is also a useful way to output/print current information when working in a script file.
<tr><td>Primary</td><td><i>/cs/usr/''login''</i></td><td><i>~</i></td></tr>
+
<tr><td>Safe</td><td><i>/cs/+/usr/''login''</i></td><td><i>~/safe</i></td></tr>
+
<tr><td>Secondary</td><td><i>/cs/+/usr/''login''</i></td><td><i>~/.+</i></td></tr>
+
<tr><td>Tertiary</td><td><i>/cs/++/usr/''login''</i></td><td><i>~/.++</i></td></tr>
+
</table>
+
  
Note: ~ is a UNIX alias to one's home directory. ~/safe, ~/.+ and ~/.++ are symbolic links under ~. See ln(1).
+
=== declare ===
 +
Declare declares variables, gives them attributes or modifies properties of variables.
  
'''N.B.''' Groups ''stud'', ''studap'', ''grad'' and ''cgrad'' have '''~/safe''' directories.
 
  
== Snapshot and Backups ==
+
=== df ===
 +
Df displays the amount of disk space available on the file system containing each file name argument. With no file name, available space on all currently mounted file systems is shown.
  
=== Snapshots ===
+
== E ==
 +
=== echo ===
 +
Echo allows a user to repeat, or "echo," a string variable to standard output.
  
Snapshots are '''short-term''' ''online'' backups.  There are three types of snapshots: ''hourly'', ''daily'' and ''weekly''.  Snapshots '''cycle out''' -- i.e. if N hourly snapshots are defined for a filesystem, when the next snapshot is created, the oldest (''[N+1'') snapshot disappears ''permanently''.  Note that '''online''' means that the snapshots are part of the filesystem.  If a filesystem becomes unavailable due to a fileserver failure, the snapshots are ''unavailable'' as well.
+
=== enable ===
 +
Enable will stop or start printers or classes.
  
Snapshots are available in the special <tt>.snapshot</tt> directory and can be accessed using the [[snapshot]] utility or directly (e.g. "cd .snapshot"). Note that the .snapshot doesn't show up when searching a directory (i.e. "ls -a" won't show it), but it exists and can be "cd"-ed into.
+
=== env ===
 +
Env runs a program in a modified environment or displays the current environment and its variables.
  
The current snapshot schedule is as follows:
 
  
<table class="wikitable">
+
=== eval ===
<tr>
+
Eval evaluates several arguments, concatenates them into a single command and then reports on that argument's status.
<th>File System Type</th><th>Path</th><th>Hourly</th><th>Daily</th><th>Weekly</th></tr>
+
<tr><td>Primary</td><td><i>~</i></td><td>24</td><td>14</td><td>8</td></tr>
+
<tr><td>Safe</td><td><i>~/safe</i></td><td>24</td><td>14</td><td>8</td></tr>
+
<tr><td>Secondary</td><td><i>~/.+</i></td><td>24</td><td>14</td><td>8</td></tr>
+
<tr><td>Tertiary</td><td><i>~/.++</i></td><td>0</td><td>0</td><td>0</td></tr>
+
<tr><td>Graduate Labs</td><td>/cs/labs/''supervisor''/''login''</td><td>0</td><td>1</td><td>0</td></tr>
+
</table>
+
  
Note that ''tertiary'' directories (''~/.++'') have '''no backups''' whatsoever.
+
=== exec ===
 +
Exec replaces the parent process with whatever command is typed. This command treats its arguments as the specification of one or more subprocesses to execute.
  
Various labs have specialised filesystems.  The snapshot policy of each and every such filesystem is determined according to the lab's needs/requests.
+
=== exit ===
 +
The exit command terminates a script and can return a value to the parent script.
  
=== Backups ===
+
=== expect ===
 +
Expect talks to other interactive programs according to a script and waits for a response, often from any string that matches a given pattern.
  
Currently, undergraduate and graduate directories have ''snapshots'' '''only'''.
+
=== export ===
 +
Export converts a file into a different format than the one in which it is currently. Once a file is exported, it can be accessed by any application that uses its format.
  
In the future, offsite ''mirroring'' of ''primary'', ''safe'' and ''secondary'' directories is planned.
+
== F ==
 +
=== find ===
 +
Find searches the directory tree to find particular groups of files that meet specified conditions, including --name and --type, -exec and --size and --mtime and --user.
  
Also in the future, offsite ''backups'' for longer-term retention is planned in coordination with the ''Computation Authority''.
+
=== for, while ===
 +
For and while are used to execute or loop items repeatedly as long as certain conditions are met.
  
== Disk space shortage ==
+
=== free ===
 +
Free displays the total amount of free and used physical memory and swap space in the system, as well as the buffers and cache used by the kernel.
  
=== Logging in without quota ===
 
  
If there is insufficient disk space, some window managers might not start at all (e.g. xfce4, or KDE). When this happens you'll receive some message of insufficient quota, or an error message saying the Xsession has terminated too quickly. In this case, to be able to login and clean up your quota, you'll have to login using xterm.
+
== G ==
 +
=== grep ===
 +
Grep searches files for a given character string or pattern and can replace the string with another. This is one method of searching for files within Linux.
  
There are 2 ways to login in xterm:
+
=== gzip ===
# When the chooser appears, choose '''XTerm''' instead of the normal window manager you use.
+
Gzip is the GNU project's open source program used for file compression, compressing web pages on the server end for decompression in the browser. This is popular for streaming media compression and can concatenate and compress several streams simultaneously.
# Before logging in (i.e. entering the username and password), click on the '''Session''' button, and choose '''Failsafe Terminal'''
+
  
After you've logged in, you'll get a simple xterm window. There you can start cleaning up your quota as described in the following sections.
+
== H ==
When finished, simply type '''exit''', and re-login again.
+
  
'''Note:''' Without a window manager, to write commands to the xterm window, you'll have to place the mouse courser on that window.
+
== I ==
 +
=== ifconfig ===
 +
Ifconfig is used to configure the kernel-resident network interfaces. It is used at boot time to set up interfaces. After that, it is usually only needed when debugging or when system tuning is needed.
  
=== Basic cleanup ===
+
=== ifup ===
Some basic utilities to manage disk space:
+
Ifup configures a network interface/enables a network connection.
  
# Are you using safe or secondary storage area (~/safe and ~/.+)?<br>If not there's more space there you can use. Note that with ~/.+ the backup is less often, so it  is not advisable to use it on active projects.
 
# Use the '''cleanup''' script to remove files that can be safely deleted: <pre>cleanup</pre>
 
# Use '''du''' to find how space is distributed within your home directory:<pre>du ~ | sort -n</pre>Note that this will also show you the space taken by files beginning with '.' which do not normally show in directory listings.<br>A more elaborate usage of the '''du''' utility is:<pre>\ls -A1 | sed "s#'#\\\'#" | sed 's/ /\\ /g' | xargs du -sckx -- | sort -n</pre>Which will calculate the sum of each directory (in the current directory). New students have an alias for this as '''dua'''.
 
<!-- this just points back here... # Also, please read our documentation (A short introduction to HUJI-CSE) on the web, and check the chapter 7.3: Freeing Disk Space. The document is what we use during the course on Fridays at the beginning of the year. -->
 
  
=== Mail ===
+
=== ifdown ===
 +
Ifdown shuts down a network interface/disables a network connection.
  
This section only applies for those using a local program for reading mail (e.g. thunderbird, kmail, etc.), if you are using a web browser to read the mail (e.g. the mail.huji mail account's web interface) this does not apply.  
+
 
* By default, your mail is saved under your home directory. Old mail and mail with big attachments (multimedia, PDFs, junk) can cause space shortage. To avoid it, remember to periodically clean up your inbox.
+
== J ==
* You should be able to see if the mail is taking your disk space by using the above '''du''' command, either ~/Mail, or ~/.mozilla-thunderbird will take a lot of space (depending on your mail client).
+
== K ==
* On some mail clients (e.g. thunderbird/icedove, kmail) simply deleting the mail isn't enough. You need to '''compact''' the inbox folder (or other folders, if you use any). You can do this (in kmail and thunderbird/icedove), by right clicking on the folder, and choosing "Compact this folder".
+
== L ==
* On thunderbird/icedove, you can tell the program to do this automatically by setting:<pre>Edit -> Preferences -> Advanced -> Offline & Disk Space -> Compact folders when ...</pre>For new users, it is already set (so old users can use '''reinstall''' thunderbird, to set this configuration).
+
=== less, more ===
** Sometimes, when very low on memory compacting doesn't work. In that case, you can either:
+
The less command lets an admin scroll through configuration and error log files, displaying text files one screen at a time, with backward or forward moving available in files. There is more mobility within files.
**# Better: '''reinstall''' thunderbird - reinstall also compacts the folders (specifically, the Inbox, Sent, and Trash).<br>or  
+
 
**# Risky: Run the script '''/cs/share/scripts/compact-thunderbird.sh'''.
+
Similar to less, more pages through text one screen at a time, but is more limited in moving in files.
:: '''''Warning''''': Please note that you need to '''close thunderbird''' before running these scripts.
+
 
::These methods should be executed only once, since after changing the preferences and compacting the folders, thunderbird should be able to manage the compcat by itself (and it will do so each time you open it).
+
=== locate, slocate ===
 +
Locate reads one or more databases and writes file names matching certain patterns to output.
 +
 
 +
Like locate, slocate, or secure locate, provides a way to index and quickly search for files, but also securely stores file permissions and ownership so unauthorized users will be unable to view such information.
 +
 
 +
=== lft ===
 +
Lft is similar to traceroute in determining connection routes, but provides a lot more information for debugging connections or finding where a box/system is. Lft also displays route packets and file types.
 +
 
 +
 
 +
=== ln ===
 +
The ln command creates a new name for a file through hard linking, allowing multiple users to share one file.
 +
 
 +
=== ls ===
 +
The ls command lists files and directories within the current working directory, allowing admins to see when configuration files were last edited.
 +
 
 +
== M ==
 +
=== man ===
 +
Short for "manual," man allows a user to format and display the user manual built into Linux distributions which documents commands and other aspects of the system.
 +
 
 +
=== mc ===
 +
A visual shell, text-based file manager for Unix systems.
 +
 
 +
=== more ===
 +
see "less"
 +
 
 +
 
 +
== N ==
 +
=== neat ===
 +
Neat is a GNOME GUI admin tool which allows admins to specify the information needed to set up a network card, among other features.
 +
 
 +
=== netconfig/netcfg ===
 +
Netconfig configures a network, enables network products and displays a series of screens that ask for configuration information.
 +
 
 +
=== netstat ===
 +
Netstat provides information and statistics about protocols in use and current TCP/IP network connections. It is a helpful forensic tool in figuring out which processes and programs are active on a computer and are involved in network communications.
 +
 
 +
=== nslookup ===
 +
Nslookup allows a user to enter a host name and find the corresponding IP address. A reverse of that process to find the host name is also possible.
 +
 
 +
 
 +
== O ==
 +
=== od ===
 +
Od is used to dump binary files in octal (or hex/binary) format to standard output.
 +
 
 +
== P ==
 +
=== passwd ===
 +
Passwd updates a user's authentication tokens (changes their current password).
 +
 
 +
=== ping ===
 +
Ping allows a user to verify that a particular IP address exists and can accept requests. Ping can be used to test connectivity and determine response time, as well as to ensure that a host computer the user is trying to reach is actually operating.
 +
 
 +
=== ps ===
 +
Ps reports the statuses of current processes in a system.
 +
 
 +
=== pwd ===
 +
The pwd (print working directory) command displays the name of the current working directory. This is a basic Linux command.
 +
 
 +
== R ==
 +
=== read ===
 +
Read is used to read lines of text from standard input and to assign values of each field in the input line to shell variables for further processing.
 +
 
 +
=== RPM ===
 +
Red Hat Package Manager (RPM) is a command-line-driven program capable of installing, uninstalling and managing software packages in Linux.
 +
 
 +
=== rsync ===
 +
Rsync syncs data from one disk or file to another across a network connection. Rsync is similar to rcp, but has more options.
 +
 
 +
== S ==
 +
=== screen ===
 +
The GNU screen utility is a terminal multiplexor in which a user can use a single terminal window to run multiple terminal applications or windows.
 +
 
 +
=== sdiff ===
 +
Sdiff finds differences between two files by producing a side-by-side listing indicating lines that are dissimilar. Sdiff then merges the files and outputs results to the outfile.
 +
 
 +
=== sed ===
 +
Sed is a stream editor that is used to filter text in a pipeline, distinguishing it from other editors. Sed takes text input, performs operations on it and outputs the modified text. Sed is typically used to extract part of a file using pattern matching or to substitute multiple occurrences of a string within a file.
 +
 
 +
=== shutdown ===
 +
Shutdown is a command that turns off the computer and that can be combined with variables such as -h, for halt after shutdown, or -r, for reboot after shutdown.
 +
 
 +
=== slocate ===
 +
see "locate"
 +
 
 +
=== snort ===
 +
Snort is an open source network intrusion detection system and packet sniffer that monitors network traffic, looking at each packet to detect dangerous payloads or suspicious anomalies. Snort is based on libpcap.
 +
 
 +
=== sort ===
 +
Used to sort lines of text alphabetically or numerically according to fields; multiple sort keys can also be used.
 +
 
 +
=== sudo ===
 +
Sudo allows a system admin to give certain users the ability to run some (or all) commands at the root level and logs all commands and arguments.
 +
 
 +
=== ssh ===
 +
SSH is a command interface used for securely gaining access to a remote computer and is used by network admins to control servers remotely.
 +
 
 +
 
 +
== T ==
 +
=== tar ===
 +
The tar program provides the ability to create archives from a number of specified files or to extract files from such an archive.
 +
 
 +
=== TOP ===
 +
TOP is a set of protocols for networks that performs distributed information processing in offices and displays the tasks on the system that take up the most memory. TOP can sort tasks by CPU usage, memory usage and runtime.
 +
 
 +
=== tr ===
 +
Tr is used to translate or delete characters from a text stream. Tr writes to standard output, but does not accept file names as arguments -- it only accepts inputs from standard input.
 +
 
 +
=== traceroute ===
 +
Traceroute determines and records a route through the internet between two computers and is useful for troubleshooting network/router issues. If the domain does not work or is not available, an IP can be tracerouted.
 +
 
 +
 
 +
== U ==
 +
=== uname ===
 +
Uname displays the name of the current operating system and can print information about the system.
 +
 
 +
=== uniq ===
 +
Uniq compares adjacent lines in a file and removes/reports any duplicate lines.
 +
 
 +
== V ==
 +
=== vi ===
 +
Vi is a text editor that allows a user to control the system by solely using the keyboard instead of a combination of mouse selections and keystrokes.
 +
 
 +
=== vmstat ===
 +
Vmstat is used to get a snapshot of everything in a system and to report information on such items as processes, memory, paging and CPU activity. This is a good method for admins to use to determine where issues/slowdown in a system may be occurring.
 +
 
 +
== W ==
 +
=== wc ===
 +
Wc counts the number of words, lines and characters in text files and produces a count for multiple files if several files are selected.
 +
 
 +
=== wget ===
 +
Wget is a network utility that retrieves files from the web that support http, https and ftp protocols. Wget works non-interactively in the background while a user is logged off. This can create local versions of remote websites, re-creating directories of original sites.
 +
 
 +
=== while ===
 +
See "for."
 +
 
 +
=== whoami ===
 +
Whoami prints or writes the user/login name associated with the current user ID to the standard output.
 +
 
 +
== X ==
 +
=== xargs ===
 +
Xargs reads, builds and executes arguments from standard input; blank lines in the input are ignored.
 +
 
 +
== Y ==
 +
 
 +
== Z ==

Revision as of 14:04, 11 April 2018

A

alias

A way to run a command or a series of Unix commands using a shorter name than those that are usually associated with such commands.

apt-get

Apt-get is a tool to automatically update a Debian machine and to get and install Debian packages/programs.


Aspell

GNU Aspell is a free and open source spell checker designed to replace Ispell. It can either be used as a library or as an independent spell checker.

AWK, Gawk

A programming language tool used to manipulate text. The language of the AWK utility resembles the shell programming language in many areas, although AWK's syntax is very much its own.


B

bzip2

A portable, fast, open source program used to compress and decompress files at a high rate.

C

cat

A Unix/Linux command that can read, modify or concatenate text files. Cat commands are most commonly used for displaying the contents of a file.

cd

The cd command changes the current directory in Linux and can toggle between directories conveniently. Cd is similar to the CD and CHDIR commands in MS-DOS.

chmod

Chmod changes the access mode (permissions) of one or more files. Only the owner of a file or a privileged user may change the access mode.

chown

Chown changes file or group ownership and has the option to change ownership of all objects within a directory tree, as well as having the ability to view information on objects processed.

cmp

The cmp utility compares two files of any type and writes the results to the standard output. By default, cmp is silent if the files are the same; if they differ, the byte and line number at which the first difference occurred is reported.

comm

Comm compares lines common to file1 and file2.The output is in three columns; from left to right: lines unique to file1, lines unique to file2 and lines common to both files.

cp

The cp command copies files and directories; copies can be made simultaneous to another directory if the copy is under a different name.

cpio

Cpio copies files into or out of a cpio or tar archive. A tar archive is a file that contains other files, plus information about them, such as their file name, owner, timestamps and access permissions. The archive can be another file on the disk, a magnetic tape or a pipe. Cpio has three operating modes and is a more efficient alternative to tar.

CRON

CRON is a Linux system process that will execute a program at a preset time. To use CRON, a user must prepare a text file that describes the program to be executed and the times at which CRON should execute them. Then the crontab program can be used to load the text file that describes the CRON jobs into CRON.

D

date

Date sets a system's date and time. This is also a useful way to output/print current information when working in a script file.

declare

Declare declares variables, gives them attributes or modifies properties of variables.


df

Df displays the amount of disk space available on the file system containing each file name argument. With no file name, available space on all currently mounted file systems is shown.

E

echo

Echo allows a user to repeat, or "echo," a string variable to standard output.

enable

Enable will stop or start printers or classes.

env

Env runs a program in a modified environment or displays the current environment and its variables.


eval

Eval evaluates several arguments, concatenates them into a single command and then reports on that argument's status.

exec

Exec replaces the parent process with whatever command is typed. This command treats its arguments as the specification of one or more subprocesses to execute.

exit

The exit command terminates a script and can return a value to the parent script.

expect

Expect talks to other interactive programs according to a script and waits for a response, often from any string that matches a given pattern.

export

Export converts a file into a different format than the one in which it is currently. Once a file is exported, it can be accessed by any application that uses its format.

F

find

Find searches the directory tree to find particular groups of files that meet specified conditions, including --name and --type, -exec and --size and --mtime and --user.

for, while

For and while are used to execute or loop items repeatedly as long as certain conditions are met.

free

Free displays the total amount of free and used physical memory and swap space in the system, as well as the buffers and cache used by the kernel.


G

grep

Grep searches files for a given character string or pattern and can replace the string with another. This is one method of searching for files within Linux.

gzip

Gzip is the GNU project's open source program used for file compression, compressing web pages on the server end for decompression in the browser. This is popular for streaming media compression and can concatenate and compress several streams simultaneously.

H

I

ifconfig

Ifconfig is used to configure the kernel-resident network interfaces. It is used at boot time to set up interfaces. After that, it is usually only needed when debugging or when system tuning is needed.

ifup

Ifup configures a network interface/enables a network connection.


ifdown

Ifdown shuts down a network interface/disables a network connection.


J

K

L

less, more

The less command lets an admin scroll through configuration and error log files, displaying text files one screen at a time, with backward or forward moving available in files. There is more mobility within files.

Similar to less, more pages through text one screen at a time, but is more limited in moving in files.

locate, slocate

Locate reads one or more databases and writes file names matching certain patterns to output.

Like locate, slocate, or secure locate, provides a way to index and quickly search for files, but also securely stores file permissions and ownership so unauthorized users will be unable to view such information.

lft

Lft is similar to traceroute in determining connection routes, but provides a lot more information for debugging connections or finding where a box/system is. Lft also displays route packets and file types.


ln

The ln command creates a new name for a file through hard linking, allowing multiple users to share one file.

ls

The ls command lists files and directories within the current working directory, allowing admins to see when configuration files were last edited.

M

man

Short for "manual," man allows a user to format and display the user manual built into Linux distributions which documents commands and other aspects of the system.

mc

A visual shell, text-based file manager for Unix systems.

more

see "less"


N

neat

Neat is a GNOME GUI admin tool which allows admins to specify the information needed to set up a network card, among other features.

netconfig/netcfg

Netconfig configures a network, enables network products and displays a series of screens that ask for configuration information.

netstat

Netstat provides information and statistics about protocols in use and current TCP/IP network connections. It is a helpful forensic tool in figuring out which processes and programs are active on a computer and are involved in network communications.

nslookup

Nslookup allows a user to enter a host name and find the corresponding IP address. A reverse of that process to find the host name is also possible.


O

od

Od is used to dump binary files in octal (or hex/binary) format to standard output.

P

passwd

Passwd updates a user's authentication tokens (changes their current password).

ping

Ping allows a user to verify that a particular IP address exists and can accept requests. Ping can be used to test connectivity and determine response time, as well as to ensure that a host computer the user is trying to reach is actually operating.

ps

Ps reports the statuses of current processes in a system.

pwd

The pwd (print working directory) command displays the name of the current working directory. This is a basic Linux command.

R

read

Read is used to read lines of text from standard input and to assign values of each field in the input line to shell variables for further processing.

RPM

Red Hat Package Manager (RPM) is a command-line-driven program capable of installing, uninstalling and managing software packages in Linux.

rsync

Rsync syncs data from one disk or file to another across a network connection. Rsync is similar to rcp, but has more options.

S

screen

The GNU screen utility is a terminal multiplexor in which a user can use a single terminal window to run multiple terminal applications or windows.

sdiff

Sdiff finds differences between two files by producing a side-by-side listing indicating lines that are dissimilar. Sdiff then merges the files and outputs results to the outfile.

sed

Sed is a stream editor that is used to filter text in a pipeline, distinguishing it from other editors. Sed takes text input, performs operations on it and outputs the modified text. Sed is typically used to extract part of a file using pattern matching or to substitute multiple occurrences of a string within a file.

shutdown

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

slocate

see "locate"

snort

Snort is an open source network intrusion detection system and packet sniffer that monitors network traffic, looking at each packet to detect dangerous payloads or suspicious anomalies. Snort is based on libpcap.

sort

Used to sort lines of text alphabetically or numerically according to fields; multiple sort keys can also be used.

sudo

Sudo allows a system admin to give certain users the ability to run some (or all) commands at the root level and logs all commands and arguments.

ssh

SSH is a command interface used for securely gaining access to a remote computer and is used by network admins to control servers remotely.


T

tar

The tar program provides the ability to create archives from a number of specified files or to extract files from such an archive.

TOP

TOP is a set of protocols for networks that performs distributed information processing in offices and displays the tasks on the system that take up the most memory. TOP can sort tasks by CPU usage, memory usage and runtime.

tr

Tr is used to translate or delete characters from a text stream. Tr writes to standard output, but does not accept file names as arguments -- it only accepts inputs from standard input.

traceroute

Traceroute determines and records a route through the internet between two computers and is useful for troubleshooting network/router issues. If the domain does not work or is not available, an IP can be tracerouted.


U

uname

Uname displays the name of the current operating system and can print information about the system.

uniq

Uniq compares adjacent lines in a file and removes/reports any duplicate lines.

V

vi

Vi is a text editor that allows a user to control the system by solely using the keyboard instead of a combination of mouse selections and keystrokes.

vmstat

Vmstat is used to get a snapshot of everything in a system and to report information on such items as processes, memory, paging and CPU activity. This is a good method for admins to use to determine where issues/slowdown in a system may be occurring.

W

wc

Wc counts the number of words, lines and characters in text files and produces a count for multiple files if several files are selected.

wget

Wget is a network utility that retrieves files from the web that support http, https and ftp protocols. Wget works non-interactively in the background while a user is logged off. This can create local versions of remote websites, re-creating directories of original sites.

while

See "for."

whoami

Whoami prints or writes the user/login name associated with the current user ID to the standard output.

X

xargs

Xargs reads, builds and executes arguments from standard input; blank lines in the input are ignored.

Y

Z