Linux Commands

Download as pdf or txt
Download as pdf or txt
You are on page 1of 7

Linux Command Reference

Page 1 of 7

Page provided by Perpetual PC's

Linux Command Reference Index ( GNU / linux kernel 2.4.18-3, 2.4.18-14 and 2.4.20-6 )*
Linux is a registered trademark of Linus Torvalds
These are just a few of the most common GNU / Linux commands that you may find yourself looking for, along with some answers to common questions about running Linux. On most systems more information about a command can be found by typing [ man command ] ; man being the word man and command being the particular command you are checking. You will need to be root to use some of these commands ; also be sure to check your path. If there is no path to the command then you will likely get a " command not found " error. Check the command to be sure you have typed it correctly. Be extremely careful as root , you can make your system unusable. This is very important to understand. If you are using a dual boot system you may not be able to access either system if you make a mistake as root and your system is not bootable. Before you type any command as root be absolutely certain of what you are doing. Any comments are encouraged and welcome at Update March 08, 2011: I am in the process of checking all the commands on Ubuntu Linux (Lucid). The Kernel I am using is ( 2.6.32-29-generic #58-Ubuntu SMP Fri Feb 11 19:00:09 UTC 2011 i686 GNU/Linux ). So far All the commands up to "pdfinfo" work. Please note that some of the commands may refer to programs not yet installed on your machine. Ubuntu will ask you if you want to install a program usually rather than just give you a "command not found" message. For example when I typed the command "quota" (without the quotes and after I pressed enter, of course) I got this: The program 'quota' is currently not installed. You can install it by typing: sudo apt-get install quota You will then be asked to type your password (the admin password) and the installation will proceed (after you press enter) (this assumes you have an active internet connection). First posted 2002-10-14 page last modified 2011-03-22

Linux Commands
A B C D E F G H I K L M N P Q R S T U V W XYZ References and answers back to beginning
A alias Create your own name for a command arch print machine architecture ash ash command interpreter (shell) awk (gawk) pattern scanning and processing language N namei Follow a pathname until a terminal point is found nano An enhanced free Pico clone nc arbitrary TCP and UDP connections and listens (note that nc is also called the client interface to the NEdit program but it is not the command that invokes nedit-nc on current systems) ncftp Browser program for the File Transfer Protocol B basename Remove directory and suffix from a file name bash GNU Bourne-Again Shell bsh Command interpreter (Shell) nedit-nc nedit-nc is the client interface to the NEdit text editor netstat Display verbose info about network processes and ports nice Run a command with modified priority nisdomainname Show or set system's NIS/YP domain name

file://C:\Users\Bharath.Bharath-PC\Desktop\r s agarwal\Linux Command Reference.htm

11/8/2011

Linux Command Reference

Page 2 of 7

bc Command line calculator bunzip2 Unzip .bz2 files

nslookup query internet domain name servers

P C back to commands top cat Concatenate a file print it to the screen chgrp Change the group designation of a file chmod Change file permissions chown Change the owner of a file cjpeg Compress an image file to a JPEG file clear Clear terminal screen (command line) comm Compare two sorted files stty cooked Formatting the display of text in a terminal cp Copy command cpio Copy files to and from archives csh C Shell cut Print selected parts of lines to standard output paste Merge lines of files pdf2dsc Generate a PostScript page list of a PDF document pdf2ps Convert PDF file "input.pdf" to PostScript(tm) in "output.ps" pdfinfo Print contents of the 'Info' dictionary (plus some other useful information) from a PDF file pdftotext Convert pdf files to plain text perl (start) Practical Extraction and Report Language pgawk The profiling version of gawk pico Text editor that comes with Pine (from the University of Washington) pine Email program used by The University of Washington ping6 Ping ping Send ICMP ECHO_REQUEST to network hosts pinky A lightweight 'finger' program; pr Format for printing ps Processes running D back to commands top date Display date and time dc Command line calculator df Show amount of disk space free diff Determine difference between two files diff3 Determine difference between 3 files dig Interrogate DNS name servers djpeg Decompress a JPEG file to an image file dmesg Print or control the kernel ring buffer (print out bootup messages) dnsdomainname Show the system's DNS domain name doexec Run an executable with an arbitrary argv domainname Show or set the system's NIS/YP domain name dos2unix Converts plain text files in DOS/MAC format to UNIX format du Show disk useage dumpkeys Write keyboard driver's translation tables to std output Q back to commands top quota display disk usage and limits E back to commands top ps2ascii Ghostscript translator from PostScript or PDF to ASCII ps2epsi Generate conforming Encapsulated PostScript ps2frag Obsolete shell script for the PSfrag system ps2pdf12 Convert PostScript to PDF 1.2 (Acrobat 3 and later compatible) using ghostscript ps2pdf13 Convert PostScript to PDF 1.3 (Acrobat 4 and later compatible) using ghostscript ps2pdf14 Use ps2pdfwr: Convert PostScript to PDF without specifying Compatibility Level, using ghostscript ps2pdf Convert PostScript to PDF using ghostscript ps2pdfwr Convert PostScript to PDF without specifying Compatibility Level, using ghostscript ps2pk creates a TeX pkfont from a type1 PostScript font ps2ps ps2ps uses gs to convert PostScript(tm) file "input.ps" to simpler and (usually) faster PostScript in "output.ps" psbook Rearranges pages from a PostScript document into "signatures" for printing books or booklets pwd Print Working Directory

file://C:\Users\Bharath.Bharath-PC\Desktop\r s agarwal\Linux Command Reference.htm

11/8/2011

Linux Command Reference

Page 3 of 7

echo Display a line of text ed Line-oriented text editor egrep Print lines matching a pattern elinks A text mode WWW browser (supports frames) env Dislay the path ex Start Vim in ex mode eject Eject media from device ( command line ) R back to commands top resize Xterm window size readelf Displays information about ELF files reboot Stop the system, poweroff, reboot red red is a restricted ed: it can only edit files in the current directory and cannot execute shell commands rename Rename files rmdir Remove a directory rm Remove files or directories F back to commands top factor Display prime factors of a number false Exit with a status code indicating failure fdisk The fdisk command with usage examples fgrep Variant of grep find Find a file finger Displays information about the system users fixps Try to fix common PostScript problems that break postprocessing free Display free memory S back to commands top sed Stream editor setfont Load EGA/VGA console screen font set gid Set group id set serial Get / set Linux serial port info set uid Set user id sfdisk Modified fdisk program G back to commands top grep Search for a pattern using regular expression gtar See the tar command gunzip Unzip .gz files gzip Compress using Lempel-Ziv coding (LZ77) sftp Secure file transfer protocol (ftp) sh Shell (BASH) shred Safely remove data from disk drive sleep Delay for a specified amount of time slocate Security Enhanced version of the GNU Locate sort Sort lines of a text file ssh Secure shell connection command stty change and print terminal line settings stty raw Unformatted output to terminal H back to commands top halt Stop the system hdparm Get/set harddisk parameters head Print the first 10 lines of a file to standard output hostname Show or set the system's host name history Display entire command history HISTSIZE Change history size httpd Start Apache T back to commands top tail Print the last 10 Lines of a file standard output tar Create an Archive tcsh Enhanced completely compatible version of the Berkeley I back to commands top identify Describes the format and UNIX C shell, csh tee Copy standard input to each file, and also to standard su Become super user ( root ) switchdesk Graphical and text mode interface for choosing desktop environment sync Force changed blocks to disk, update the super block ssh Secure shell connection command rpm rpm command options rundig Sample script to create a search database for ht://Dig rview The GUI version of Vim in easy mode with restrictions rvi Vi / Vim editor

file://C:\Users\Bharath.Bharath-PC\Desktop\r s agarwal\Linux Command Reference.htm

11/8/2011

Linux Command Reference

Page 4 of 7

characteristics of image files. id Print information for username, or the current user ifconfig Display network and hardware addresses igawk Gawk with include files ipcalc Calculate IP information for a host

output telnet User interface to the telnet protocol time Run the specified program command with the given arguments touch Change file timestamps tracepath6 See tracepath tracepath Trace path to a network host discovering MTU along this path traceroute6 See traceroute

K back to commands top kbd_mode Report or set the keyboard mode (RAW, MEDI- UMRAW or XLATE) kill Terminate a process

traceroute Print the route packets take to network host tree Display file tree true Exit with a status code indicating success tty Print name of terminal connected to standard output

L back to commands top last Show listing of last logged in users lastlog Formats and prints the contents of the last login log /var/log/lastlog file link Call the link function to create a link to a file links See elinks ln Create a link to the specified TARGET with optional LINK_NAME loadkeys Load keyboard translation tables locate Locate a file login Sign on look Displays any lines in file which contain "string" as a prefix. ls List directory contents lsmod List loaded kernel modules lynx Command to start the Lynx browser

U back to commands top umask File creation mask / Bash builtins umount Detache file system(s) mentioned from file hierarchy uname Print system information ( kernel version ) unicode_start Put keyboard and console into Unicode (UTF-8) mode unicode_stop Undo the effect of unicode_start unlink Call the unlink function to remove the specified file uniq Remove duplicate lines from sorted file updatedb Update the slocate database unset gid Group id change unset uid User id change untar Unarchive ( untar ) a file unzip Unzip .zip files useradd Add new user users Output who is currently logged in according to system records usleep Sleep a given number of microseconds. default is 1

M back to commands top mac2unix Converts plain text files in DOS/MAC format to UNIX format mail A mail processing system, which has a command syntax like ed man Display a particular manual entry manweb Manweb is part of the Netpbm package mdu Display the amount of space occupied by an MSDOS directory mkdir Create a directory W back to commands top w Show who is logged on and what they are doing wc Word count of a file wget Non-interactive download of files from the Web whatis Search the whatis database for complete words V back to commands top view Start vim in read-only mode vi Start the vi editor

file://C:\Users\Bharath.Bharath-PC\Desktop\r s agarwal\Linux Command Reference.htm

11/8/2011

Linux Command Reference

Page 5 of 7

mkfs Make a filesystem on a drive mknod Make block or character special files mktemp Make temporary filename (unique) more Page through text one screenful at a time. mount Mount a filesystem/device mt Control magnetic tape drive operation mv Move and / or rename files :

(command names) whereis Locate a command or file which Find command path whoami Print effective userid who show who is logged on whois Client for the whois service

X,Y,Z back to commands top xinit Start Xserver xpdf Portable Document Format (PDF) file viewer for X windows xrandr Change resolution running Xwindows ( command line ) ypdomainname show or set the system's NIS/YP domain name zcat Compress or expand files zip Compression and file packaging utility for Unix, VMS, MSDOS, OS/2, Windows NT, Minix, Atari and Macintosh, Amiga and Acorn RISC OS. It is analogous to a combination of the UNIX commands tar(1) and compress(1) and is compatible with PKZIP (Phil Katz systems) zipinfo List detailed information about a ZIP archive s ZIP for MSDOS

* All the above commands except the eject command ran on kernel 2.6.9-1.667 ( Fedora Core 3 ). I am still in the process of testing the recently added commands on older kernels.

References and answers to questions about running Linux


back to commands back to beginning
Access documentation Access a usb flash drive Access a usb flash drive running FC11 Get default file Activate a swap file Add a new user Add a new disk drive permissions Get detailed cpu info Get harddrive info Fix unrecognized cd drive in rh7.2 and/or Fedora core 3 How do I sort a file? Format command mkfs How do I start Gnome or KDE runnning Slackware? Set uid How do I stop a command from running? Set uid and gid and rwx Set uid and gid Set time and date of a file Set the time zone How do I set up Vim or Gvim text color? Set gid Set date and time

file://C:\Users\Bharath.Bharath-PC\Desktop\r s agarwal\Linux Command Reference.htm

11/8/2011

Linux Command Reference

Page 6 of 7

Add/format/partition a new external hard drive (FC9)

Get hardware info Get ip addresses

How do I stop ppp0 from running at the command line? How do I stop the ppp daemon at the command line?

for all in directory set up balsa Setup command ( RedHat ) Show memory usage

Become super user Get irq info Change command history size Change the irq of a port Command to directly print a manual page Get kernel version number Command not found error Get operating system Command line login access How can I sort out hits to Compare two files Concatenate convert for printing How do I access the count files in a directory cpu info How do I change text Create an empty file create empty file / touch command Debian command line login How do I copy a filename Determine directory sizes Difference between two files How do I enable the su Display disk usage Display path and other stuff DSL with Verizon won't work on Linux How do I look at boot up Remove duplicates in command? How do I log in (connect) using ssh or sftp? Modems that work on linux Opera needs libXm.so.2 What processes are running? what is my path to a command? containing spaces? Make installation boot How do i display the path? disk what is the copy command in Linux? Make a boot disk What is a hostname? How do I change screen resolution on the fly? Lock the screen What directory am I in? colors? Locate a file Untar and unzip a file List partitions Unset uid cdrom drive running Slackware9.1? List files Unset gid my website? How do I access a disk drive? List directories and files Unformatted output on command line IP-MasqueradeHOWTO ( this is a link to another site ) Ubuntu 8.10 - monitor not recognized - how to add higher resolutions version Invoke previous command tty command tidy help Get printer jobs and status Get processor type Get terminal line settings How to convert octal to symbolic file permissions Some editors availble in Linux

How many words or lines in a file? Slackware setup suggestions

file://C:\Users\Bharath.Bharath-PC\Desktop\r s agarwal\Linux Command Reference.htm

11/8/2011

Linux Command Reference

Page 7 of 7

messages? Extract files tar untar How do I increase the list fdisk command Fedora core 3 Evolution 2.0.2 host lookup failed: How do I install a program File space use estimate Firefox 2 crashes on flash sites (a fix for Slackware) Find a file How do I look at command history? on a Linux machine? of recently opened files in open office 1.1.2?

a file Resize a window

xf86config Xwindows configuration command xf86config Xwindows

Resource usage command

configuration editing Yet another way to locate

rpm commands Run levels Samba commands Scroll bars wrong on

a file

How do I make Slackware boot disks?

browser Search a file for an

How do I mount a usb floppy running linux?

expression Find a word in a file in

How do I print a manual page to a text file?

a directory set date

How do I send a manual page (or pages) to an html file (or files)? How do I send the output of a command to a file?

Copyright (c) 2002 David Tarsi.Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with the Invariant Sections being no invariant sections, with the Front-Cover Texts being no Front-Cover Texts, and with the Back-Cover Texts being no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License". GNU Free Documentation License Perpetual PC's home page Perpetual PC's link page

file://C:\Users\Bharath.Bharath-PC\Desktop\r s agarwal\Linux Command Reference.htm

11/8/2011

You might also like