Electronic Mail
The basic mail commands |
Send a mail message |
mail
mail -s "sub" user@foo.bar.edu < file |
Receive a mail message |
To setup an email client to read engineering
account email look in:
http://tux.cs.unlv.edu/email.html |
File Operations
Display file |
more filename
or
less filename |
Rename a file |
mv oldname newname |
Delete files |
rm filename |
List file attributes
List hidden file attributes
(files beginning with ".") |
ls -l filename
ls -al filename |
Edit files |
emacs filename
or
vi filename |
Learn to use vi
Learn to use emacs
Learn to use man |
vimtutor or man vi
man emacs
man man |
Directory Operations
List contents of current directory |
ls |
List contents of directories |
ls directory_name |
Create directories |
mkdir directory_name |
Rename a directory |
mv oldname newname |
Delete directories |
rmdir directory_name |
Delete a directory tree |
rm -rf directory_name |
(WARNING this will delete ALL
files; that means directories too!) |
Change working directory |
cd directory_name |
Print the name of working directory |
pwd |
Return to your home directory |
cd |
Change to left directory |
cd .. |
I/O Redirection and Pipe
(cmd- command)
Standard output to file |
cmd > filename |
Standard input from file |
cmd < filename |
Standard output to append to file |
cmd >> filename |
Output of cmd_one is input of cmd_two |
cmd_one | cmd_two |
Copyright 1999 Free Software Foundation, Inc.
Refcard format designed by Stephen Gildea.
UNIX recard by Jeff Gilbreth & Jay Nietling, January
1999 v$id$
Modified for Programming Contest by Steve Lumos
Modified for Computer Science Lab Linux Command
Guide by Yazmin Martinez 2002 |
Shell Filename Globbing
Match one character |
? |
Match anything |
* |
Match a character class |
[c..] |
Match a character class |
[c-c] |
My home directory |
~ (tilde) |
Some user's home directory |
~user |
Online Documentation
Search the manuals for a keyword |
man -k keyword |
Display a manual page for a topic |
man topic |
Display a topic's help message |
topic --help |
Display a simple topic description |
whatis topic |
Display the path of a program |
which program |
Search whatis database for topic |
apropos topic |
Printing Files
Print to default printer |
lpr filename |
List the print queue for default printer |
lpq |
Print to another printer |
lpr -Pprinter filename |
List the print queue for another printer |
lpq -Pprinter |
Remove job from the print queue |
lprm job# |
Remove all jobs from print queue |
lprm -a |
Display your print quota |
pquota |
Remote Access
The basic ssh commands |
Connect to a remote machine |
ssh machine.foo.bar.edu |
Connect as a different user |
ssh username@machine.foo.bar.edu |
Compilers
Compile a C program |
gcc program1.c |
Compile a C++ program |
g++ program1.cpp |
Execute your compiled program1 |
./a.out |
Compile a Java program |
javac program1.java |
Execute a Java program |
java program1 |
Shells
Change to BASH shell temporarily |
bash |
Change to CSH shell temporarily |
csh |
Change your PATH in bash |
PATH=/dir-path/:$PATH |
(Put command in .bashrc
file in home directory for permanent changes) |
Change your PATH in csh | setenv PATH "/dir-path/:${PATH}" |
(Put command in .cshrc file in
home directory for permanent changes) |
Make a typescript of a terminal session |
script filename |
WARNING! - Modify your path at own risk in ".bashrc"
or ".cshrc". Modifying your path improperly may cause login
problems. |
Permission is granted to make and distribute copies of
this card provided
the copyright notice and this permission notice are preserved
on all copies. |