Você está na página 1de 2

Unix Refcard- kom.aau.

dk
Basic Unix
If you ever need help in unix type: man topic and you will get a on-line help on the topic If you know the command you can often type: bash help, where bash is the command. cd dir pwd mkdir dir mv oldle newle rm le1 [le2] rmdir dir ls ls -a ls -l du -k dir bc Change directory Print working directory Create directory Rename le or dir Remove le(s) Remove directory List directory Display hidden les Display in long format Disk usage Simple console calc

Screen
screen screen -ls screen -r number Keybindings Ctrl + A & C Ctrl + A & Space Ctrl + A & A Ctrl + A & X Ctrl + A & K Ctrl + A & Z Ctrl + A & Create multiple screens one a physical screen List screens Reattach screen Create new screen Navigate to next screen Jump to last screen Lock Screen Kill Screen Detach screen List active screens

Printing
selectprinter Select a default printer lpr [-Pprintername] lename Print a lename lpq [Pprintername] Query printer queue lprm [-Pprintername] jobnr Remove printing job a2ps -P<printername> -P(printername) (printername) = name of the printer -1 One page on one side -2 Two pages on one side -(N) N pages on one side (1.2.4.9...NxN) sides=2 Duplex printing landscape Print in landscape mode -portrait Print in portrait mode

Advanced Unix
cat lename less lename uname -a last -n 10 type commandname grep tail head tee awk sed perl sort Display content of a le Browse og page through a text le Print system name Print 10 last logins show the location of commandname search for a string in a le display the last few lines of a le display rst few lines of les read fom stdin and write stdout + le pattern scanning and processing language stream editor practical Extraction and Report Language sort, merge, or sequence check text les

File archive and compression

Process managment
w top who ps -Af kill PID pkill processname nice Check who is doing what Process list Who is on-line on this machine Print all processes on this machine Terminate a process Terminate a process name Set priority of process. i.e. nice -n 20 matlab &

Create compressed
tar cvf le.tar le1 [le2 ...] tar jcvf le.tar.bz2 le1 [le2 ...] tar zcvf le.tar.gz le1 [le2 ...] zip le.zip bzip2 le.bz2 le1 [le2 ...] gzip le.gz le 1 [el2 ...] Note: On solaris tar is gtar Wrap les with bzip2 with gzip Create zip le Slow & effective Fast

Bash
.bash_prole Script that execures once at login .bashrc Script that executes by every shell start .bash_history Console history Shortcuts: Ctrl + R Reverse search in history Ctrl + A Jump to start of line Ctrl + E Jump to end of line Crtl + K Cut line Ctrl + Y Paste line Ctrl + L Clear screen

Running programs
To start a program i the current folder type: ./myprogram or sh ./myprogram. To send a running program to the background, press CTRL + Z. The program will stop. If you type bg the program will be sent to background, otherwise type fg to continue. To recall the program type fg.

Extract compressed
tar xvf le.tar tar jxvf le.tar.bz2 tar zxvf le.tar.gz2 unzip le.zip bunzip le.bz2 gunzip le.gz

Text editors
vi pico emacs xemacs Advanced console editor A simple texteditor Extensive interactive text editor Alternative emacs

Internet
mozilla ssh host -l user pine irc lftp gaim lynx rsync Browser, News, Email, IRC, etc. Secure shell Console mail reader Console irc client Console ftp program ICQ, Messenger client Text based WWW browser Syncronise les

Access control rights


r l i d w k a read lookup insert delete write lock admin Access package: write read all none list, read les list les add/copy/move new les and subdirectories remove les and subdirectories modify run programs that require le-locking change the ACL for the dir & les Permisions: rlidwk rl rlidwka none

Ofce
sofce abiword gnumeric MS Ofce clone (Star ofce) MS Word clone MS Excell clone

AFS
klog username tokens fs ls fs sa fs listacl dir fs listacl le fs setacl dir user perms fs setacl dir user:group perm fs help pts help pts membership user:group pts membership user pts creategroup user:newgroup pts adduser username group pts removeuser user group pts delete group Login to AFS Show you afs tokens alias for: fs list acl aliss for: fs setacl Show permisions of dir Show permisions of les Set permisions fs setacl doc pnto03 rlidwk Set permisions user/group fs setacl doc pnto03:04gr450 read Get help to fs Get help to pts List group members List which groups user are memer of Create group e.g. pts creategroup pnto03:friends Add user to a group e.g. pts adduser pnto03 pnto03:friends Remove user from group e.g. pts removeuser pnto03 pnto03:friends Delete group e.g. pts delete pnto03:friends

Project tools
latex xg dia convert in.jpg out.ps make gcc dos2unix le1 le2 unix2dos le1 le2 matlab maple xmaple labview a2ps inle.jpg -o outle.ps Document preparation system Nice tool for illustations Diagram drawing Convert graphics Compiles source code from Makele script GNU C-compiler strips CRs out of dos text les (Linux only) adds CRs to unix text les (Linux only) Matrix laboratory Interactive computer algebra system X11 version of maple Development environment for test, measurement, and control applications Convert any le to postscript

Copyright c 2004 Aalborg University Department of Communication Technology pnto03@kom.auc.dk help@kom.auc.dk http://kom.auc.dk/~pnto03

Você também pode gostar