Linux PowerHouse Station Logo Linux PowerHouse Station Banner
Presented by: Kimmie Dicaire
And the #linuxhelper@dal.net ops
3 walking penguins
Home

Distributions
HOWTOs
Tutorials
Man Pages
Help Database
Basic Commands
Security/Patches
Editorials
Hot Links
Channel Operators
Channel Rules

Credits
Feedback
Email Kimmie
About Kimmie
Kimmie's Resume
Quick Reference to Frequently Used Commands

Here I have compiled a list of some of the most used Unix/Linux commands. This list is in alphabetical order. I will be modifying this page adding examples of how to use many of the commands found here. Please be patient while this page is being updated. To get more help on how each of these work do 'man command' at the prompt to get the man page for each term or use this site's man pages viewer.

alias
To create an alias (nickname) for a command or show which aliases already exist. Example:To create an alias in your .profile or .bash file you can do this
Format: alias alias name ='command'
Working Example: alias ls='ls -p --color=auto'
Aliases created in the .profile will always be available. You can also create aliases on the commandline that will only last for the current login sesstion. To create an alias at the commandline the principle/format is the same for example at your commandline you can type:
alias ls='ls -p --color=auto'
at
To schedule a command to run at a particular time. Great for running time-consuming commands later, such as in the middle of the night. If you want to run a command at the same time at regular intervals, look at cron.
apt
A package management tool used by the Debian Linux distribution.
This is Debian specific, those running Debian can do "man apt" to find out specific usages
banner
To display text in huge, ugle letters on the console or to the printer.
Format: banner -w [width] message
Working example: banner -w 45 This is a test
bash
To run the BASH shell, optionally running a script
This is a very in- depth command do "man bash" to see all the options and usages
bc
A handy-dandy desk calculator
By typing "bc" it will put you in command mode for the calculator, you can then begin typing mathematical equations and hit enter for the answers. Type quit to exit the program
Working example: bc
5 + 5 < enter >
This will give the answer 10
quit
bg
To background a process or job.
There are a couple of ways to use this command. I prefer to use it when I start a program by adding "&" at the end of the command. This will place the started program in the background freeing up the terminal. You may also use this command while in the middle of working in a terminal and you need to free up the terminal to do something else real quick. Just press < ctrl > + z, then type bg and it will place the running program in the background. See fg for instructions on how to get the program back in the working forground.
cal
To print a calender for a month or a year
This is a handy little program when you need to find out the days in a month or anything that requires having a calendar close by. Typing "cal" by itself will output the current month of the current year. Typing "cal <some year>" will give the entire years calender month and days. For example "cal 1999" would give you Jan thru Dec of the year 1999. You can also get a specific month/year by doing "cal 10 1999". This would give you Oct 1999. To compare the same month from different years you could do "cal 10 1999 && cal 10 2000". This would give you the output of Oct 1999 and Oct 2000.
cat
To display a file on-screen
This will output the contents of a file to your screen or place its contents into another file depending on how you use it.
Working example: cat somefile.txt
In the above example the contents of somefile.txt would be output to your screen
Working example: cat somefile.txt > anotherfile.txt
In the above example the contents of somefile.txt would be redirected into a new file called anotherfile.txt
cd
To change to another directory, that is, to change the current working directory to the directory you indicate.
This is a simple command to change your current directory. It basically works the same way in UNIX/Linux as it does in DOS
Working examples: cd..
This would back you up one directory in the tree.
cd /usr/local/apache
This would place you in the specified directory. Simple enough.
chgrp
To change the group that has access to a file or directory
chmod
To change the permissions for a file
chown
To change the ownership of a file
cmp
Compares the contents of two files. If the files are different, then cmp returns the byte posititon and line number of the first difference between the two files. If there is no difference, then cmp returns nothing. The cmp command works on all files not just text files. Other similar commands such as comm and diff only work with text files.
Example: cmp my.report my.file If there was a difference in the files the output would look something like
my.report my.file differ: char 56, line 3
You can use the -l switch to have it show all the differences between two files.
comm
Compares the contents of two presorted text files. The output is generated into three columns.
Lines found in file1, Lines found in file2, Lines found in both files.
Example: "comm my.report my.file"
compress
Compresses a file or (files), creating a filename.Z
Format: compress filename(s)
Working Example: compress my.report my.file
This would replace my.report and my.file with my.report.Z and my.file.Z
cp
Copies the contents of one file into another file with a new name or into another directory retaining retaining the existing filename. It also copies the content of one directory into a new directory.
Format: cp filename newfile
Working example: cp my.report my.report.old
cron
This will run scheduled jobs, its similar to the at command, but will run commands at specified intervals instead of just once.
csh
To run the C shell, optionally running a script of stored commands. This is a much older shell than bash, but still quite good and powerful, just without some of the extra goodies bash has.
date
To tell you the current date and time, taking into account your time zone and, if appropriate, daylight savings time.
If you type "date" by itself it will give you the current date and time your computer is using. To set the time on your computer you can type "date -s <newtime>". For example if you wanted to set the time on your computer to 6:00AM you would type "date -s 6:00".
df
To display how much space is free on your disk. This is a simple command that will show you how much space is being used on each partition and how much space is left on each partition as well as show the total size for each partiton.
diff
To compare two files and print the lines in which the files differ. This command only works with text files.
Compares two files and reports the differing lines. The results are clear - The line numbers of the differing lines are noted, while the offending line from file1 is marked with < and the offending line from file2 are marked with > Three hypens < --- > separate the contents of the two files. This command does not process large files very well so use bdiff for large text files instead. bdiff works the same way as diff.
Working example: diff my.report my.file
dpkg
A package management tool used by the Debian Linux distribution.
dselect
A package management tool used by the Debian Linux distribution.
echo
Echoes text or values to standard out.
Working exmaple: echo "Hello World!"
This would echo Hello World! to your screen
ed
To run one of the most basic line-oriented text editors
Type "man ed" to find out more about this command
elm
To read and send e-mail if you have it installed. There are several email programs that you can use besides elm.
emacs
To run a powerful, screen-oriented text editor. There are several man pages and documents explaining how to use this program. There are several text editors besides emacs that are also available, like pico, vi, vim, ed, joe and jed.
exit
To logout. When used in a terminal window, closes the window. If exit doesn't work try typing logout. Pressing Ctrl-D can also log you out.
fg
To continue a job that you have running in the background. A similar command is bg.
file
To tell you whether something is a file, a direcotry, or something else entirely. If the thing is a file, the file command tries to guess what type of information it contains.
Working example: file my.report
This would report output like my.report : English text
find
To find one or more files or directories, assuming that you know their approximate filenames, and optionally do something to them.
Working example: find ./ -name "*.txt"
This will find all the files ending in txt starting at the current directory and searching your entire filesystem.
Working example: find /home/admin -type d -exec chown admin.users {} \;
This will find all the directories (-type d) in the /home/admin directory structure (yes, it will recurse directories) and changes the ownership of those directories to admin, with group users.
ftp
To transfer files from one computer to another over a network. It has been mostly deprecated by the *nix community. Try to use SSH instead.
getty
sets terminal mode, speed, and line discipline
This command is best covered in the manpages do "man getty"
grep
To find patterns in one or more files that contain a particular word or phrase. There are two similar commands, egrep and fgrep, that you can also use.
Working example: grep "position" resume.html
The above command would search the file resume.html and find every instance of "position".
gs
Aladdin Ghostscript interpreter/previewer. To print PostScript files, even if you don't have a PostScript printer. To find out more about this command do "man gs"
gunzip
To unzip gzipped files. Replaces a .gz file with the orginal file.
Working example: gunzip my.report.gz
gzip
To compress a file, replaces the orginal file with a GNU ZIP file with a name ending in .gz
Working example: gzip my.report
This will compress (zip) the file and give it the file extention .gz
head
To display just the first few lines of a file (usually the first ten).
This will display the first 10 lines of a file by default, if you use the -n switch you can specify how many lines to show starting with the first line of the file.
history
A record of all the commands used by each user. Works only with the BASH, Korn and C shells.
id
To tell you your numeric user and group ID, and on BSD, what groups you are in.
ifconfig
By typing ifconfig you will see your lo (local), eth0(ethernet), and ppp0(dialup) ip addresses and configurations. do "man ifconfig" or Man Pages for more information.
inittab
format of the inittab file used by the sysv-com-patible init process
kibitz
A way for two users to share a shell. This is good for teaching purpose's so one user can watch and learn as the other user does things on the system. Both users can send text to the shell screen.
kill
To cancel a job that you don't want to continue
ksh
To run the Korn shell
ln
To create a link to a file so that the file has more than one name or lives in more than one directory. If you use a file all the time and are tired of moving to the directory where it lives, link the file to your home direcotry or to another convenient place. When you use ln, you tell it the current pathname of the file and the new filename you want in the current working directory.
logout
To tell unix you are done using it
lpr
To print a file
lpq
To list the status of al the available printers
ls
To list the files in a directory. If you don't tell it otherwise, the ls command lists all the files in the working directory. You can tell it the name of antoher directory to list, and you can specify the files you want listed by using a filename(which can include wildcards) Go back to Section One for some other good uses for ls.
mail
To read and send e-mail. We suggest using elm or pine instead, if they are available, or any of the GUI e-mail programs found in X.
man
To display reference manual page about Unix/Linux commands
minicom
friendly serial communication program
mkdir
To create a new directory
more
To display information a screen at a time, so you have time to read it. When the screen is full, more pauses. To tell it to show you more, press the spacebar. To make more stop, press q.
mv
To rename a file or move it from one directory to another.
nice
To run a command with lower priority so that it doesn't hog the computer
netconfig
To configure your local network settings
newgrp
To change your current working group
nslookup
query Internet name servers interactively
pack
To shrink a file into one "packed" file so that it takes up less space on you disk. The command is obsolete; compress and gzip shrink alot better
passwd
To change your password
pcat
To display the contents of a packed file. Packes files have names that end in .z (That's a small z)
pico
To run a simple, screen-oriented text editor.
pine
To run a nicely designed e-mail program
pkgtool
To install and uninstall packages in Slackware
pr
To format a text file with page numbers, line numbers, or other options so that it looks nice when you print it.
ps
To display information about your process table (jobs) There are several switches you can use with this command do 'man ps' or Man Pages to see them all.
pwd
To display the name of the current working directory
rcp
To copy files to or from another computer.
rlogin
To log in to another UNIX computer on a network. See also telnet.
rm
To delete (remove) a file permanently. If there are other links to the file, the file continues to exist, just not under the name you removed. The rm command delete just one name (link) to the file. Be very careful with this command as there is no recycle bin in Unix/Linux and you can not easily get the file back.
rmdir
To delete (remove) a directory. Before you delete a directory, delete the files and subdirectories that it contains. The -r option does this for you, but make sure that this is what you really want to do.
RPM
RPM is the RedHat Package Manager. It is used to maintain a database of installed packages and the files beloging to each package to allow easy installation, upgrades and removal of packages. The RPM home is http://www.rpm.org. Many packages are at http://rufus.w3.org/linux/RPM/. To install or upgrade an rpm use rpm -U package.rpm (for upgrade and install) and to remove use rpm -e package (for erase).
rsh
To run a command on another UNIX computer. NOTE: called remsh on some systems.
set
To set a shell variable to the value you specify, or to display the value of the shell variable. In any shell, typing set by itself lists the variables that are defined, and their values.
sh
To run the Bourne shell
shutdown
To stop Unix/Linux and prepare a workstation to be turned off. Do 'man shutdown' or Man Pages for required switches
sleep
To wait a little while.
sort
To sort the lines in a text file.
spell
To look through a text file for words not int he UNIX dictionary
stty
To set the options for your terminal
tail
To display the last few lines of a file
talk
To talk to another computer user by typing messages to each other on- screen
tar
To copy a file to or from an archieve file or backup tape or diskette. This command has several usages do 'man tar' or Man Pages too see all of them. The most common that will get you going are these:
tar -xzvf filename.tgz or tar -xvf filename.tar. These commands will ungzip and untar a file, dumping its contents wherever your current path is (pwd). tar -czvf filename.tgz <target> or tar -cvf filename.tar <target>. These commands will take the target, which can be a directory, a wildcard- noted list of files, or even a single file, and puts them into a new archive called filename.tar or filename.tgz
tee
To copy text from a pipe into a file. tee is most useful for making a log of the output of a slow or long-running program while still seeing its output on-scree. It's also good for debugging scripts so that you can see what's coming out of one program and going into another.
telnet
To log in to a remote computer, even one that doesn't run unix. This command has mostly been deprecated by the *nix community. Use SSH instead where you can.
troff
To format text files for output on a high-quality printer or typsetter unsing a complex formatting language.
updatedb
This command will update the locate database for use with the locate command.
unpack
To restore a packed files to irs orginal size A .z at the end of the filename confirms that this is a packed tile. If a filename ends with .Z (uppercase) instead it is compressed and you must use the uncompress command.
uucp
Unix to Unix Copy Protocol. Used to copy a file to another computer
uudecode
To convert a uuencoded file back into its orginal form
uuencode
To disguise a program as a text file so that you can send it through electronic mail
vi
To run a powerful and tough to learn screen-oriented text editor.
vim
Is vi improved and is a much better and more powerful screen-oriented text editor than vi
wall
To display a message on-screnn to every single user on your entire computer. Use with care.
who
To tell you who else is using this computer.
whoami
Tells you the user you are currently using
write
To display a message on the screen of another user.
zcat
To uncompress a compressed file and send the results to standard output (usually the screen). Compressed files have names ending in .Z (uppercase)

Valid HTML 4.01!

This page last updated on October 23, 2002, 11:34:06 PM
Tutorial Index

Section One
Choosing and
Installing Linux

Section Two
PPP setup and
X Configurations

Section Three
IRC and Bots

Section Four
Sound and
Browsers

Section Five
inetd, ftp,
hosts files

Section Six
tar, .profile,
misc commands

Section Seven
Samba

Section Eight
Kernel Compiles

Section Nine
PHP3 / Postgres
Working Code
with Database

Section Ten
IDE-SCSI
CDR HOWTO

Section Eleven
IP Masquerading
Utilities/
IPChains

Section Twelve
Printing Tutorial

Section Thirteen
Quick overview of
Postgres install

 

ON-LINE Manuals

Apache
Full Apache Manual

PostgreSQL
Full PostgreSQL manual

PHP
Full PHP manual

Samba
Using Samba

 

Extras

Quick Reference
Listing of frequently used commands

Glossary
Glossary of terms

Man Pages
Search and View
the manpages

 
Original copyright © 1998 - 2002 K&R Information Technologies
Original Design & Graphics By: Judy
Original Content and Material By: Kimmie