Unix Commands (: commands used in Linux, DOS or VMS)
- logout or exit
- logout from unix host and disconnect
- ls : dir
- list file and directory name
- ls -l ; list in long form, detailed information
- ls -l | more ; list files screen by screen
- man : help
- help for commands ; man command
- passwd
- change password
- pwd
- show present working directory
- mkdir : md
- make subdirectory
- rmdir
- remove directory
- cd
- change directory
- cd . ; present directory,
- cd .. ; one level above,
- cd ~ ; home directory,
- cd / ; root directory
- rm : del
- delete file
- cp : copy
- cp filefrom fileto
- mv : move, rename
- move filefrom fileto
- more file : page
- display contents of file one full window at a time ;
space bar for next screen
- vi : edit
- visual editor, full screen editor
- vi editor commands
- lpr file.name : print
- print a file named file.name ( -Pprintquename )
- lpr -b file.name ; print a binary file named file.name
- lpq or lpstat ; display status of jobs in print que
- mail
- elm
- pine
- telnet host.name
- rlogin, host, ssh, ...
- ftp host.name
- fort77 or f77
- compile and link fortran program
- cc or g77
- compile and link c program
- ps
- process status
- jobs
- display list of processes (jobs)
- kill nn
- kill process number nn
- chmod
- change access mode for owner, group, others (chmod 755 for webpage)
- users
- who
- which
- whatis
- whereis
- sh
- batch
- execute a batch script file
- CNTRL d ; make batch job to a background job
- CNTRL c
- kill current job
- CNTRL z : Do not use this
- Put current processor to background job which remains in the system even after logoff
- If used this by mistake, then use fg to bring it up
- fg
- Bring any job in background back up
- CNTRL s
- stop (freeze) the screen
- CNTRL q
- release screen which stoped by CNTRL s
vi editor commands
- At Full Screen Command Mode
- arrows (or h, j, k, l) ; move the cursor to the direction of arrow
- CNTRL f ; move down one page forward
- CNTRL b ; move up one page backward
- CNTRL g ; give the current position of the cursor (line number and column number)
- nnG ; go to the nn-th line from top
- G ; go to the end of file
- 0 (zero) ; go to the begining of the current line
- $ ; go to the end of the current line
- /word ; search forward for occurence of the word
- ?word ; search backward for occurence of the word
- n ; search next occurence of the previous search word
- N ; search next occurence but in reversed direction
- x ; delete a character at the cursor position
- s ; substitute a character at the cursor position, then go to insert mode
- S ; substitute a line at the cursor position; delete and go to insert mode
- dd ; delete a line at the cursor position
- i ; go to insert mode
- ESC key or CNTRL c ; go back from insert mode to command mode
- : ; go to command line
- At Command Line
- nn ; go to the line numbered nn
- d ; delete the line at the cursor position
- dnn ; delete nn lines from the cursor position
- dw ; delete up to the begining of the next word
- db ; delete up to the previous word
- n1,n2 d ; delete lines from the line number n1 to the line number n2
- J ; join the cursored line with the next line into one line
- n1,n2 m n3 ; move lines n1 through n2 after line n3
- n1,n2 co n3 ; copy lines n1 through n2 after line n3
- n1,n2 s/string1/string2/cg ; substitute string1 by string2 occuring in lines n1 - n2 (every one (g) by confirming (c))
- r file.name ; read in the file named file.name and insert at the cursor position
- w ; save (write) any changes made
- q ; quit the vi editor when there was no change after previous saving
- q! ; quit vi editor neglecting any changes made in the session
- wq ; save any changes made and then quit the vi editor
- help ; help for vi editor commands