------------------------- LINUX STRUCTURE------------------------- /sbin/ifconfing -l : show the current IP address /etc/profile : system-wide environment setup ------------------------- COMMANDS ------------------------- ar t libnew.a : list up the content of the library 'libnew.a', ar=archive cd - : return to the previous directory cp ../xxx . : copy with the same file name cp -r A/ ./B : copy directorie Cntl-s : temporary sleeping, Cntl-q * awaike Cntl-r : incremental search > Cntrl_h : delete a character from terminal diff A B : compare A and B and show the difference echo xxx >> file : add xxx to file find . -name \*.html -print : find file name , . is the starting directory FSSTND : Lux Filesystem Standard ftp> promt : to supress the prompt (toggle) grep xxx : pick up lines inclusing xxx kterm & : open the k-term window less : page-by-page printout, ?(back serach), /(forward search) ls /home /usr : for multiple directries ln -s old new : symbolic link (no common i-node), ln old new : hard link (common i-node) lpstat : status of printersls -i : show the i-node numbers man 3 printf : 3 is section number metacharactors : * (incl. none), ???(3 charactors), \ (escape from metach) ps , ps a(all), ps u(process owner) : kill PID rm -i : yes/no message before rm, rm -r : rm even if non-zero directory scp A atlc.cc.kek.jp: : copy A to ./ (should have no login echo) sleep 10 : echo awake sleep 10 second , then type awake > source init : execute init su - : open root(superuser) temporarily TAB : search for rest-charactors (cat oTAB, ecTAB, fTABTAB) tail -f out-400-bg-hpss22.txt@@: tail monitoring (i.ueda, 2002.2.18) traceroute A : to show network root to A machine top : show the CPU status uuper arrow : previous input, xinit : start X-window system xlsfonts : list up all available fonts xlsfonts |grep k14 : pick up only k14.... xsetroot -solid deepskyblue4 : see /usr/X11R6/lib/rgb.txt zless XXX.gz : print gz files Makefile : make [target] , if no target, 1st target be chosen : - (command) continue even after error detected aaa : t.o g77 -o aaa t.o -L/cern/pro/lib -lpacklib t.o: t.f g77 -c t.f > !$ is the last word of the last command (Asai) > J to joint 2 lines in vi > ghostview xxxx.ps : to display print-out pages > nslookup (find IP address of xxxxx machine)ns=name service 94.11.8 > /ansys44a/ansys.e1000 : to start ansys version 4.4 > vi -r oldfile : recover from crash [0] X-terminal -------------------------------------------------------------- > setenv DISPLAY kekcad24:0.0 > xhost bmag1 > CNTL_SHIFT_RESET in kekcad24 to leave X11 mode > x11start > nedit file.name : editor using Xterminal , MAC-like editor (94.11.8) [1] file manipulation ------------------------------------------------------ >ls -F list (directory), -F to show file-type (*=run file,/=directory) >ls -l list all information >ls -a list special file starting . too >pwd show CWD(current working directory) >cd doc move to underlining directory /doc (.=CWD, ..=upper d) >cd back to home directory >cd /data2/kondo/atlas move to other directory >cd .. go to directory one above >mkdir xxxx: creation of new directory, >rm -r xxxx: removal of non-empty dir >cp x.x y.y copy x.x to y.y >rm x.x remove(delete) x.x >mv f1 f2 f3 dir1 move files(f1,f2,f3) into directory 1 >mv f1 .. move f1 to one directory above >chmod u+x file u(owner) g(group) o(other) a(all) +(add)-(take out) =(set) x(execute) r(read) w(wriewrite) -(no previlage) >chmod 744 file set to -rwxr--r-- >cat file.name print on the screen (more for each page) >cat A B > C combine A and B into C >cat a >> b ! apend a into b >history show the previous events >!e or !61 execute the nearest event starting with character "e" (61) >emacs x.x enter into editor emacs (there is other editor called vi) C-x and C-c get out of emacs screen editor C-@ ----- C-W to cut/buff ans C-y to paste C-v (next page) ESCv (previous page) ESC< (head) ESC> (tail) >vi x.x enter into vi editor, out by ZZ, :wq, :q! >find . -name '*.txt' -print find all files and print out >exit or logout logoff the session >jobs list current procedures >kill %2 kill the process [2] >who names using the host >fg 1 restart process [1] /usr/lib: Directory of user library, libc.a is library of C, no need to attach >ar tv libc.a list up functions in libc.a (v for full inf, t for print) >man qsort manual of "qsort", to next, to quit >cc -o test test.c -lm : -lm for mathematical function (liblm.a) >cc -o test test.c -lX11 : for X11 windows (libX11.a) >whatis command: find what the file for is >which command: tell alias or tell in which directory it exists >whereis command: find derectory path name >file xxx: tell the type of file xxx >du: df: disk usage, remaining disk space >diff xxx yyy: print difference of files xxx and yyy >comm xxx yyy: sort lines for xxx-only, yyy-only and common >head/tail (5) print 5 head/tail lines (default is 10) >wc xxx: print line-, word- and charactor-numbers of file xxx >ln a A link a to A with hard link >ln -s old new link "old" to "new" (-s for symbolic link) >alias ls 'ls -F' ls='ls -F',> alias to listup all alias, >unalias xxxx delete alias [2] Print out --------------------------------------------------------------- >lpr -PvenusR225(or -PvenusAmako or -Plw3g225) file.name >lpq queue of print-out >lprm 451 cancel printjob#451 in print queue >more /etc/printcap : to find the assigned printers (lpr file.name if .cshrc contains setenr PRINTER lp0) > rlogin remote login into UNIX > source .cshrc : execute .cshrc [4] C programming >cc -o test test.c compile test.c and make execution program "test" >cc -c main.c compile and make main.o >cc -o test main.o sub.o link main.o and sub.o, then make run file "test" [5] archive------------------------- >tar cvf mytext.tar *.txt : all *.txt file is archived in to mytext.tar >tar tvf /dev/rmt0 listing the contents of the archived tape rmt0 >tar cvf /dev/rmt0 . archive CWD into tape rmt0 >tar xvf /dev/rmt0 remount archived files [6]----- c-shell programing--------- #!/bin/csh -f set th2o=(20.1 20.2 19.8 ) set tenv=(20.9 25.2 30.4 ) set file=(2020 2025 2030 ) set vsi1=(0 0 0 ) set vsi3=(200 200 200 ) foreach i (1 100 50 )2 foreach j (1 2 3) if ($j == 1) then set vsili=$vsi1[$i] else if ($j == 2) then set vsili=$vsi2[$i] else set vsili=$vsi3[$i] endif echo $i $j $tenv[$i] $th2o[$i] $file[$i] $vsili sed s@Ztenv@$tenv[$i]@g t > y1 sed s@Zth2o@$th2o[$i]@g y1 > y2 sed s@Zfile@$file[$i]$vsili@g y2 > y3 sed s@Zvsi@$vsili@g y3 > y4 echo "start $vsili" # ansys.e51 < y4 > /dev/null ansys.e51 < y4 > /dev/null rm y* echo "output z$file[$i]$vsili" end end [7] etc make font large on x-terminal; CNTR^RIGHT