Suche senden
Hochladen
09.using shell
•
Als PPTX, PDF herunterladen
•
0 gefällt mir
•
813 views
Minsuk Lee
Folgen
Melden
Teilen
Melden
Teilen
1 von 18
Jetzt herunterladen
Empfohlen
08.file system
08.file system
Minsuk Lee
Chef
Chef
Will Sterling
2009 cluster user training
2009 cluster user training
Chris Dwan
Asian Spirit 3 Day Dba On Ubl
Asian Spirit 3 Day Dba On Ubl
newrforce
New microsoft power point presentation
New microsoft power point presentation
rajsandhu1989
REDIS intro and how to use redis
REDIS intro and how to use redis
Kris Jeong
Run wordcount job (hadoop)
Run wordcount job (hadoop)
valeri kopaleishvili
Introduction to-linux
Introduction to-linux
rowiebornia
Empfohlen
08.file system
08.file system
Minsuk Lee
Chef
Chef
Will Sterling
2009 cluster user training
2009 cluster user training
Chris Dwan
Asian Spirit 3 Day Dba On Ubl
Asian Spirit 3 Day Dba On Ubl
newrforce
New microsoft power point presentation
New microsoft power point presentation
rajsandhu1989
REDIS intro and how to use redis
REDIS intro and how to use redis
Kris Jeong
Run wordcount job (hadoop)
Run wordcount job (hadoop)
valeri kopaleishvili
Introduction to-linux
Introduction to-linux
rowiebornia
Functional Hostnames and Why they are Bad
Functional Hostnames and Why they are Bad
Puppet
Apache HBase - Lab Assignment
Apache HBase - Lab Assignment
Farzad Nozarian
Linux day 2.ppt
Linux day 2.ppt
Kalkey
07.using vi
07.using vi
Minsuk Lee
Chef or how to make computers do the work for us
Chef or how to make computers do the work for us
sickill
SWORD & ResourceSync - Stuart Lewis
SWORD & ResourceSync - Stuart Lewis
Repository Fringe
Suman bhatt
Suman bhatt
Tapas Bayen
Linux system administration
Linux system administration
orionsconsulting
Advanced CouchDB
Advanced CouchDB
Sander van de Graaf
Dockerの準備
Dockerの準備
koedoyoshida
Bacula Overview
Bacula Overview
sambismo
Introduction to linux
Introduction to linux
Gourav Varma
Implementing Hadoop on a single cluster
Implementing Hadoop on a single cluster
Salil Navgire
20090514 Introducing Puppet To Sasag
20090514 Introducing Puppet To Sasag
garrett honeycutt
2 db2 instance creation
2 db2 instance creation
Ravikumar Nandigam
Operating Systems 1
Operating Systems 1
hutchison
Terminal basic-commands(Unix) -partI
Terminal basic-commands(Unix) -partI
Kedar Bhandari
6. centos networking
6. centos networking
Mohd yasin Karim
Dcp'14 drush
Dcp'14 drush
Piyuesh Kumar
005 skyeye
005 skyeye
Sherif Mousa
The linux command line for total beginners
The linux command line for total beginners
Corrie Watt
Binary search
Binary search
Minsuk Lee
Weitere ähnliche Inhalte
Was ist angesagt?
Functional Hostnames and Why they are Bad
Functional Hostnames and Why they are Bad
Puppet
Apache HBase - Lab Assignment
Apache HBase - Lab Assignment
Farzad Nozarian
Linux day 2.ppt
Linux day 2.ppt
Kalkey
07.using vi
07.using vi
Minsuk Lee
Chef or how to make computers do the work for us
Chef or how to make computers do the work for us
sickill
SWORD & ResourceSync - Stuart Lewis
SWORD & ResourceSync - Stuart Lewis
Repository Fringe
Suman bhatt
Suman bhatt
Tapas Bayen
Linux system administration
Linux system administration
orionsconsulting
Advanced CouchDB
Advanced CouchDB
Sander van de Graaf
Dockerの準備
Dockerの準備
koedoyoshida
Bacula Overview
Bacula Overview
sambismo
Introduction to linux
Introduction to linux
Gourav Varma
Implementing Hadoop on a single cluster
Implementing Hadoop on a single cluster
Salil Navgire
20090514 Introducing Puppet To Sasag
20090514 Introducing Puppet To Sasag
garrett honeycutt
2 db2 instance creation
2 db2 instance creation
Ravikumar Nandigam
Operating Systems 1
Operating Systems 1
hutchison
Terminal basic-commands(Unix) -partI
Terminal basic-commands(Unix) -partI
Kedar Bhandari
6. centos networking
6. centos networking
Mohd yasin Karim
Dcp'14 drush
Dcp'14 drush
Piyuesh Kumar
005 skyeye
005 skyeye
Sherif Mousa
Was ist angesagt?
(20)
Functional Hostnames and Why they are Bad
Functional Hostnames and Why they are Bad
Apache HBase - Lab Assignment
Apache HBase - Lab Assignment
Linux day 2.ppt
Linux day 2.ppt
07.using vi
07.using vi
Chef or how to make computers do the work for us
Chef or how to make computers do the work for us
SWORD & ResourceSync - Stuart Lewis
SWORD & ResourceSync - Stuart Lewis
Suman bhatt
Suman bhatt
Linux system administration
Linux system administration
Advanced CouchDB
Advanced CouchDB
Dockerの準備
Dockerの準備
Bacula Overview
Bacula Overview
Introduction to linux
Introduction to linux
Implementing Hadoop on a single cluster
Implementing Hadoop on a single cluster
20090514 Introducing Puppet To Sasag
20090514 Introducing Puppet To Sasag
2 db2 instance creation
2 db2 instance creation
Operating Systems 1
Operating Systems 1
Terminal basic-commands(Unix) -partI
Terminal basic-commands(Unix) -partI
6. centos networking
6. centos networking
Dcp'14 drush
Dcp'14 drush
005 skyeye
005 skyeye
Andere mochten auch
The linux command line for total beginners
The linux command line for total beginners
Corrie Watt
Binary search
Binary search
Minsuk Lee
The Complete Roadmap Workbook Final Use
The Complete Roadmap Workbook Final Use
paulageorge
Data and Sorting Algoritm
Data and Sorting Algoritm
Minsuk Lee
Small business and enterprenure
Small business and enterprenure
rounaq
Future of sharing beyond
Future of sharing beyond
Nick Rappolt
2011 National Space Symposium
2011 National Space Symposium
SpaceFoundation
Portfolio Presentation 2
Portfolio Presentation 2
rutheast
Aart1400 seminar
Aart1400 seminar
jamesdanspicer
岸角客家文化
岸角客家文化
Minghua Lin
Pp R L S 2011
Pp R L S 2011
Ramo Sakinovic
과학의날-강연-양정중학교
과학의날-강연-양정중학교
Minsuk Lee
왜 소프트웨어를 배워야할까?
왜 소프트웨어를 배워야할까?
Minsuk Lee
983896 634395133169998750
983896 634395133169998750
KIET
Pumping Corn Into Wisconsin: Consideration for Ethanol Legislation
Pumping Corn Into Wisconsin: Consideration for Ethanol Legislation
Justin Dohms
Modelo envejecimiento normal
Modelo envejecimiento normal
Brain Dynamics
pengertian filsafat
pengertian filsafat
Wiwin Wahyuni
これからの司法書士に求められるIT力強化セミナー
これからの司法書士に求められるIT力強化セミナー
Yukidama
綠色奇蹟—溪州馬拉巴栗
綠色奇蹟—溪州馬拉巴栗
Minghua Lin
3phase induction motor
3phase induction motor
Naveen Sihag
Andere mochten auch
(20)
The linux command line for total beginners
The linux command line for total beginners
Binary search
Binary search
The Complete Roadmap Workbook Final Use
The Complete Roadmap Workbook Final Use
Data and Sorting Algoritm
Data and Sorting Algoritm
Small business and enterprenure
Small business and enterprenure
Future of sharing beyond
Future of sharing beyond
2011 National Space Symposium
2011 National Space Symposium
Portfolio Presentation 2
Portfolio Presentation 2
Aart1400 seminar
Aart1400 seminar
岸角客家文化
岸角客家文化
Pp R L S 2011
Pp R L S 2011
과학의날-강연-양정중학교
과학의날-강연-양정중학교
왜 소프트웨어를 배워야할까?
왜 소프트웨어를 배워야할까?
983896 634395133169998750
983896 634395133169998750
Pumping Corn Into Wisconsin: Consideration for Ethanol Legislation
Pumping Corn Into Wisconsin: Consideration for Ethanol Legislation
Modelo envejecimiento normal
Modelo envejecimiento normal
pengertian filsafat
pengertian filsafat
これからの司法書士に求められるIT力強化セミナー
これからの司法書士に求められるIT力強化セミナー
綠色奇蹟—溪州馬拉巴栗
綠色奇蹟—溪州馬拉巴栗
3phase induction motor
3phase induction motor
Ähnlich wie 09.using shell
05.linux basic-operations-1
05.linux basic-operations-1
Minsuk Lee
Course 102: Lecture 10: Learning About the Shell
Course 102: Lecture 10: Learning About the Shell
Ahmed El-Arabawy
Unix Shell Scripting
Unix Shell Scripting
Mustafa Qasim
Unleash your inner console cowboy
Unleash your inner console cowboy
Kenneth Geisshirt
21bUc8YeDzZpE
21bUc8YeDzZpE
aniruddh Tyagi
21bUc8YeDzZpE
21bUc8YeDzZpE
Aniruddh Tyagi
21bUc8YeDzZpE
21bUc8YeDzZpE
aniruddh Tyagi
(Ebook) linux shell scripting tutorial
(Ebook) linux shell scripting tutorial
jayaramprabhu
Shell Scripting crash course.pdf
Shell Scripting crash course.pdf
harikrishnapolaki
04 using and_configuring_bash
04 using and_configuring_bash
Shay Cohen
Redirection of output and input in unix/linux
Redirection of output and input in unix/linux
Panu Ausavasereelert
Unleash your inner console cowboy
Unleash your inner console cowboy
Kenneth Geisshirt
UnixShells.ppt
UnixShells.ppt
EduardoGutierrez111076
Operating system (remuel)
Operating system (remuel)
Remuel Malinao
Bash shell
Bash shell
xylas121
Presentation for RHCE in linux
Presentation for RHCE in linux
Kuldeep Tiwari
Airlover 20030324 1
Airlover 20030324 1
Dr.Ravi
Shell_Scripting.ppt
Shell_Scripting.ppt
KiranMantri
Shell Scripting in Linux
Shell Scripting in Linux
Anu Chaudhry
InSpec Workshop DevSecCon 2017
InSpec Workshop DevSecCon 2017
Mandi Walls
Ähnlich wie 09.using shell
(20)
05.linux basic-operations-1
05.linux basic-operations-1
Course 102: Lecture 10: Learning About the Shell
Course 102: Lecture 10: Learning About the Shell
Unix Shell Scripting
Unix Shell Scripting
Unleash your inner console cowboy
Unleash your inner console cowboy
21bUc8YeDzZpE
21bUc8YeDzZpE
21bUc8YeDzZpE
21bUc8YeDzZpE
21bUc8YeDzZpE
21bUc8YeDzZpE
(Ebook) linux shell scripting tutorial
(Ebook) linux shell scripting tutorial
Shell Scripting crash course.pdf
Shell Scripting crash course.pdf
04 using and_configuring_bash
04 using and_configuring_bash
Redirection of output and input in unix/linux
Redirection of output and input in unix/linux
Unleash your inner console cowboy
Unleash your inner console cowboy
UnixShells.ppt
UnixShells.ppt
Operating system (remuel)
Operating system (remuel)
Bash shell
Bash shell
Presentation for RHCE in linux
Presentation for RHCE in linux
Airlover 20030324 1
Airlover 20030324 1
Shell_Scripting.ppt
Shell_Scripting.ppt
Shell Scripting in Linux
Shell Scripting in Linux
InSpec Workshop DevSecCon 2017
InSpec Workshop DevSecCon 2017
Mehr von Minsuk Lee
CES 처음 가는 분을 위한 가이드
CES 처음 가는 분을 위한 가이드
Minsuk Lee
NIA-PaaS-TA Pub 키노트
NIA-PaaS-TA Pub 키노트
Minsuk Lee
모두콘, 어떻게 배울 것인가 발제.
모두콘, 어떻게 배울 것인가 발제.
Minsuk Lee
GDG-DevFest, 만들면서 자랑하면서 성장하는 개발자
GDG-DevFest, 만들면서 자랑하면서 성장하는 개발자
Minsuk Lee
개발자, 회사.. 왜 오픈소스를 해야할까?
개발자, 회사.. 왜 오픈소스를 해야할까?
Minsuk Lee
진정한 소프트웨어 융합교육에 대하여
진정한 소프트웨어 융합교육에 대하여
Minsuk Lee
FOSS CON Korea 2018
FOSS CON Korea 2018
Minsuk Lee
소프트웨어 공부하는법
소프트웨어 공부하는법
Minsuk Lee
자기소개서, 이력서 쓰는 법
자기소개서, 이력서 쓰는 법
Minsuk Lee
왜 우리는 개발자에 집중하지 않는가?
왜 우리는 개발자에 집중하지 않는가?
Minsuk Lee
Somul 2017-이민석
Somul 2017-이민석
Minsuk Lee
국민대-컴퓨터프로그래밍-2017-1-오프라인강좌
국민대-컴퓨터프로그래밍-2017-1-오프라인강좌
Minsuk Lee
소프트웨어, 정말 되는 건가?
소프트웨어, 정말 되는 건가?
Minsuk Lee
소프트웨어, 소프트웨어 개발자
소프트웨어, 소프트웨어 개발자
Minsuk Lee
프로그램 기초
프로그램 기초
Minsuk Lee
Software Company, Open Soure Software Company
Software Company, Open Soure Software Company
Minsuk Lee
Open Source 그리고 git과 github, code review
Open Source 그리고 git과 github, code review
Minsuk Lee
국민대학교 컴퓨터프로그래밍
국민대학교 컴퓨터프로그래밍
Minsuk Lee
it's software!
it's software!
Minsuk Lee
Deview-2014-자신있는개발자에서 훌륭한개발자로
Deview-2014-자신있는개발자에서 훌륭한개발자로
Minsuk Lee
Mehr von Minsuk Lee
(20)
CES 처음 가는 분을 위한 가이드
CES 처음 가는 분을 위한 가이드
NIA-PaaS-TA Pub 키노트
NIA-PaaS-TA Pub 키노트
모두콘, 어떻게 배울 것인가 발제.
모두콘, 어떻게 배울 것인가 발제.
GDG-DevFest, 만들면서 자랑하면서 성장하는 개발자
GDG-DevFest, 만들면서 자랑하면서 성장하는 개발자
개발자, 회사.. 왜 오픈소스를 해야할까?
개발자, 회사.. 왜 오픈소스를 해야할까?
진정한 소프트웨어 융합교육에 대하여
진정한 소프트웨어 융합교육에 대하여
FOSS CON Korea 2018
FOSS CON Korea 2018
소프트웨어 공부하는법
소프트웨어 공부하는법
자기소개서, 이력서 쓰는 법
자기소개서, 이력서 쓰는 법
왜 우리는 개발자에 집중하지 않는가?
왜 우리는 개발자에 집중하지 않는가?
Somul 2017-이민석
Somul 2017-이민석
국민대-컴퓨터프로그래밍-2017-1-오프라인강좌
국민대-컴퓨터프로그래밍-2017-1-오프라인강좌
소프트웨어, 정말 되는 건가?
소프트웨어, 정말 되는 건가?
소프트웨어, 소프트웨어 개발자
소프트웨어, 소프트웨어 개발자
프로그램 기초
프로그램 기초
Software Company, Open Soure Software Company
Software Company, Open Soure Software Company
Open Source 그리고 git과 github, code review
Open Source 그리고 git과 github, code review
국민대학교 컴퓨터프로그래밍
국민대학교 컴퓨터프로그래밍
it's software!
it's software!
Deview-2014-자신있는개발자에서 훌륭한개발자로
Deview-2014-자신있는개발자에서 훌륭한개발자로
09.using shell
1.
Using Shell
Minsuk Lee Hansung University, Seoul, Korea minsuk@hansung.ac.kr NEAOSS MC2.0 CC-BY 2.0 KR, © Korea OSS Promotion Forum, NIPA
2.
What is Shell
? • As a command Interpreter – Shell interprets user command and executes program • As a programming language – Shell allows user to make script to do series of commands or procedural functions • Shell setups user configurations – Using startup script • Setting PATH, umask, any environment variable NEAOSS MC2.0 CC-BY 2.0 KR, © Korea OSS Promotion Forum, NIPA
3.
Type of shells
• Bourne Shell (sh) – Basic shell for UNIX system, from UNIX-v7 – Stephen Bourne created – Most of the shell is base on this Bourne shell • Korn Shell (ksh) – David Korn (AT&T) created for UNIX SVR4 – Compatible with sh, faster – Support history, alias • C Shell (csh) – Bill Joy (UCB) created for 2BSD – C language style syntax, easy to use • Bourne Again Shell (bash) – Brain Fox created in 1988 based on Bourne shell – Compatible with sh, incorporate functions from csh, ksh – Default shell for Linux • Tcsh, dtksh, zsh, … NEAOSS MC2.0 CC-BY 2.0 KR, © Korea OSS Promotion Forum, NIPA
4.
How shell works
? 1. Display prompt ( $, # ) 2. Read command 3. Lookup the command 4. If it‟s internal command, execute, and goto 1 5. If it‟s external command, Fork a child process, Let it execute the command 6. Wait for child ends 7. Goto 1 NEAOSS MC2.0 CC-BY 2.0 KR, © Korea OSS Promotion Forum, NIPA
5.
My shell ?
• Defined in /etc/passwd – Only super-user can change it • Shell is also a program – You can install ksh, csh, and use it Invoking a Bourne Shell, and exit NEAOSS MC2.0 CC-BY 2.0 KR, © Korea OSS Promotion Forum, NIPA
6.
Environment Variables (1)
• My working environments – Language, colors, configurations – Used by applications – „$ set‟ : current shell‟s env – „$ env‟ : global env • Can be changed – By exporting – e.g., NEAOSS MC2.0 CC-BY 2.0 KR, © Korea OSS Promotion Forum, NIPA
7.
Environment Variables (2)
• Set, unset (environment) variables NEAOSS MC2.0 CC-BY 2.0 KR, © Korea OSS Promotion Forum, NIPA
8.
Using alias
• Rename command Temporal unalias by „‟ NEAOSS MC2.0 CC-BY 2.0 KR, © Korea OSS Promotion Forum, NIPA
9.
functions
• Shell allows functions with arguments – e.g., a function to make a directory and move to there $ mkcd() { mkdir -p $1 && cd $1; } NEAOSS MC2.0 CC-BY 2.0 KR, © Korea OSS Promotion Forum, NIPA
10.
Command history (1)
• Shell saves command history – Up/down arrow key to repeat/edit previous commands • Backs up history in ~/.bash_history file when logout • You can adjust history buffer size „$ set‟ shows all the environment variables NEAOSS MC2.0 CC-BY 2.0 KR, © Korea OSS Promotion Forum, NIPA
11.
Command history (2)
• Repeat specific command (1) ! – See history by $ history or $ history | more – Try $ !<item> NEAOSS MC2.0 CC-BY 2.0 KR, © Korea OSS Promotion Forum, NIPA
12.
Command history (3)
• Repeat specific command (2) ! – See history by $ history or $ history | more – Try $ !<initial letter of previous command> NEAOSS MC2.0 CC-BY 2.0 KR, © Korea OSS Promotion Forum, NIPA
13.
Auto complete
• When type [TAB] in – Shell completes word, and/or shows choices – The word can be the name of commands, files – If you type „$ ls –l my[TAB]‟ • Shell completes „$ ls –l myfile‟, and if you type [TAB] twice, • Shell shows • After type „-‟, shell shows two file stating with “myfile-” • … NEAOSS MC2.0 CC-BY 2.0 KR, © Korea OSS Promotion Forum, NIPA
14.
Bash configuration files
• When login bash reads next script files in order – /etc/profile // global profile – ~/.bash_profile – ~/.bash_login // seldom used – ~/.profile // Only When .bash_profile, .bash_login does not exist – ~/.bashrc // when directed to run in above files • When logout – ~/.bash_logout • OR you can run shell script anytime by – „$ source <shell-script-file>‟ or „$ . <shell-script-file>‟ NEAOSS MC2.0 CC-BY 2.0 KR, © Korea OSS Promotion Forum, NIPA
15.
What you can
do with scripts ? • Changing prompt – variable: PS1 `command` works ! • Changing command path NEAOSS MC2.0 CC-BY 2.0 KR, © Korea OSS Promotion Forum, NIPA
16.
Special Characters for
shell char function example ; Multiple commands $ cd /tmp; ls *, ?, [ ] Wild cards (any string, one, choice) $ ls h?[a-z]* >, >>, < Redirection $ ls > ls.out | Pipe $ ls –l /etc | more ~ Home directory $ cd ~myuser - Previous working directory $ cd - „„ Ignore shell special character $ print „$SHELL‟ ““ Ignore special character except $, `, $ print “$SHELL” `` Run shell command $ print `date` Escape a shell special character $ print “$SHELL” NEAOSS MC2.0 CC-BY 2.0 KR, © Korea OSS Promotion Forum, NIPA
17.
Using special Characters NEAOSS
MC2.0 CC-BY 2.0 KR, © Korea OSS Promotion Forum, NIPA
18.
Let‟s practice
• Repeat the command sequence of the screenshots • Write a shell function tc() – To replace „$ tar cvf file1.tar file1 file2 …‟ into „$ tc file1 file2 …‟ • $1 : first argument • $* : all arguments NEAOSS MC2.0 CC-BY 2.0 KR, © Korea OSS Promotion Forum, NIPA
Jetzt herunterladen