Exercise for undergraduate students

Similar documents
情報の分析 1. Linux ツールの活用

untitled


tebiki00.dvi

unix.dvi

UNIX

GNU Emacs GNU Emacs

Windows Cygwin Mac *1 Emacs Ruby ( ) 1 Cygwin Bash Cygwin Windows Cygwin Cygwin Mac 1 Mac 1.2 *2 ls *3 *1 OS Linux *2 *3 Enter ( ) 2

X Window System X X &

Microsoft PowerPoint - InfPro_I6.pptx

ファイルシステム

273? C

2 Windows 10 *1 3 Linux 3.1 Windows Bash on Ubuntu on Windows cygwin MacOS Linux OS Ubuntu OS Linux OS 1 GUI Windows Explorer Mac Finder 1 GUI

Unix * 3 PC 2 Linux, Mac *4 Windows Cygwin Cygwin gnuplot Cygwin unix emulator online gnuplot *5 matplotlib *6 SuperMongo *7 gnuplot gnuplot OS *8 Uni

bash on Ubuntu on Windows bash on Ubuntu on Windows bash on Ubuntu on Windows bash on Ubuntu on Windows bash on Ubuntu on Windows ˆ Windows10 64bit Wi

I #2 : ( 8-13), () URL : j inoue/prog2007/prog2007.html

UNIX

A

1) : man [ ] 1: $ man ls ls ( jman) 2: $ man 3 printf C printf 3 man 1: 2: UNIX 3: 4: 5: 6: 7: 8: man man man -k 2) : ls [options] 1: $ ls /etc [ or ]

a0postercls? Gerlinde Kettl, Matthias Weiser T E Xmacro wwwctanorg/tex-archive/macros/latex/contrib/a0poster LAT E X

PowerPoint Presentation

kiso2-01.key

Microsoft Word - Cygwin・ns2インストール.doc

本 日 の 授 業 内 容 最 低 限 覚 えるべきUNIXコマンド pwd, ls, mkdir, cd, cp, rm, mv テキストエディタの 簡 単 な 使 い 方 テキストエディット, Jedit X,Emacs C 言 語 プログラミングの 初 歩 hello, world を 画 面

LAN Copyright c Daikoku Manabu This tutorial is licensed under a Creative Commons Attribution 2.1 Japan License

160420c_unix.pptx

スパコンに通じる並列プログラミングの基礎

スパコンに通じる並列プログラミングの基礎

●70974_100_AC009160_KAPヘ<3099>ーシス自動車約款(11.10).indb

スパコンに通じる並列プログラミングの基礎

2 1. Ubuntu 1.1 OS OS OS ( OS ) OS ( OS ) VMware Player VMware Player jp/download/player/ URL VMware Plaeyr VMware

170420_unix.pptx

CentOSv2_furoku

Microsoft PowerPoint - スハ?コン利用入門_ _UNIX利用の基礎知識.pptx

UNIX version Copyright c Daikoku Manabu 1 UNIX 1.1 UNIX UNIX UNIX OS Windows UNIX UNIX UN

syspro-0405.ppt

kiso2-01.key

Asterisk PBX 不正利用防止

Raspberry Pi ZeroによるIoT入門

TC5.ids

PowerPoint Presentation

情報活用資料

05 I I / 56

図 1: 場所をクリックし ホームフォルダーをクリックすると (上図) ホーム フォルダー下にあるファイルやディレクトリの一覧を見ることができる 下図 2

¥×¥í¥°¥é¥ß¥ó¥°±é½¬I Exercise on Programming I [1zh] ` `%%%`#`&12_`__~~~ alse

-2 gnuplot( ) j ( ) gnuplot /shell/myscript 1

スライド 1

Sophos Anti-Virus UNIX or Linux startup guide

2008 Linux May 12, 2008

OS fvwm fluxbox

<4D F736F F F696E74202D E3F FC96E55F F554E CC8AEE D8EAF2E B8CDD8AB B83685D>

スライド 1

unix15-script2_09.key

2

¥¤¥ó¥¿¡¼¥Í¥Ã¥È·×¬¤È¥Ç¡¼¥¿²òÀÏ Âè11²ó

PowerPoint プレゼンテーション - 物理学情報処理演習

橡Taro9-生徒の活動.PDF

WebOS aplat WebOS WebOS 3 XML Yahoo!Pipes Popfry UNIX grep awk XML GUI WebOS GUI GUI 4 CUI

help gem gem gem my help

note.dvi

(2 Linux Mozilla [ ] [ ] [ ] [ ] URL 2 qkc, nkc ~/.cshrc (emacs 2 set path=($path /usr/meiji/pub/linux/bin tcsh b

Linux XScreenSaver T020074

( ) 1 Windows HTML ( ) ( ) ( ) WWW 10 ( )

I I / 68

VNX for Fileでの監査ツールの構成および使用

第 3 回情報基礎演習 UNIX / Linux: ファイルシステム シェルを理解しよう! 谷口貴志 Panda に login し 情報基礎演習クラスの VDI から Ubuntu に接続し Linux に login した後, 左 上の Activity 端末のアイオン をクリック 端末 を立ち

XEN 仮想マシンの移植 Islandcenter.jp 2009/04/14 既に作成済みの XEN 仮想マシンを移植する方法を説明します 仮想マシンイメージは 通常 /var/lib/xen/image/myvmachine に作成されていますが このファイルを tar 圧縮してリムーバブルメデ

Emacs Hacking CVS Emacs GDB + Elscreen ( ) makoto/e/emacs-gdb.pdf Emacs Hacking p.1/23

_‚Ofl¼

slice00_install.dvi

etrust Access Control etrust Access Control UNIX(Linux, Windows) 2


情報処理概論(第二日目)

linux_apli02.dvi

1 1 CentOS Java JDK(JavaSE Development Kit)......

r3.dvi


Microsoft Word - マニュアル4.1J

これを調べるには pwd というコマンドを使います pwd とは print working directory の頭文 字をとったもので これから意味は明らかですよね 演習 1 (a) pwd を実行した結果を書け なお 立ち上げた直後の作業用ディレクトリのことをホー ムディレクトリ もしくは単に


平成12年度 計算機数学 火・1

untitled

# let st1 = {name = "Taro Yamada"; id = };; val st1 : student = {name="taro Yamada"; id=123456} { 1 = 1 ;...; n = n } # let string_of_student {n

!!!!!

2.2 Sage I 11 factor Sage Sage exit quit 1 sage : exit 2 Exiting Sage ( CPU time 0m0.06s, Wall time 2m8.71 s). 2.2 Sage Python Sage 1. Sage.sage 2. sa

スライド 1

情報処理概論(第二日目)

改訂版 :基本的な文字化の原則(Basic Transcription System for Japanese: BTSJ)

Emacs Ruby..

2 TEX, TEX Donald Knuth 2 3 ( ) TEX ( ) , WWW 4 TEX (.tex,.dvi,.ps,.pdf ) 3 TEX ( ) ( ) 5 (.tex Windows, Mac, Unix, MS-DOS TEX TEX ( ) & METAFON

r3.dvi

PowerPoint プレゼンテーション

(CC Attribution) Lisp 2.1 (Gauche )


シェルプログラミング コマンドをパイプでつなげるだけでは済まないような ある程度まとまった処理を複数のコマンドを制御構文を用いたりしてファイルとしたものを ( シェル ) スクリプトと呼ぶ シェルプログラム バッチなどともいう.bash_profile もシェルスクリプトなので このファイルを解読し

B 20 Web


A : kerl kerl Erlang/OTP Erlang/OTP 2 2 Elixir/Phoenix URL 2 PDF A.2 Bash macos.bash_profile exp

情報処理概論(第二日目)

2.4.7 \ AWK AWK......

Transcription:

UNIX 1.5 wakk@eps.s.u-tokyo.ac.jp W 711 2010/04/14 Unix OS CUI Unix 2008.

1 1 1.1 1 1.2 1-1............. 2 1.3..... 2 1.4 1-2............. 4 2 4 2.1 4 2.2 5 2.3........ 7 3 8 3.1............. 8 3.2 /etc/profile..... 8 3.3 /.bash_profile... 8 3.4 /.bashrc...... 9 3.5 9 3.6............... 12 4 13 4.1.bashrc.............. 13 4.2.aliases.............. 14 4.3.xsession............. 15 4.4.emacs.............. 15 5 16 5.1.bashrc.............. 16 5.2.aliases.............. 16 5.3.xsession............. 17 5.4.emacs.............. 17 6 18 7 19

1, 1.1 Table 1 cd change directory pwd print working directory ls list cp copy mkdir make directory mv move / rm remove rmdir remove directory ls -R man ls ls -la man < > firefox & Google TA TA 89 drwxr-xr-x 12 wakabayashi student 704 2007-08-19 10:44./ drwxr-xr-x 172 root root 4224 2008-03-23 04:44../ -rw-r--r-- 1 wakabayashi ta 5698 2007-04-16 12:53.Xresources -rw-r--r-- 1 wakabayashi ta 607 2007-04-16 12:53.aliases -rw------- 1 wakabayashi ta 1300 2007-08-19 10:48.bash_history -rw-r--r-- 1 wakabayashi ta 310 2007-04-16 12:53.bash_profile -rw-r--r-- 1 wakabayashi ta 3259 2007-04-16 12:53.bashrc -rw-r--r-- 1 wakabayashi ta 4433 2007-04-16 12:53.emacs drwxr-xr-x 2 wakabayashi ta 624 2007-05-09 13:07.fontconfig/ drwx------ 2 wakabayashi ta 80 2007-05-09 13:11.gconfd/ drwx------ 2 wakabayashi ta 80 2007-05-01 10:39.ssh/ -rw-r--r-- 1 wakabayashi ta 14399 2007-04-16 12:53.wl 1

-rwxr-xr-x 1 wakabayashi ta 1744 2007-04-16 12:53.xsession drwxrwxrwx 3 wakabayashi ta 256 2007-04-18 12:41 TA2007/ drwxrwxrwx 3 wakabayashi ta 256 2008-04-10 12:45 TA2008/ ( ) ls -l 1.2 1-1 sl man sl cal -jy du du -sh man du du -sh * /home2/wakabayashi/ta2010/ exercise TA 1.3 UNIX head tail students.txt cd exercise cat -n students.txt 1 s102601 Aoki Hiroka.. less cat -n students.txt less 2

head tail cat head tail Table 2 man Table 2 cat cat <file> head head -n lines <file> tail tail -n lines <file> 10 head -n 10 students.txt 10 tail -n 20 students.txt 20 head -n 10 students.txt 1 s102601 Aoki Hiroka.. 10 s102610 Kaneko Takahumi students.txt 10 tail -n 1 head -n 10 students.txt /exercise$ head -n 10 students.txt tail -n 1 s102610 Kaneko Takahumi /exercise$ cat students.txt head -n 10 tail -n 1 KISS (Keep It Simple and Smart) UNIX cat students.txt cut -f 1,3 -d " " " " cut d f cut 3

1.4 1-2 students.txt 5 10 5 10 15 20 exercise.txt exercise2.txt > >> Emacs 100 1000 Bash ls head tail UNIX 2 2.1 Windows Mac OS X ls UNIX UNIX Fig 1 /bin find /bin -name ls $ find /bin -name ls /bin/ls /bin ls head /bin find /bin -name head whereis head 4

Fig 1 UNIX $ whereis head head: /usr/bin/head head /usr/bin Fig 1 /usr man whereis whereis man 2.2 ls /bin head /usr/bin /bin/ls -l $ /bin/ls -l drwxrwxrwx 3 wakabayashi ta 256 2007-04-18 12:41 TA2010 5

ls Windows Mac OS X /etc/profile lv /etc/profile TA bin lv less / <search term> / bin PATH =... if [ " id -u " -eq 0 ]; then PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" else PATH="/usr/local/bin:/usr/bin:/bin:/usr/games" fi export PATH export bash PATH : /usr/local/bin/ls /bin/ls ls /usr/local/bin/ls PATH CUI ls head PATH PATH /bin /usr/bin ls head ~/exercise line.sh.sh cat < > < > $./exercise/line.sh 10 ~/exercise/students.txt 6

$ line.sh 10 ~/exercise/students.txt $ PATH=$PATH:~/exercise $ line.sh 10 ~/exercise/students.txt ~/exercise ~/exercise line.sh 2.3 env (environment ) MANPATH=/usr/local/intel/idb/man:/usr/local/intel/ifc/man: /usr/local/intel/icc/man:/usr/local/intel/icc/man:/usr/local/man: /usr/local/share/man:/usr/share/man INTEL_LICENSE_FILE=/usr/local/intel/icc/licenses:/opt/intel/licenses: /home1/s102600/intel/licenses:/users/shared/library/application Support/Intel/Licenses: /usr/local/intel/ifc/licenses:/opt/intel/licenses:/home1/s102600/intel/licenses: /Users/Shared/Library/Application Support/Intel/Licenses TERM=xterm-color SHELL=/bin/bash SSH_CLIENT=133.11.229.15 36513 22 SSH_TTY=/dev/pts/0 USER=s102600 LD_LIBRARY_PATH=/usr/local/intel/ifc/lib:/usr/local/intel/icc/lib MAIL=/var/mail/s102600 PATH=/usr/local/intel/idb/bin:/usr/local/intel/ifc/bin:/usr/local/intel/icc/bin: /usr/local/bin:/usr/bin:/bin:/usr/games PWD=/home1/s102600 LANG=ja_JP.EUC-JP SHLVL=1 HOME=/home1/s102600 DYLD_LIBRARY_PATH=/usr/local/intel/ifc/lib:/usr/local/intel/icc/lib LOGNAME=s102600 SSH_CONNECTION=133.11.229.15 36513 192.168.1.120 22 DISPLAY=localhost:10.0 _=/usr/bin/env 7

3 /bin /usr/bin PATH /etc/profile /etc/profile emacs /etc/profile & *1 3.1 210 * UNIX *2 3.2 /etc/profile bash /etc/profile 3.3 /.bash_profile /etc/profile.bash_profile.bash_profile /etc/profile /etc/profile *1 210 *2 ( ) 210 8

3.4 /.bashrc.bashrc.bashrc ( ).bash_profile.bash_profile.bashrc.bash_profile.bashrc PATH.bashrc # PATH etc export PATH=/usr/local/intel/idb/bin:/usr/local/intel/ifc/bin: /usr/local/intel/icc/bin:/usr/local/bin:/usr/bin:/bin:/usr/games /etc/.profile.d ~/.bash_login ~/.bash_logout 3.1 3.4 Fig 2 For All Users, Login Shell /etc/profile For You, Login Shell /.bash profile For You, When Shell Starts /.bashrc Fig 2.bash_history lv.bash_history 3.5 /etc/profile lv /etc/profile 1 # /etc/profile: system-wide.profile file for the Bourne shell (sh(1)) 2 # and Bourne compatible shells (bash(1), ksh(1), ash(1),...). 3 4 if [ " id -u " -eq 0 ]; then 5 PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" 6 else 9

7 PATH="/usr/local/bin:/usr/bin:/bin:/usr/games" 8 fi 9 10 if [ "$PS1" ]; then 11 if [ "$BASH" ]; then 12 PS1= \u@\h:\w\$ 13 else 14 if [ " id -u " -eq 0 ]; then 15 PS1= # 16 else 17 PS1= $ 18 fi 19 fi 20 fi 21 22 export PATH 23 24 umask 022 4 if id man id PATH 24 umask PS1 22 export export export ( /etc/profile ) ( ) ~/.bash_profile 1 # ---- language-env DON T MODIFY THIS LINE! 2 #.bash_profile 3 if [ -f ~/.bashrc ] 4 then 5 #.bash_profile.bashrc 6 # 7 if [ -z "$BASHRC_DONE" ] 8 then 9. ~/.bashrc 10 fi 11 fi 12 # ---- language-env end DON T MODIFY THIS LINE! 10

.bash_profile 3.bashrc (# ) 5 6 7 11.bashrc.bash_profile (.bashrc ).bash_profile source ~/.bashrc.bashrc /etc/profile PATH umask.bash_profile.bashrc Mac.bashrc.bashrc.bashrc cat -n.bashrc lv *3 3 TA BASHRC_DONE.bashrc.bashrc.bash_profile #.bash_profile BASHRC_DONE=1 11 20 PS1 27 aliases 28 if [ -f ~/.aliases ]; then 29. ~/.aliases 30 fi.aliases.aliases *3 11

22 /etc/bash_completion *4 3.6.bashrc 11 PS1 11 # man bash 12 if [ "$TERM" = "dumb" -o "$TERM" = "emacs" ]; then 13 PS1= \w\$ 14 else 15 if [ "$UID" = "0" ]; then 16 PS1= \[\e[41m\]\w\$\[\e[m\] 17 else 18 PS1= \[\e[7m\]\w\$\[\e[m\] 19 fi 20 fi PS1 ( ) = > $ PS1= > PS1.bashrc PS1 TERM env UID id 12 -o or PS1 export env source.bashrc set *4 Tab TA 12

Table 3 $ PS1= \h $ PS1= \h \u \n \d \t $ PS1= :-) $ PS1= ^^; Table 3 PS1 \h \u \d \t (24 ) \T (12 ) \w ( ) \W \n 4 4.1.bashrc 13

4.2.aliases.allias.bashrc lv.aliases alias md= mkdir alias rd= rmdir if [ "$TERM" = "dumb" -o "$TERM" = "emacs" ]; then alias ls= ls -F else alias ls= ls -F --color=auto fi alias lf= ls -F alias la= ls -a alias ll= ls -l alias l.= ls -ld.* alias rm= rm -i alias..= cd.. alias ggre= firefox http://www.google.co.jp alias grep= grep --color alias a2ps= a2psj alias wl= emacs -nw -f wl alias kterm= kterm -bg gray30 -fg white -cr yellow if [ -x /usr/bin/xdvi-ja ]; then alias xdvi= xdvi-ja fi function xtitle() { /bin/echo -e "\033]0;$*\007\c" } la ll mkdir md.. line 14

4.3.xsession Linux CUI Windows Mac OS X UNIX Windows X Window System X ( ) Alt + Control + Fn + 3 X Alt + Control + Fn + 7 startx X X.xsession X Window System X.xsession x X Window System.xsession cat -n.xsession lv 17 application X # Console window Terms and Editors 42 wallpaper 68 Screensaver 79 Window manager X fluxbox Windows Macintosh UI ( ) *5 GUI 210 admin 4.4.emacs Emacs.bashrc.emacs Emacs *5 fluxbox 15

210 23 27 57 X *6 88 120 TEX Fortran.emacs ;.emacs Emacs Lisp Emacs Emacs Lisp Emacs Lisp 5 X Window System.emacs Emacs 5.1.bashrc.bashrc.bashrc source.bashrc 5.2.aliases alias ll= ls -l =.bashrc.allias $ alias ls= ls -R $ alias ls= sl *6 Emacs emacs -nw 16

( ).bashrc alias.bashrc *7 5.3.xsession.xsession X vi X.xsession $ xv -root -quit ~/exercises/images/dance.gif $ xv -root -quit -geometry 1280x1024 ~/exercise/images/nyan_01.jpg.xsession xv UNIX xv & 5.4.emacs Emacs *8 Emacs.emacs ; Emacs (set-foreground-color "white") (set-background-color "dark green") (set-cursor-color "yellow") (set-mouse-color "white") *7 xlock *8 17

TEX ;; (for remark of the other paren) (show-paren-mode t) exercise emacsdownload.emacs ;; (setq load-path (cons "~/exercise/emacsdownload" load-path)) (setq wb-line-number-scroll-bar t) (set-scroll-bar-mode nil) (require wb-line-number) (wb-line-number-toggle) 6 UNIX UNIX UNIX Windows OS UNIX Windows UNIX OS (TA ) 18

7 4 28 ( ) miki ta ls -l *9 exercise catalogue.txt 2007 2009 Mw6.0 100 200 (2 4 ) (9 ) kadai1.txt /home2/wakabayashi/ta2010/s1026??/ (s1026?? ) cut c awk PATH PATH $ whereis touch head: /bin/touch /usr/bin/touch /usr/share/man/man1/touch.1.gz $ which touch /usr/bin/touch which touch /bin /usr/bin ( man ) /usr/bin kadai2.txt /home2/wakabayashi/ta2010/s1026??/ lpr lpr lpr 210 lpr -Pionia ~/exercise/images/nyan_01.jpg admin210 lpr lpr 210 *9... 19

lpr lpr (PATH ) lpr kadai3.txt /home2/wakabayashi/ta2010/s1026??/ kadai4.txt /home2/wakabayashi/ta2010/s1026??/ 20