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
Command Action Example
alias Creates a temporary name for a Unix command. alias   name command
  To remove an alias: unalias   name
ansiprint Prints a file to a printer connected to your computer. ansiprint   file
assets Displays your account resources, use, and threshold.      
bg Places a suspended job in the background.      
cat Displays a specified file. cat   file
  cat filename2 >> filename1 Append a second file to the first file   file.Z
chmod Changes permission status for a file or directory. chmod   code file
chmod   code directory
compress Reduces the size of a file and adds .Z to the file's name. compress   file
  To restore a compressed file: uncompress   file.Z
^c Usually kills whatever you are doing  
^d Signals end of file  
^q Restarts suspended display  
^s Suspends the screen displa  
^u Clears the command line  
^z uspends a process or job:
use fg to restart
 
cp Makes a copy of a file. cp   file1 file2
  To copy a file into a different directory:
cp f1 f2 f3 dir
To copy a directory1 into a different directory2:
cp -r directory1 directory2
cp  file directory
cp file1 public/html/file2
  To inquire before overwriting an existing file: cp -i   file1 file2
date      
diff Compares two files and displays the differences.      
du Estimate file space usage under the directory or file
 du -sk *
 du -s [a-m]*
du -h   filename (-h is for human readable size)
  df report filesystem disk space usage
df -h
 
fg Restarts a suspended job in the foreground.      <--> bg
find
find directory -print
find . -type d -print    Display all directories.
find . -type f -print    Display all files.
ex)find ~kim/work/course -type f -name '*.mw' -print
  ssh erdos
find . -name "*.m"
ls -ltR | grep '.m$'
ls -ltR | grep '\.m$'
find . -name "*.m" -exec ls -l {} \;
 find . -name "*.m" -exec ls -l {} \; | grep Sep
   
finger Displays user information at the specified computer. finger   userid@computer


  To change your finger entry information: chfn
ftp Starts the file transfer program with a remote computer. for detail, see below
ftp   address
grep Finds lines in a file matching a character pattern. grep -icvn   pattern file
 
-i     Ignores case
-c     Lists count of lines that contain pattern
-v     Lists all lines except those with pattern
-n     Lists line number for each found pattern
grep -i -n "kim" public/html/index.html
head Displays the first ten lines of a file. head   file
  To display the first n number of lines: head -n   file
help Displays an online help note. help   note
  To display a list of help notes: help -l
history Displays a list of your most recent commands. history
  To repeat the nth command from the list: !   n
  To repeat your most recent command: !!
ispell Checks the spelling in a file. ispell   file
jobs Displays active jobs and their corresponding job numbers. jobs
  To start a job in the background: job   &
  To return a job to the foreground by the job number: fg   %number
  To send a running job to the background: <Control>z bg
kill Terminates a process by its processidentificationnumber. kill   pid
kill %number
  To use the strongest form of the kill command: kill -9 pid
kill -9 -1 (do this in the small computer in 722 v.v.)
locate find the location of mex.h file locate mex.h
less /usr/local/matlab_r14/extern/include/mex.h
logout Ends your computer session.  
lpq spool queue examination program; checks 7th floor printer lpq -P6 (for floor 6)
lpr lpr uses a spooling daemon to print the named files when facilities become available.
lpr -P7s-----to print single.
lpr -P7 kbeef.ps
lprm remove jobs from the line printer spooling queue  
ls Lists the files and subdirectories in your current directory. ls -Fltra
 
ls |more     hold the lists (here | is pipe)
ls -al |more     hold the all lists with long format
ls --help     display this help and exit
ls -l     Lists long format
la -a     Lists all files including dot (.) files
ls -al     Lists all with long format
ls -t     Lists by modification time
ls --color     blue is for directories, green is for executable files.
ls -X     Sorted by file extension.
 
lynx Starts a text-only Web browser session at UW home page. lynx
  Starts a Web browser session at a specific Web address. lynx   url
man Displays Unix Manual entry for a command. man   command
  To search Manual Index for a keyword or topic: man -k   keyword
mesg Displays your talk and write message access status. mesg
  To set your message status to yes or no: mesg y (or n)
mkdir Creates a new directory within your current directory. mkdir   directory
more Displays a file one screen at a time. more   file
  Use <Spacebar> to scroll forward and q to quit.  
mv Moves a file to a different directory. mv   file directory
  Moves a directory to a second directory. mv   directory1 directory2
  To rename file1 as file2: mv   file1 file2
  To rename directory1 as directory2: mv   directory1 directory2
  To inquire before overwriting an existing file: mv -i   file1 file2
pages Check the pages you printed out.  
passwd Starts program to change account password.  
pine Starts the Pine¢ç electronic mail program.  
ps report process status ps -aux |less
pwd Displays absolute pathname of current directory.  
quota Check the disk quotas. quota -v   ( show the amount of the quotas)
     fs lq: in the cs computer
rm Permanently deletes a file. rm   file
'rm' *.ps   delete without asking
  To verify prior to removal: rm -i   file
rmdir Deletes an empty directory. rmdir   directory
  To verify prior to removal: rmdir -i   directory
  Remove nonempty directory. Note: all files in the directory are also removed. rm -r   directory
rm -rf   directory (In cs.
scp secure copy (remote file copy program)
1. geting a file from math
scp kim@erdos.math.wisc.edu:public/html/image/unhae.jpg un.jp
1-1. scp kim@erdos.math.wisc.edu:'work/reading/image/image2/readme work/reading/image/image2/demo1.m' /tmp
  copy readme and demo1.m into tmp directory. If you want to copy them into the directory, use . instead of /tmp
2. geting a directory from math
scp -r kim@erdos.math.wisc.edu:public/html/image image1
3. putting into math
scp -r image kim@erdos.math.wisc.edu:work
scp un1.thml kim@erdos.math.wisc.edu:work
 
ssh Logs you in to another unix computer. for detail, see below
"ssh hostname -l username "
ssh -X kim@bing.math.wisc.edu
ssh bing.math.wsic.edu -l kim 

ssh vv722
staffdir Displays the Online UW Staff Directory. staffdir   "lastname, firstname"
  To display all fields: staffdir -full   "lastname, firstname"
telnet Starts a telnet session with a remote computer. telnet   address
vi Starts the vi text editor with a file. vi   file
w Displays a list of who is on system.  
wc Counts lines, words, and characters in a file. wc   file
zip Compress a file gzip hi.tex => hi.tex.gz
  To unzip a file gunzip hi.tex.gz

ssh & ftp
ssh nova3.cs.wisc.edu -l login(enter)
ftp bing.math.wisc.edu (want to send a file(some.tar) from this cs-xterm to math-xterm)
ftp> dir (for ls)
ftp> cd name (to change the dir)
ftp> put some.tar (some.java : put this file from cs to math) ---get some.tar


tar
To place the files or dir into an archive named some1.tar(some2.tar)
tar -cvf some1.tar Node.java folk.tex Tree.java
tar -cvf some2.tar cs367 (here, file some2.tar has every files and subdir's of dir cs367)

To display this, go to the dir where you want to put those files or dir and do:
tar -xvf some1.tar (or some2.tar)

Compress 'dir1' into the file 'dir1.tar.gz':
tar czvf dir1.tar.gz dir1

Or, the same using bzip2 compression (this is slower, but gives a better compression ratio)
tar cjvf dir1.tar.bz dir1

To extract, use
tar xzvf dir1.tar.gz ( or tar xjvf dir1.tar.bz )


.cshrc.local-----to make your own command, do alias in .cshrc
su 'enter'----> go to root
turnoff <--- /sbin/shutdown -h now
dselect, select
adduser-----in root

last


A Basic UNIX Tutorial
Back to the top.
Back to my homepage