2008 Linux (rsf@subaru.naoj.org) (YAGI.Masafumi@nao.ac.jp) May 12, 2008
Contents 1 3 1.1................................................. 3 1.2......................................... 4 1.3............................................... 4 2 5 2.1 man.............................................. 5 2.2 apropos............................................ 5 2.3............................................ 5 3! 6 3.1......................................... 6 3.1.1.................................... 6 3.1.2................................. 6 3.1.3.......... 6 3.2.............................................. 6 3.3............................................. 6 3.4............................... 7 3.5................................................... 7 3.6 (copy)............................................... 7 3.7 mv.................................... 7 3.7.1............................................... 7 3.7.2........................................... 8 3.8 find......................... 8 3.9.......................................... 8 3.9.1...................................... 8 3.9.2......................................... 8 3.10.................................. 8 3.11.................................. 9 3.11.1.......................................... 9 3.11.2.............................................. 9 3.12....................................... 9 4 10 4.1................................... 10 4.2.................................... 10 4.3 (path)........................................... 11 4.4 (= )........................ 11 4.5............................................. 11 4.5.1................................ 11 4.5.2............................... 11 4.5.3........................... 11 4.5.4................................... 12 4.5.5............................................... 12 1
5 13 5.1....................................... 13 5.2............................... 13 5.3........................ 13 6 14 6.1.................... 14 6.2 FITS myfiles.txt................................... 14 6.3.......... 14 6.4 2.................................. 14 6.5...................................... 14 6.6.................... 14 6.7 ( ).......... 15 7 16 7.1 tar sftp............................... 16 7.1.1..................................... 16 7.1.2.......................... 16 7.2 CD DVD.................................. 17 7.3 (e.g., USB HD)................ 17 2
Chapter 1 1.1 subaru (subaru01 subaru12 ) 1. ws ws01 subaru ws subaru12 ws01 2. subaru12 ws01 subaru12 home 3. startx Xwindow ( ) ws01 4. ssh ana03 ana ana03 ( ) ana03 5. ana03 home home ( ) ana03 /wa03a, /wa03b /wa03a subaru12 /wa03a cd /wa03a mkdir subaru12 /wa03a subaru12 6. /wa03a/subaru12 cd /wa03a/subaru12 7. uname pwd /wa03a/subaru12 # 3
1.2 Unix/Linux passwd ws03 modify_userinfo -p 2 1.3 1. ana03 jobs 2. exit 3. ws** jobs ( 4.5.3 ps ) exit 4. System Logout subaru** XWindow 5. exit ws** login: 4
Chapter 2 2.1 man man man man man man man(1) man(1) NAME man - format and display the on-line manual pages SYNOPSIS man [-acdffhkktww] [--path] [-m system] [-p string] [-C config_file] [-M pathlist] [-P pager] [-B browser] [-H htmlpager] [-S section_list] [section] name... DESCRIPTION man formats and displays the on-line manual pages. If you specify section, man only looks in that section of the manual. name is normally the name of the manual page, which is typically the name of a command, function, or file. However, if name contains a slash (/) then man interprets it as a file specification, so that you can do man./foo.5 or even man /cd/foo/bar.1.gz. See below for a description of where man looks for the manual page files. 2.2 apropos apropos apropos pass apropos pass more ( 3.11.2 ) apropos pass grep change 2.3 http://www.adc.nao.ac.jp/j/cc/misc/lm2008/html/ 5
Chapter 3! 3.1 3.1.1 emacs whatidid.txt & copy&paste 3.1.2 script ( whatidid.txt) script whatidid.txt exit whatidid.txt 3.1.3 ksnapshot & ( myscreen.png) xv myscreen.png & 3.2 pwd cd cd.. cd ~/mydata cd /wa03a mkdir 3.3 ls ls /wa03a/rsf/data 6
.( ) ls -a [ ] ls *.FITS ls DATA0?.FITS ls DATA[1-3].FITS [m-n] m n ls DATA[!1-3].FITS m n ls DATA{1,3,4,a,c,e}.FITS {} ls DATA[4-5].{FITS,fits} ls DATA{1,2}[^3].FITS *,?, [ ], { }, ^ [! 3.4 less more 3.5 rm myfile.txt rmdir mydir rm -r mydir 3.6 (copy) A.txt B.txt cp A.txt B.txt cp../a.txt. cp -r hisdir herdir 3.7 mv 3.7.1 DATA1.FITS scr mv DATA1.FITS scr [ ]? mv DATA1.FITS /wa03a/rsf/08a mv DATA1.FITS ~/temp mv DATA1.FITS. 2 ~ home 7
3.7.2 YourDATA.FITS MyDATA.FITS mv YourDATA.FITS MyDATA.FITS 3.8 find.f find. -name *.f 5 find. -mtime 5 3.9 3.9.1 /wa03a/rsf/data/08a ln -s /wa03a/rsf/data/08a./08a ls /wa03a/rsf/data/08a ls 08a 3.9.2 DATA1.FITS /wa03a/rsf/data/08a ln -s /wa03a/rsf/data/08a/data1.fits DATA1.FITS DATA1.FITS /wa03a/rsf/data/08a 3.10 Permission denied (= ) ls -lh a.tar.gz -rwxr-xr-x+ 1 rsf naoj 218K Apr 24 16:07 a.tar.gz - rwx 3 rwx (r) (w) (x) chmod +x hisprogram chmod -x hisprogram chmod -R 700 * -R 700 man chmod 8
3.11 3.11.1 ls MyDATA*.FITS > fitslist.txt filelist.txt (= ) >> ls YourDATA*.FITS >> fitslist 3.11.2 pippo1, pippo2, pippo3,..., and pippo5 5 du -s pippo[1-5] > pippo.list sort -nr pippo.list ( ) du -s pippo[1-5] sort -nr 3.12 pippo[1-5] du -sh pippo[1-5] h (human) du -sh..( ) df -kh 9
Chapter 4 4.1 tab!!!5!( )!ls alias hf= history grep FITS hf FITS.bashrc history 789!789 [ ] history grep mv? 3.11.2 4.2 IRAF(cl) SExtractor which cl /usr/local/bin/cl which sex /usr/local/bin/sex / ( ) / ( ) 10
4.3 (path) PATH PATH echo $PATH path ds9 /home/rsf/opt/ds9/ export PATH=$PATH:/home/rsf/opt/ds9 path /home/rsf/opt/ds9 export PATH=/home/rsf/opt/ds9:$PATH 4.4 (= ) emacs filename.txt & xemacs filename.txt & vi filename.txt 4.5 4.5.1 emacs myfile.text & ( & ) 4.5.2 & Ctrl-z (control z ) ( ) fg( ) bg( ) & & exit 4.5.3 ps -ax grep commandname commandname CPU top jobs + 11
4.5.4 kill jobid jobid kill -KILL jobid -KILL 4.5.5 web http://www.adc.nao.ac.jp/j/cc/misc/lm2008/html/node30.html lp2 clp2-a4 12
Chapter 5 5.1 ssh -X -l rsf pueo pueo rsf logout 5.2 sftp -l rsf machinename cd /wa03a/rsf/data/08a mget DATA*.FITS./ bye pueo DATA FITS (mget) (= ) mput 5.3 scp -r targetdir rsf@pueo:/home/rsf ( targetdir ) (.) scp -r rsf@pueo:/home/rsf/targetdir. 13
Chapter 6 6.1 cd mkdir temp cd temp cp /home/yagims/sample.tar.gz. tar xvzf sample.tar.gz 6.2 FITS myfiles.txt ls *FITS > myfiles.tzt 6.3 paste myfile.txt yourfile.txt > ourfile.txt 6.4 2 diff myfile.txt yourfile.txt 6.5 wc -l filename.txt wc -l line man wc cat -n myfile.txt 6.6 3 awk {print $3} myfile.txt > my3rdparm.txt 3 awk {if(nr==3)print} myfile.txt > my3rdcolumn.txt 14
6.7 ( ) sed -e s/my/your/g myfile.txt > results.txt my your / ( ) (\) sed -e s/\/home\/rsf/\/scr\/jansky/g myfile.txt > results.txt /home/rsf /scr/jansky 15
Chapter 7 7.1 tar sftp 7.1.1 1. tar tar cvzf mydata.tar.gz mydata ( tar ) sftp ($5.2 ) 2. tar cvf mydata.tar mydata tar tar tvf mydata.tar grep FITS FITS happy gzip -v mydata.tar (-v ) ls -lh mydata.tar.gz sftp scp($5.2 ) 7.1.2 tar tar tvzf mydata.tar.gz gunzip -c mydata.tar.gz tar xvf - tar xzvf mydata.tar.gz 16
7.2 CD DVD 1. ( mydata ) ( 3.12 ) 2. mkisofs (make iso file system) ISO 9660 ( mydata.iso) mkisofs -J -r -o mydata.iso -V 2008MAY11 mydata -J Joliet Windows 1 -V ( ) mydata CD 3. CD-R cdrecord -v dev=1,0,0 mydata.iso CD-R CD-R/W cdrecord -v -tao dev=1,0,0 mydata.iso 4. eject CD CD SCSI 1,0,0 cdrecord -scanbus (dev) FAQ http://www.adc.nao.ac.jp/j/cc/misc/lm2008/html/node27.html 7.3 (e.g., USB HD) ls /media ( myhuge-hd) ( 3.6) cd /media/myhuge-hd/ mkdir subaru08 cd subaru08 cp -r /wa03a/subaru12. 1 -J CD Windows 8 3.FITS.FIT 17