ºÝºÝߣ

ºÝºÝߣShare a Scribd company logo
Linux tutorial
2013. 09. 05.
?? ?? ???
? putty? ?? windows ???? terminal ??
? Linux terminal ??? ??? ???
? Terminal ???? ??? ????
LinuxTerminal
1
????? ??
? Linux terminal? ????
? ???!
? ?? ???? ???/????? ?? ????
? ?? ? ?? ? ??? ??? ???
? ???? ?? ??(terminal ??)
? ???? ????
? Windows? ??? ??? ?? ??(????, Windows?¡­)
LinuxTerminal
2
iPutty - A SSH Client for Windows
? https://bitbucket.org/daybreaker/iputty/wiki/Home
LinuxTerminal
3
Putty ??
LinuxTerminal
4
?? ?? ??
LinuxTerminal
5
?? ?? ?? ??
? ?? ?? ??
$ wget http://libe.lavida.us/linux.zip
¡­
Saving to: ¡®linux.zip¡¯
100%[=====================================>] 6,156 --.-K/s in 0s
2013-09-05 21:11:10 (81.0 MB/s) - ¡®linux.zip¡¯ saved [6156/6156]
LinuxTerminal
6
?? ?? ????
$ unzip linux.zip
¡­
$ pwd
/home/hhjeong/
$ cd linux_seminar
$ ls ¨Cl
¡­
$ pwd
/home/hhjeong/linux_seminar
LinuxTerminal
7
linux_ ?? tab? ????
txt ??? ??? ???!
$ cat > first_file.txt
??? ?? ?? ?? ?????!
??? ???? ??? ????~
??? ????? ctrl+d ? ?????.
ctrl?? ???? d? ????? ???.
LinuxTerminal
8
?? ?? ??
$ cat first_file.txt
??? ?? ?? ?? ?????!
??? ???? ??? ????~
??? ????? ctrl+d ? ?????.
ctrl?? ???? d? ????? ???.
$ head -2 first_file.txt
??? ?? ?? ?? ?????!
??? ???? ??? ????~
$ tail -1 first_file.txt
ctrl?? ???? d? ????? ???.
LinuxTerminal
9
????
$ cat >> first_file.txt
??? ?????
$ cat first_file.txt
??? ?? ?? ?? ?????!
??? ???? ??? ????~
??? ????? ctrl+d ? ?????.
ctrl?? ???? d? ????? ???.
??? ?????
LinuxTerminal
10
??? ??
Q) ?? ?? ??? ?? ??? ????
A) ????? vi/emacs?? ???? ?????.
?????? vi? ????, vim? ?? ???? ?? ????.
LinuxTerminal
11http://unix.stackexchange.com/
??? ??
Q) Vi? ????? ???. ??? ??? ?????
A) ??? ????? ????.
? http://likelion.net/class01/likelion01_vim_seminar.pdf
? http://choiyongchol.com/vim/go
LinuxTerminal
12
??? ??(??)
? ?? ??? ???? ?? ?? ??
? vim ????
? ??? ??? ??, ?? ?? ??? ?? ??
? i?? ??? VS? ??? ?? ?? ??(?? ??)
? Esc? ??? ?? ?? ?? ??(?? ??)
? :? ??? ??, ?? ?? ???? ??(?? ??)
? :q(??)
? :w(??)
? :e ?? ??(?? ?? ??)
? :e . (?? ???? ??)
? ? ??? ?? ??? ??? ????!
? vim ?? 9? ?? ??? ??? ??? ???.
? ?? ??? ??? ??? ??¡­
LinuxTerminal
13
???? cat? ??? ????
? ??? ??? ????.
? ??? ??? ??? ???? terminal? ??? ????
1. putty ??
2. $ cat > filename
3. ?? ??? ??? ??
4. putty ?? ?? ??? ? ??
5. ctrl+d
? ??, ? ? ???? enter? ? ?? ctrl+d
LinuxTerminal
14
?? ??? ????
$ cd .. ?? $ cd ~
$ pwd
/home/hhjeong/
LinuxTerminal
15
?? ???
$ rm linux.zip
$ rm linux_seminar
rm: `linux_seminar/'? ?? ? ??: ???????
$ rm linux_seminar ¨Crf
LinuxTerminal
16
?? ?? ?!
? ?? ?? ??? ?? ?? ???!
? ??? ??? ?? ?? ???.
? http://likelion.net/class01/likelion01_vim_seminar.pdf
? ??? ????? ?? : /home/username/linux_seminar
? ???? ??? ?? : vim.pdf
? ?? : $ wget --help | more
LinuxTerminal
17
?? ??? ??
$ wget --help
¡­
Download:
-t, --tries=NUMBER set number of retries to NUMBER (0 unlimits).
--retry-connrefused retry even if connection is refused.
-O, --output-document=FILE write documents to FILE.
-nc, --no-clobber skip downloads that would download to
$ wget http://likelion.net/class01/likelion01_vim_seminar.pdf -O vim.pdf
LinuxTerminal
18
Linux? ?? ??
LinuxTerminal
19
http://www.ee.surrey.ac.uk/Teaching/Unix/unixintro.html
/home/its/ug1/ee51vn/report.doc
?? ?? Linux ??
? file/directory ???? ??(case-sensitive)
? ???? ?? ??
? ./path/to/your/excutable/file
? /usr/bin? ?? ?? file? ???
? ?? : python hello.py
? Background ??
? command-line &
? ??? ?? ?? ?? process? ?? ??
LinuxTerminal
20
?? ??(??? ?? ???? ?
?!)
LinuxTerminal
21
?? ?? ??
ls ? ??? file? directory listing
$ ls -a
$ ls -al
$ ls -alh
mkdir directory ??? $ mkdir new_folder
cd directory ?? directory? ??
$ cd other_folder
$ cd /home/hhjeong/Workspace
$ cd ~/Workspace
cd ?? cd ~ change to home-directory
cd .. Parent directory? ??
pwd ? ?? ??
?? ??(??)
LinuxTerminal
22
?? ?? ??
cp src dest ??? ????
cp *.txt /etc/hello/
cp a.txt b.txt
cp * /home/world/ -R
mv src dest ??? ??????, ?? ??
mv hello.txt world.txt
mv * ~/world/
mv * ../dest/ -R
rm file ?? ?? rm a.out
rmdir directory ???? ??(? ????? ??) rmdir /home/username/foo/
wc file ??? ?? ?/?? ?/? ? ??
wc a.txt
wc ¨Cl a.txt
wc ¨Cc a.txt
wc ¨Cw a.txt
?? ??
? ??? ????
? ?? ??
? ???? ???
? ?????
? ?? ????
? ??? ????
? ??? ???? ????
? bash?? for loop
? ?? ??? ???
LinuxTerminal
23
??? ????
? In CentOS
$ yum install ????
? In Debian(or Ubuntu)
$ apt-get install ????
LinuxTerminal
24
??? ??? ?????
? Google it!
? ?? ??? ¡°CentOS ????¡±
? ?? ??? ¡°Ubuntu ????¡°
? ??? ?? ???? ??? ??! ?
? ??? ??!
LinuxTerminal
25
?? ??
? *.tar.gz
$ tar xvzf filename
? *.zip
$ unzip filename
$ unzip filename ¨Cd /some/path/you/want
LinuxTerminal
26
?? ???? ?? ???
$ ps a | grep python
8177 pts/0 T 0:00 python runner.py 10 result_0904_10.txt
10102 pts/0 T 0:00 python runner.py 10 result_0904_10.txt
11182 pts/3 T 0:00 python runner.py 10 result_1445.txt
12560 pts/3 T 0:00 python runner.py 10 result_1445.txt
$ kill -9 8177
$ ps aux | grep python
LinuxTerminal
27
?????(redirection)
$ g++ a_plus_b.cc -O2 -o a_plus_b
$ ./a_plus_b < a_plus_b.in
5
2+3=5
$ ./a_plus_b < a_plus_b.in > a_plus_b.out
2+3=5
$ cat a_plus_b.out
5
$ ./a_plus_b < a_plus_b.in 2> a_plus_b.err
5
LinuxTerminal
28
?? ?? ????
$ find . -name ¡°*.txt¡±
$ find / -name ¡°[cb]ar???_*.avi¡±
LinuxTerminal
29
??
? /usr/bin/ ?? ?? py ?? ???(prefix)? ??? ??
???? ?????
LinuxTerminal
30
?? ??? ??? ??
$ grep word filename
$ grep word *.txt
$ grep word *.txt ¨Cr
$ grep -e ¡°V66 ¡° interaction.txt > V66.txt
? Pattern?? tab ???? ctrl+v ?? tab
LinuxTerminal
31
awk? ??, ?? ? ??
$ awk ¡®{print $1, $2}¡¯ tcga.txt
$ awk ¡®{print $1}¡¯ tcga.txt | head -10
$ awk ¡®{print $1}¡¯ tcga.txt > tcga_id.txt
LinuxTerminal
32
?? ?? ??? ?? ? ??
$ awk '{ if(NF==4) print }' interactions.txt
$ awk '{ if(NF==4) print }' interactions.txt >
interaction2.txt
$ awk '{ if(NF==4) print }' interactions.txt >
interaction2.txt
$ awk '{ if(NF==5) print }' interactions.txt >>
interaction2.txt
LinuxTerminal
33
?? ????
$ sort -r -k 4 interaction2.txt
$ sort -r -k 4 -g interaction2.txt >
sorted_interaction2.txt
LinuxTerminal
34
??
? interaction.txt ? ??
? SNP1, SNP2, ¡­, ?? ?1, ?? ?2
? SNP?? 2? ?? 3? ??
? SNP ?? 2?? ?? int2.txt? ??, SNP ?? 3?? ??
int3.txt? ??
? ?, ?? ? 2? ???? ??
? ? ??? ?? ?? ?? ?? ??
? ? ??? ??? int_all.txt ?? ??
LinuxTerminal
35
for loop ????
$ vim for.sh
#!/bin/bash
for num in 1 2 3 4 5 6 7
do
echo $num
done
LinuxTerminal
36
for loop ????
$ ./for.sh
-bash: ./for.sh: ?? ??
$ bash for.sh
1
2
3
4
5
6
7
LinuxTerminal
37
for loop ????
$ chmod 700 for.sh
$ ./for.sh
1
2
3
4
5
6
7
LinuxTerminal
38
for loop ????
for((i=1;i<=20;++i))
do
./a.out < input.$i > output.$i
cat output.$i
done
LinuxTerminal
39
for loop ????
? ?? filename? ??? for loop
for filename in *.txt
do
rm $filename
done
LinuxTerminal
40
for loop ????
? Command line?? ?? ??
$ for i in 1 2 3 4; do command; done
LinuxTerminal
41
??
? linux_seminar ??? ?? *.txt??
? ? ? ?? ??
? ?? ??? header.txt? ??
LinuxTerminal
42
Linux terminal? ? ? ?? ??
??
? ??? ? ??? ?????!
? ~/.vimrc
? https://github.com/skwp/dotfiles/blob/master/vimrc
? ~/.screenrc
? http://forcecore.tistory.com/604
? ?? ???? ?????!
? http://theyearlyprophet.com/love-your-terminal.html
LinuxTerminal
43
?? ??
? http://www.ee.surrey.ac.uk/Teaching/Unix/
? http://www.cyberciti.biz/faq/bash-loop-over-file/
LinuxTerminal
44
Ad

Recommended

Complement system and periodontitis
Complement system and periodontitis
R Viswa Chandra
?
Types of Composites
Types of Composites
HeatherSeghi
?
Alveolar Bone
Alveolar Bone
sheema tasneem
?
Gruppi di lavoro
Gruppi di lavoro
Antongiulio Bua
?
Amalgam
Amalgam
shabeel pn
?
Dental implants and biomaterials
Dental implants and biomaterials
Felix Obi
?
Bone morphogenetic proteins in periodontal regeneration
Bone morphogenetic proteins in periodontal regeneration
Dr. Shashi Kiran
?
Landing page explosion - Come creare lettere di vendita persuasive e coinvolg...
Landing page explosion - Come creare lettere di vendita persuasive e coinvolg...
SQcuola di Blog
?
Implant components and basic techniques3
Implant components and basic techniques3
www.ffofr.org - Foundation for Oral Facial Rehabilitiation
?
Physical properties of dental materials
Physical properties of dental materials
nidhin r
?
collagen in periodontics
collagen in periodontics
Viola Esther
?
Zinc oxide eugenol
Zinc oxide eugenol
Dr. Roshni Maurya
?
Bone loss and patterns of bone destruction
Bone loss and patterns of bone destruction
anandajey17
?
Periodontal ligament
Periodontal ligament
Abdul Jabir
?
Gic cements
Gic cements
johnsmith284684
?
§ä§Ö§à§â§Ú§ñ §ß§Ñ §Ú§Ô§â§Ú§ä§Ö
§ä§Ö§à§â§Ú§ñ §ß§Ñ §Ú§Ô§â§Ú§ä§Ö
Talia Neophyte
?
Calcium hydroxide cements
Calcium hydroxide cements
Tahir Khan
?
zinc polycarboxylate in dentistry
zinc polycarboxylate in dentistry
gladson selvakumar
?
periodontal ligament
periodontal ligament
shruti lendhey
?
CLASS II CAST METAL RESTORATIONS.powerpoint
CLASS II CAST METAL RESTORATIONS.powerpoint
aishwaryakhare5
?
Things Fall Apart Essay Okonkwo
Things Fall Apart Essay Okonkwo
Custom Paper Writing Services
?
Analisi clima aziendale
Analisi clima aziendale
SdV Marketing
?
amalgam manipulation dental material
amalgam manipulation dental material
Dr-Faisal Al-Qahtani
?
SIGNIFICATO DEI COLORI
SIGNIFICATO DEI COLORI
Chiara Occhiuto
?
Matricing
Matricing
Parth Thakkar
?
Cementum in health and disease
Cementum in health and disease
Dr. Virshali Gupta
?
Casting procedure and casting defects
Casting procedure and casting defects
ChaithraPrabhu3
?
Master corpo e comunicazione
Master corpo e comunicazione
Fabrizio Dell'Orto
?
µÚ£³»ØÆð˜I¡¢¥Õ¥¡¥¤¥Ê¥ó¥¹¤Î¤¿¤á¤ËÆð˜I¼Ò¤¬Öª¤Ã¤Æ¤ª¤¯¤Ù¤­±ØÐÞ·¨Öª×R ¡«¥í¥¸¥Ã¥¯¤ÇÀí½â¤¹¤ë¥Ù¥ó¥Á¥ã©`¥Õ¥¡¥¤¥Ê¥ó¥¹¡«
µÚ£³»ØÆð˜I¡¢¥Õ¥¡¥¤¥Ê¥ó¥¹¤Î¤¿¤á¤ËÆð˜I¼Ò¤¬Öª¤Ã¤Æ¤ª¤¯¤Ù¤­±ØÐÞ·¨Öª×R ¡«¥í¥¸¥Ã¥¯¤ÇÀí½â¤¹¤ë¥Ù¥ó¥Á¥ã©`¥Õ¥¡¥¤¥Ê¥ó¥¹¡«
Samurai Incubate Inc.
?
¡¾ÊÌ¡¿¥¤¥Ù¥ó¥È³É¹¦»áÒé121127
¡¾ÊÌ¡¿¥¤¥Ù¥ó¥È³É¹¦»áÒé121127
Samurai Incubate Inc.
?

More Related Content

What's hot (20)

Implant components and basic techniques3
Implant components and basic techniques3
www.ffofr.org - Foundation for Oral Facial Rehabilitiation
?
Physical properties of dental materials
Physical properties of dental materials
nidhin r
?
collagen in periodontics
collagen in periodontics
Viola Esther
?
Zinc oxide eugenol
Zinc oxide eugenol
Dr. Roshni Maurya
?
Bone loss and patterns of bone destruction
Bone loss and patterns of bone destruction
anandajey17
?
Periodontal ligament
Periodontal ligament
Abdul Jabir
?
Gic cements
Gic cements
johnsmith284684
?
§ä§Ö§à§â§Ú§ñ §ß§Ñ §Ú§Ô§â§Ú§ä§Ö
§ä§Ö§à§â§Ú§ñ §ß§Ñ §Ú§Ô§â§Ú§ä§Ö
Talia Neophyte
?
Calcium hydroxide cements
Calcium hydroxide cements
Tahir Khan
?
zinc polycarboxylate in dentistry
zinc polycarboxylate in dentistry
gladson selvakumar
?
periodontal ligament
periodontal ligament
shruti lendhey
?
CLASS II CAST METAL RESTORATIONS.powerpoint
CLASS II CAST METAL RESTORATIONS.powerpoint
aishwaryakhare5
?
Things Fall Apart Essay Okonkwo
Things Fall Apart Essay Okonkwo
Custom Paper Writing Services
?
Analisi clima aziendale
Analisi clima aziendale
SdV Marketing
?
amalgam manipulation dental material
amalgam manipulation dental material
Dr-Faisal Al-Qahtani
?
SIGNIFICATO DEI COLORI
SIGNIFICATO DEI COLORI
Chiara Occhiuto
?
Matricing
Matricing
Parth Thakkar
?
Cementum in health and disease
Cementum in health and disease
Dr. Virshali Gupta
?
Casting procedure and casting defects
Casting procedure and casting defects
ChaithraPrabhu3
?
Master corpo e comunicazione
Master corpo e comunicazione
Fabrizio Dell'Orto
?
Physical properties of dental materials
Physical properties of dental materials
nidhin r
?
collagen in periodontics
collagen in periodontics
Viola Esther
?
Bone loss and patterns of bone destruction
Bone loss and patterns of bone destruction
anandajey17
?
Periodontal ligament
Periodontal ligament
Abdul Jabir
?
§ä§Ö§à§â§Ú§ñ §ß§Ñ §Ú§Ô§â§Ú§ä§Ö
§ä§Ö§à§â§Ú§ñ §ß§Ñ §Ú§Ô§â§Ú§ä§Ö
Talia Neophyte
?
Calcium hydroxide cements
Calcium hydroxide cements
Tahir Khan
?
zinc polycarboxylate in dentistry
zinc polycarboxylate in dentistry
gladson selvakumar
?
CLASS II CAST METAL RESTORATIONS.powerpoint
CLASS II CAST METAL RESTORATIONS.powerpoint
aishwaryakhare5
?
Analisi clima aziendale
Analisi clima aziendale
SdV Marketing
?
amalgam manipulation dental material
amalgam manipulation dental material
Dr-Faisal Al-Qahtani
?
Casting procedure and casting defects
Casting procedure and casting defects
ChaithraPrabhu3
?

Viewers also liked (20)

µÚ£³»ØÆð˜I¡¢¥Õ¥¡¥¤¥Ê¥ó¥¹¤Î¤¿¤á¤ËÆð˜I¼Ò¤¬Öª¤Ã¤Æ¤ª¤¯¤Ù¤­±ØÐÞ·¨Öª×R ¡«¥í¥¸¥Ã¥¯¤ÇÀí½â¤¹¤ë¥Ù¥ó¥Á¥ã©`¥Õ¥¡¥¤¥Ê¥ó¥¹¡«
µÚ£³»ØÆð˜I¡¢¥Õ¥¡¥¤¥Ê¥ó¥¹¤Î¤¿¤á¤ËÆð˜I¼Ò¤¬Öª¤Ã¤Æ¤ª¤¯¤Ù¤­±ØÐÞ·¨Öª×R ¡«¥í¥¸¥Ã¥¯¤ÇÀí½â¤¹¤ë¥Ù¥ó¥Á¥ã©`¥Õ¥¡¥¤¥Ê¥ó¥¹¡«
Samurai Incubate Inc.
?
¡¾ÊÌ¡¿¥¤¥Ù¥ó¥È³É¹¦»áÒé121127
¡¾ÊÌ¡¿¥¤¥Ù¥ó¥È³É¹¦»áÒé121127
Samurai Incubate Inc.
?
???????£×?§¦?£´?£¹???§³?§°?§®?????????¤á???????¤á???
???????£×?§¦?£´?£¹???§³?§°?§®?????????¤á???????¤á???
itsming
?
Simple ways to deploy VM Images from Self Service UI in IBM Cloud Orchestrato...
Simple ways to deploy VM Images from Self Service UI in IBM Cloud Orchestrato...
Paulraj Pappaiah
?
Bash-as-a-Interpreter
Bash-as-a-Interpreter
Juhwan Yun
?
Introduction to Linux #1
Introduction to Linux #1
UNIST
?
??? ???? - ???
??? ???? - ???
Jong Wook Kim
?
1?? ???? ?? ? ??, ???? ?? ???, ?????
1?? ???? ?? ? ??, ???? ?? ???, ?????
Chulgyu Shin
?
Sha 2 ?? ??? ????? ??
Sha 2 ?? ??? ????? ??
InGuen Hwang
?
Medical Wiki Project
Medical Wiki Project
Kwangmo Yang
?
7? ???? ?? ???? ? ????
7? ???? ?? ???? ? ????
Young-Ho Cha
?
??? ? ???? ????
??? ? ???? ????
licubeclub
?
??? ???? ?? ????? 1? 20130203
??? ???? ?? ????? 1? 20130203
doo rip choi
?
???? ?? - Push Notification Summary
???? ?? - Push Notification Summary
Brave Cheon
?
????? ?????? ???? ????
????? ?????? ???? ????
JavaCommunity.Org
?
Basics of Denial of Service Attacks
Basics of Denial of Service Attacks
Hansa Nidushan
?
Android Push Server & MQTT
Android Push Server & MQTT
?? ?
?
DDoS Attacks
DDoS Attacks
Jignesh Patel
?
Victoria's Secret Angels Campaign
Victoria's Secret Angels Campaign
John White
?
µÚ£³»ØÆð˜I¡¢¥Õ¥¡¥¤¥Ê¥ó¥¹¤Î¤¿¤á¤ËÆð˜I¼Ò¤¬Öª¤Ã¤Æ¤ª¤¯¤Ù¤­±ØÐÞ·¨Öª×R ¡«¥í¥¸¥Ã¥¯¤ÇÀí½â¤¹¤ë¥Ù¥ó¥Á¥ã©`¥Õ¥¡¥¤¥Ê¥ó¥¹¡«
µÚ£³»ØÆð˜I¡¢¥Õ¥¡¥¤¥Ê¥ó¥¹¤Î¤¿¤á¤ËÆð˜I¼Ò¤¬Öª¤Ã¤Æ¤ª¤¯¤Ù¤­±ØÐÞ·¨Öª×R ¡«¥í¥¸¥Ã¥¯¤ÇÀí½â¤¹¤ë¥Ù¥ó¥Á¥ã©`¥Õ¥¡¥¤¥Ê¥ó¥¹¡«
Samurai Incubate Inc.
?
¡¾ÊÌ¡¿¥¤¥Ù¥ó¥È³É¹¦»áÒé121127
¡¾ÊÌ¡¿¥¤¥Ù¥ó¥È³É¹¦»áÒé121127
Samurai Incubate Inc.
?
???????£×?§¦?£´?£¹???§³?§°?§®?????????¤á???????¤á???
???????£×?§¦?£´?£¹???§³?§°?§®?????????¤á???????¤á???
itsming
?
Simple ways to deploy VM Images from Self Service UI in IBM Cloud Orchestrato...
Simple ways to deploy VM Images from Self Service UI in IBM Cloud Orchestrato...
Paulraj Pappaiah
?
Bash-as-a-Interpreter
Bash-as-a-Interpreter
Juhwan Yun
?
Introduction to Linux #1
Introduction to Linux #1
UNIST
?
1?? ???? ?? ? ??, ???? ?? ???, ?????
1?? ???? ?? ? ??, ???? ?? ???, ?????
Chulgyu Shin
?
Sha 2 ?? ??? ????? ??
Sha 2 ?? ??? ????? ??
InGuen Hwang
?
7? ???? ?? ???? ? ????
7? ???? ?? ???? ? ????
Young-Ho Cha
?
??? ???? ?? ????? 1? 20130203
??? ???? ?? ????? 1? 20130203
doo rip choi
?
???? ?? - Push Notification Summary
???? ?? - Push Notification Summary
Brave Cheon
?
Basics of Denial of Service Attacks
Basics of Denial of Service Attacks
Hansa Nidushan
?
Android Push Server & MQTT
Android Push Server & MQTT
?? ?
?
Victoria's Secret Angels Campaign
Victoria's Secret Angels Campaign
John White
?
Ad

Similar to Linux tutorial (20)

??? ????
??? ????
Pete Lee
?
linux1
linux1
sjw1969
?
200725 AWS ???? ????? ??? ????? - ???? ??
200725 AWS ???? ????? ??? ????? - ???? ??
Joohyun Han
?
2??? ????????? ????
2??? ????????? ????
Young Jin Suh
?
[ ??? ??? 2? - 1?? ] ?? ???? ??? ??? ????.
[ ??? ??? 2? - 1?? ] ?? ???? ??? ??? ????.
?? ?
?
[NEXT ?? Week2] UNIX ??? ???? ????
[NEXT ?? Week2] UNIX ??? ???? ????
Young-Ho Cho
?
[??????????? Tech talk] ???????? 80x24 ?????? ??????
[??????????? Tech talk] ???????? 80x24 ?????? ??????
CONNECT FOUNDATION
?
IoT with Raspberry Pi + Node JS - Chapter 1
IoT with Raspberry Pi + Node JS - Chapter 1
Park Jonggun
?
[????? ???????] ???????? ???
[????? ???????] ???????? ???
Lee Sang-Ho
?
[????? ??????] UNIX ??? ??? ??
[????? ??????] UNIX ??? ??? ??
Lee Sang-Ho
?
Network researching
Network researching
hyeok gyu Kwon
?
??? ?? ?? 2?
??? ?? ?? 2?
Junsu Kim
?
Bash on Ubuntu on Windows
Bash on Ubuntu on Windows
?? ?
?
JetsonTX2 Python
JetsonTX2 Python
taeseon ryu
?
[IoT] MAKE with Open H/W + Node.JS - 2nd
[IoT] MAKE with Open H/W + Node.JS - 2nd
Park Jonggun
?
??????????????????Git
??????????????????Git
Mario Cho
?
200725 AWS ???? ????? ??? ????? - ???? ??
200725 AWS ???? ????? ??? ????? - ???? ??
Joohyun Han
?
[ ??? ??? 2? - 1?? ] ?? ???? ??? ??? ????.
[ ??? ??? 2? - 1?? ] ?? ???? ??? ??? ????.
?? ?
?
[NEXT ?? Week2] UNIX ??? ???? ????
[NEXT ?? Week2] UNIX ??? ???? ????
Young-Ho Cho
?
[??????????? Tech talk] ???????? 80x24 ?????? ??????
[??????????? Tech talk] ???????? 80x24 ?????? ??????
CONNECT FOUNDATION
?
IoT with Raspberry Pi + Node JS - Chapter 1
IoT with Raspberry Pi + Node JS - Chapter 1
Park Jonggun
?
[????? ???????] ???????? ???
[????? ???????] ???????? ???
Lee Sang-Ho
?
[????? ??????] UNIX ??? ??? ??
[????? ??????] UNIX ??? ??? ??
Lee Sang-Ho
?
Bash on Ubuntu on Windows
Bash on Ubuntu on Windows
?? ?
?
[IoT] MAKE with Open H/W + Node.JS - 2nd
[IoT] MAKE with Open H/W + Node.JS - 2nd
Park Jonggun
?
??????????????????Git
??????????????????Git
Mario Cho
?
Ad

Linux tutorial

  • 2. ?? ?? ??? ? putty? ?? windows ???? terminal ?? ? Linux terminal ??? ??? ??? ? Terminal ???? ??? ???? LinuxTerminal 1
  • 3. ????? ?? ? Linux terminal? ???? ? ???! ? ?? ???? ???/????? ?? ???? ? ?? ? ?? ? ??? ??? ??? ? ???? ?? ??(terminal ??) ? ???? ???? ? Windows? ??? ??? ?? ??(????, Windows?¡­) LinuxTerminal 2
  • 4. iPutty - A SSH Client for Windows ? https://bitbucket.org/daybreaker/iputty/wiki/Home LinuxTerminal 3
  • 7. ?? ?? ?? ?? ? ?? ?? ?? $ wget http://libe.lavida.us/linux.zip ¡­ Saving to: ¡®linux.zip¡¯ 100%[=====================================>] 6,156 --.-K/s in 0s 2013-09-05 21:11:10 (81.0 MB/s) - ¡®linux.zip¡¯ saved [6156/6156] LinuxTerminal 6
  • 8. ?? ?? ???? $ unzip linux.zip ¡­ $ pwd /home/hhjeong/ $ cd linux_seminar $ ls ¨Cl ¡­ $ pwd /home/hhjeong/linux_seminar LinuxTerminal 7 linux_ ?? tab? ????
  • 9. txt ??? ??? ???! $ cat > first_file.txt ??? ?? ?? ?? ?????! ??? ???? ??? ????~ ??? ????? ctrl+d ? ?????. ctrl?? ???? d? ????? ???. LinuxTerminal 8
  • 10. ?? ?? ?? $ cat first_file.txt ??? ?? ?? ?? ?????! ??? ???? ??? ????~ ??? ????? ctrl+d ? ?????. ctrl?? ???? d? ????? ???. $ head -2 first_file.txt ??? ?? ?? ?? ?????! ??? ???? ??? ????~ $ tail -1 first_file.txt ctrl?? ???? d? ????? ???. LinuxTerminal 9
  • 11. ???? $ cat >> first_file.txt ??? ????? $ cat first_file.txt ??? ?? ?? ?? ?????! ??? ???? ??? ????~ ??? ????? ctrl+d ? ?????. ctrl?? ???? d? ????? ???. ??? ????? LinuxTerminal 10
  • 12. ??? ?? Q) ?? ?? ??? ?? ??? ???? A) ????? vi/emacs?? ???? ?????. ?????? vi? ????, vim? ?? ???? ?? ????. LinuxTerminal 11http://unix.stackexchange.com/
  • 13. ??? ?? Q) Vi? ????? ???. ??? ??? ????? A) ??? ????? ????. ? http://likelion.net/class01/likelion01_vim_seminar.pdf ? http://choiyongchol.com/vim/go LinuxTerminal 12
  • 14. ??? ??(??) ? ?? ??? ???? ?? ?? ?? ? vim ???? ? ??? ??? ??, ?? ?? ??? ?? ?? ? i?? ??? VS? ??? ?? ?? ??(?? ??) ? Esc? ??? ?? ?? ?? ??(?? ??) ? :? ??? ??, ?? ?? ???? ??(?? ??) ? :q(??) ? :w(??) ? :e ?? ??(?? ?? ??) ? :e . (?? ???? ??) ? ? ??? ?? ??? ??? ????! ? vim ?? 9? ?? ??? ??? ??? ???. ? ?? ??? ??? ??? ??¡­ LinuxTerminal 13
  • 15. ???? cat? ??? ???? ? ??? ??? ????. ? ??? ??? ??? ???? terminal? ??? ???? 1. putty ?? 2. $ cat > filename 3. ?? ??? ??? ?? 4. putty ?? ?? ??? ? ?? 5. ctrl+d ? ??, ? ? ???? enter? ? ?? ctrl+d LinuxTerminal 14
  • 16. ?? ??? ???? $ cd .. ?? $ cd ~ $ pwd /home/hhjeong/ LinuxTerminal 15
  • 17. ?? ??? $ rm linux.zip $ rm linux_seminar rm: `linux_seminar/'? ?? ? ??: ??????? $ rm linux_seminar ¨Crf LinuxTerminal 16
  • 18. ?? ?? ?! ? ?? ?? ??? ?? ?? ???! ? ??? ??? ?? ?? ???. ? http://likelion.net/class01/likelion01_vim_seminar.pdf ? ??? ????? ?? : /home/username/linux_seminar ? ???? ??? ?? : vim.pdf ? ?? : $ wget --help | more LinuxTerminal 17
  • 19. ?? ??? ?? $ wget --help ¡­ Download: -t, --tries=NUMBER set number of retries to NUMBER (0 unlimits). --retry-connrefused retry even if connection is refused. -O, --output-document=FILE write documents to FILE. -nc, --no-clobber skip downloads that would download to $ wget http://likelion.net/class01/likelion01_vim_seminar.pdf -O vim.pdf LinuxTerminal 18
  • 21. ?? ?? Linux ?? ? file/directory ???? ??(case-sensitive) ? ???? ?? ?? ? ./path/to/your/excutable/file ? /usr/bin? ?? ?? file? ??? ? ?? : python hello.py ? Background ?? ? command-line & ? ??? ?? ?? ?? process? ?? ?? LinuxTerminal 20
  • 22. ?? ??(??? ?? ???? ? ?!) LinuxTerminal 21 ?? ?? ?? ls ? ??? file? directory listing $ ls -a $ ls -al $ ls -alh mkdir directory ??? $ mkdir new_folder cd directory ?? directory? ?? $ cd other_folder $ cd /home/hhjeong/Workspace $ cd ~/Workspace cd ?? cd ~ change to home-directory cd .. Parent directory? ?? pwd ? ?? ??
  • 23. ?? ??(??) LinuxTerminal 22 ?? ?? ?? cp src dest ??? ???? cp *.txt /etc/hello/ cp a.txt b.txt cp * /home/world/ -R mv src dest ??? ??????, ?? ?? mv hello.txt world.txt mv * ~/world/ mv * ../dest/ -R rm file ?? ?? rm a.out rmdir directory ???? ??(? ????? ??) rmdir /home/username/foo/ wc file ??? ?? ?/?? ?/? ? ?? wc a.txt wc ¨Cl a.txt wc ¨Cc a.txt wc ¨Cw a.txt
  • 24. ?? ?? ? ??? ???? ? ?? ?? ? ???? ??? ? ????? ? ?? ???? ? ??? ???? ? ??? ???? ???? ? bash?? for loop ? ?? ??? ??? LinuxTerminal 23
  • 25. ??? ???? ? In CentOS $ yum install ???? ? In Debian(or Ubuntu) $ apt-get install ???? LinuxTerminal 24
  • 26. ??? ??? ????? ? Google it! ? ?? ??? ¡°CentOS ????¡± ? ?? ??? ¡°Ubuntu ????¡° ? ??? ?? ???? ??? ??! ? ? ??? ??! LinuxTerminal 25
  • 27. ?? ?? ? *.tar.gz $ tar xvzf filename ? *.zip $ unzip filename $ unzip filename ¨Cd /some/path/you/want LinuxTerminal 26
  • 28. ?? ???? ?? ??? $ ps a | grep python 8177 pts/0 T 0:00 python runner.py 10 result_0904_10.txt 10102 pts/0 T 0:00 python runner.py 10 result_0904_10.txt 11182 pts/3 T 0:00 python runner.py 10 result_1445.txt 12560 pts/3 T 0:00 python runner.py 10 result_1445.txt $ kill -9 8177 $ ps aux | grep python LinuxTerminal 27
  • 29. ?????(redirection) $ g++ a_plus_b.cc -O2 -o a_plus_b $ ./a_plus_b < a_plus_b.in 5 2+3=5 $ ./a_plus_b < a_plus_b.in > a_plus_b.out 2+3=5 $ cat a_plus_b.out 5 $ ./a_plus_b < a_plus_b.in 2> a_plus_b.err 5 LinuxTerminal 28
  • 30. ?? ?? ???? $ find . -name ¡°*.txt¡± $ find / -name ¡°[cb]ar???_*.avi¡± LinuxTerminal 29
  • 31. ?? ? /usr/bin/ ?? ?? py ?? ???(prefix)? ??? ?? ???? ????? LinuxTerminal 30
  • 32. ?? ??? ??? ?? $ grep word filename $ grep word *.txt $ grep word *.txt ¨Cr $ grep -e ¡°V66 ¡° interaction.txt > V66.txt ? Pattern?? tab ???? ctrl+v ?? tab LinuxTerminal 31
  • 33. awk? ??, ?? ? ?? $ awk ¡®{print $1, $2}¡¯ tcga.txt $ awk ¡®{print $1}¡¯ tcga.txt | head -10 $ awk ¡®{print $1}¡¯ tcga.txt > tcga_id.txt LinuxTerminal 32
  • 34. ?? ?? ??? ?? ? ?? $ awk '{ if(NF==4) print }' interactions.txt $ awk '{ if(NF==4) print }' interactions.txt > interaction2.txt $ awk '{ if(NF==4) print }' interactions.txt > interaction2.txt $ awk '{ if(NF==5) print }' interactions.txt >> interaction2.txt LinuxTerminal 33
  • 35. ?? ???? $ sort -r -k 4 interaction2.txt $ sort -r -k 4 -g interaction2.txt > sorted_interaction2.txt LinuxTerminal 34
  • 36. ?? ? interaction.txt ? ?? ? SNP1, SNP2, ¡­, ?? ?1, ?? ?2 ? SNP?? 2? ?? 3? ?? ? SNP ?? 2?? ?? int2.txt? ??, SNP ?? 3?? ?? int3.txt? ?? ? ?, ?? ? 2? ???? ?? ? ? ??? ?? ?? ?? ?? ?? ? ? ??? ??? int_all.txt ?? ?? LinuxTerminal 35
  • 37. for loop ???? $ vim for.sh #!/bin/bash for num in 1 2 3 4 5 6 7 do echo $num done LinuxTerminal 36
  • 38. for loop ???? $ ./for.sh -bash: ./for.sh: ?? ?? $ bash for.sh 1 2 3 4 5 6 7 LinuxTerminal 37
  • 39. for loop ???? $ chmod 700 for.sh $ ./for.sh 1 2 3 4 5 6 7 LinuxTerminal 38
  • 40. for loop ???? for((i=1;i<=20;++i)) do ./a.out < input.$i > output.$i cat output.$i done LinuxTerminal 39
  • 41. for loop ???? ? ?? filename? ??? for loop for filename in *.txt do rm $filename done LinuxTerminal 40
  • 42. for loop ???? ? Command line?? ?? ?? $ for i in 1 2 3 4; do command; done LinuxTerminal 41
  • 43. ?? ? linux_seminar ??? ?? *.txt?? ? ? ? ?? ?? ? ?? ??? header.txt? ?? LinuxTerminal 42
  • 44. Linux terminal? ? ? ?? ?? ?? ? ??? ? ??? ?????! ? ~/.vimrc ? https://github.com/skwp/dotfiles/blob/master/vimrc ? ~/.screenrc ? http://forcecore.tistory.com/604 ? ?? ???? ?????! ? http://theyearlyprophet.com/love-your-terminal.html LinuxTerminal 43
  • 45. ?? ?? ? http://www.ee.surrey.ac.uk/Teaching/Unix/ ? http://www.cyberciti.biz/faq/bash-loop-over-file/ LinuxTerminal 44