Introductie UNIX en VI editor

Vakgroep Theoretische Chemie

Utrecht


C-shell UNIX Commands

man command give a manual of command
pwd print working directory gives full pathname
ls [-al] [path] list directory a : all ; l : long format
cd path change directory cd ../ - move one directory up
cd Dir2/dir1
cat file display a file
more file display file in pages ? : help ; q : quit
mkdir newdir make a new directory
cp [-i] file1 file2 copy -i : warn if the file2 exists
mv [-i] file1 file2 move (rename) file1 to file2
rm [-i] remove a file (delete) -i : ask confirmation
ps [-ef] process status -ef : give all processes
print file print the file on line-printer the laser printer is also available
lpq : lst printer queu lprm : remove printjob
qsub [-tcoax] [file] .. submit a job type qsub for a manual
input_q give the input_q for the batcher
exec_q give the jobs in execution

Usefull programs

scan file scan (list the file) ? : help
vi file use the editor vi see below
plotje file plot the molecule described by gamess-job file

Special characters to the shell (in command mode).

  • backspace
  • erase char before cursor (kill char) also by contr-h
  • contr-S
  • XOFF (stop ouput to terminal)
  • contr-Q
  • XON (resume input to terminal)
  • !!
  • repeat previous command
  • !text
  • repeat previous command starting with text


    VI

    Special Characters

    CURSOR MOVEMENTS

    h left
    j down
    k up
    l right
    ^ to beginning of line
    $ to end of line
    c/r to begin of next line
    ~ to bein of previous line
    H to home position
    M to middle of screen
    L to bottom of screen
    ctrl-F move 1 page ahead
    ctrl-B move 1 page back
    ctrl-D move 0.5 page down
    ctrl-U move o,5 page up
    [#] a number preceding a command will perform the command so many times

    commands

    u undo last command
    U undo all commands on same line
    . repeat last command (also ://)
    x delete characters left of cursor
    X delete characters under cursor
    r replace character
    cw replace word (finish with ESC)
    a append (insert mode after cursor) (finish with ESC)
    A append at end of line (finish with ESC)
    i insert at cursor position (finish with ESC)
    I insert at beginning of line (finish with ESC)
    o insert blank line below current line and go in append mode
    O insert blank line above current line and go in append mode
    D delete till end of line (also d$)
    dw delete word
    ^d delete from beginning of line
    C change till end of line (finish with ESC) (also c$)
    ^c change from beginning of line (finish with ESC)
    [n] dd delete line or delete n lines starting at the current one
    p insert contents of buffer

    The buffer is filled by dw,dd,x etc

    thus xp interchanges characters

    [#]yy copy line(s) to buffer