SlideShare a Scribd company logo
Daniel Carneiro Shell Script Parte VI
Exemplos simples ,[object Object],ls  |  wc  -l find  |  wc  -l find  -type f |  wc  -l ,[object Object],fortune  |  tee   temp  ;  wc  temp;  rm  -f temp temp =$( fortune ); echo  $temp ; echo  $temp  |  wc ,[object Object],PS1 ="[ @: ( git   branch  2> /dev/null |  grep -e  ' ' |  sed  's/^...*/{}/') ]  "
Para remover muitos arquivos (500000+): rm   f* bash: /bin/rm: Lista de argumentos muito longa for   i   in   f*;   do   rm   $i; done find   -name  'f*'  -exec   rm  {}  for  i  in  $( find -name  'f*');  do rm  $i;  done
Buscar um aplicativo e matá-lo ps aux  (listar processos) USER  PID %CPU %MEM  VSZ  RSS TTY  STAT START  TIME COMMAND root  1  0.0  0.0  2792  1648 ?  Ss  19:27  0:00 /sbin/init root  2  0.0  0.0  0  0 ?  S  19:27  0:00 [kthreadd] root  3  0.0  0.0  0  0 ?  S  19:27  0:01 [migration/0] root  4  0.0  0.0  0  0 ?  S  19:27  0:00 [ksoftirqd/0] root  5  0.0  0.0  0  0 ?  S  19:27  0:00 [watchdog/0] root  6  0.0  0.0  0  0 ?  S  19:27  0:01 [migration/1] root  7  0.0  0.0  0  0 ?  S  19:27  0:00 [ksoftirqd/1] root  8  0.0  0.0  0  0 ?  S  19:27  0:00 [watchdog/1] root  9  0.0  0.0  0  0 ?  S  19:27  0:00 [events/0] root  10  0.0  0.0  0  0 ?  S  19:27  0:00 [events/1] . . . daniel  2762 35.4  2.4  73372 70772 pts/0  Ss  22:12  22:09 bash daniel  12969  0.0  0.0  2716  1040 pts/1  R+  23:14  0:00 ps aux
Buscar um aplicativo e matá-lo pids= $(  ps  aux|  grep  pts/1|  grep   -v  grep|  tr   -s  " "|  cut   -d  " "  -f  2 ) for  i  in  $pids;  do  kill $i;  done
Install Script #!/bin/bash SID= ${1:-$ORACLE_SID} echo Creating instance  $SID read  -r -p   "Are you sure? [y/N] "  response response= ${response,,}   # tolower if  [[  $response  =~ ^(yes|y)$ ]];  then echo creating... $SID else exit fi
Install Script mkdir  $SID cp  pass.sql  $SID cat  init.ora| sed -e   "s/ORACLE_SID/ $SID /g"  >  $SID /init.ora cat  CreateDB.sql| sed -e   "s/ORACLE_SID/ $SID /g"  >  $SID /CreateDB.sql cat  CreateDBFiles.sql| sed -e   "s/ORACLE_SID/ $SID /g"  >  $SID /CreateDBFiles.sql cat  CreateDBCatalog.sql| sed -e   "s/ORACLE_SID/ $SID /g"  >  $SID /CreateDBCatalog.sql cat  postDBCreation.sql| sed -e   "s/ORACLE_SID/ $SID /g"  >  $SID /postDBCreation.sql
Start/Stop Script
Start/Stop Script
Start/Stop Script
Obrigado

More Related Content

What's hot

Git Sensitive Data
Git Sensitive DataGit Sensitive Data
TDDBC お題
TDDBC お題TDDBC お題
TDDBC お題
Takuto Wada
 
ZeroMQ Is The Answer: DPC 11 Version
ZeroMQ Is The Answer: DPC 11 VersionZeroMQ Is The Answer: DPC 11 Version
ZeroMQ Is The Answer: DPC 11 Version
Ian Barber
 
How to stand on the shoulders of giants
How to stand on the shoulders of giantsHow to stand on the shoulders of giants
How to stand on the shoulders of giants
Ian Barber
 
All I know about rsc.io/c2go
All I know about rsc.io/c2goAll I know about rsc.io/c2go
All I know about rsc.io/c2go
Moriyoshi Koizumi
 
Windows shutdown virus source code c++
Windows shutdown virus source code c++Windows shutdown virus source code c++
Windows shutdown virus source code c++
Andi Master Hiyperterminal
 
Tgh.pl
Tgh.plTgh.pl
Tgh.pl
iskabom
 
Combine vs RxSwift
Combine vs RxSwiftCombine vs RxSwift
Combine vs RxSwift
shark-sea
 
Linux Command Line
Linux Command LineLinux Command Line
Linux Command Line
Prima Yogi Loviniltra
 
PHPerのためのPerl入門@ Kansai.pm#12
PHPerのためのPerl入門@ Kansai.pm#12PHPerのためのPerl入門@ Kansai.pm#12
PHPerのためのPerl入門@ Kansai.pm#12
Kazuki KOMORI
 
NUMOSS 4th Week - Commandline Tutorial
NUMOSS 4th Week - Commandline TutorialNUMOSS 4th Week - Commandline Tutorial
NUMOSS 4th Week - Commandline Tutorial
Gagah Arifianto
 
ZeroMQ Is The Answer
ZeroMQ Is The AnswerZeroMQ Is The Answer
ZeroMQ Is The Answer
Ian Barber
 
Hashing endereçamento aberto - main
Hashing endereçamento aberto - mainHashing endereçamento aberto - main
Hashing endereçamento aberto - main
Elaine Cecília Gatto
 
ZeroMQ: Messaging Made Simple
ZeroMQ: Messaging Made SimpleZeroMQ: Messaging Made Simple
ZeroMQ: Messaging Made Simple
Ian Barber
 
Hands on Hadoop
Hands on HadoopHands on Hadoop
Hands on Hadoop
Paul Tarjan
 
01 คำสั่งแสดงผล ในภาษาซี
01 คำสั่งแสดงผล ในภาษาซี01 คำสั่งแสดงผล ในภาษาซี
01 คำสั่งแสดงผล ในภาษาซี
Panatchakorn Chaiyanon
 
Crack.ba
Crack.baCrack.ba
Crack.ba
Yance Iyai
 
Doubly Linked List
Doubly Linked ListDoubly Linked List
Doubly Linked List
Er. Ganesh Ram Suwal
 
Linear queue
Linear queueLinear queue
Linear queue
Er. Ganesh Ram Suwal
 
What is suid, sgid and sticky bit
What is suid, sgid and sticky bit  What is suid, sgid and sticky bit
What is suid, sgid and sticky bit
Meenu Chopra
 

What's hot (20)

Git Sensitive Data
Git Sensitive DataGit Sensitive Data
Git Sensitive Data
 
TDDBC お題
TDDBC お題TDDBC お題
TDDBC お題
 
ZeroMQ Is The Answer: DPC 11 Version
ZeroMQ Is The Answer: DPC 11 VersionZeroMQ Is The Answer: DPC 11 Version
ZeroMQ Is The Answer: DPC 11 Version
 
How to stand on the shoulders of giants
How to stand on the shoulders of giantsHow to stand on the shoulders of giants
How to stand on the shoulders of giants
 
All I know about rsc.io/c2go
All I know about rsc.io/c2goAll I know about rsc.io/c2go
All I know about rsc.io/c2go
 
Windows shutdown virus source code c++
Windows shutdown virus source code c++Windows shutdown virus source code c++
Windows shutdown virus source code c++
 
Tgh.pl
Tgh.plTgh.pl
Tgh.pl
 
Combine vs RxSwift
Combine vs RxSwiftCombine vs RxSwift
Combine vs RxSwift
 
Linux Command Line
Linux Command LineLinux Command Line
Linux Command Line
 
PHPerのためのPerl入門@ Kansai.pm#12
PHPerのためのPerl入門@ Kansai.pm#12PHPerのためのPerl入門@ Kansai.pm#12
PHPerのためのPerl入門@ Kansai.pm#12
 
NUMOSS 4th Week - Commandline Tutorial
NUMOSS 4th Week - Commandline TutorialNUMOSS 4th Week - Commandline Tutorial
NUMOSS 4th Week - Commandline Tutorial
 
ZeroMQ Is The Answer
ZeroMQ Is The AnswerZeroMQ Is The Answer
ZeroMQ Is The Answer
 
Hashing endereçamento aberto - main
Hashing endereçamento aberto - mainHashing endereçamento aberto - main
Hashing endereçamento aberto - main
 
ZeroMQ: Messaging Made Simple
ZeroMQ: Messaging Made SimpleZeroMQ: Messaging Made Simple
ZeroMQ: Messaging Made Simple
 
Hands on Hadoop
Hands on HadoopHands on Hadoop
Hands on Hadoop
 
01 คำสั่งแสดงผล ในภาษาซี
01 คำสั่งแสดงผล ในภาษาซี01 คำสั่งแสดงผล ในภาษาซี
01 คำสั่งแสดงผล ในภาษาซี
 
Crack.ba
Crack.baCrack.ba
Crack.ba
 
Doubly Linked List
Doubly Linked ListDoubly Linked List
Doubly Linked List
 
Linear queue
Linear queueLinear queue
Linear queue
 
What is suid, sgid and sticky bit
What is suid, sgid and sticky bit  What is suid, sgid and sticky bit
What is suid, sgid and sticky bit
 

Similar to Shell Scripting

Unix 5 en
Unix 5 enUnix 5 en
Unix 5 en
Simonas Kareiva
 
A CTF Hackers Toolbox
A CTF Hackers ToolboxA CTF Hackers Toolbox
A CTF Hackers Toolbox
Stefan
 
Naughty And Nice Bash Features
Naughty And Nice Bash FeaturesNaughty And Nice Bash Features
Naughty And Nice Bash Features
Nati Cohen
 
Linux 系統管理與安全:基本 Linux 系統知識
Linux 系統管理與安全:基本 Linux 系統知識Linux 系統管理與安全:基本 Linux 系統知識
Linux 系統管理與安全:基本 Linux 系統知識
維泰 蔡
 
Os Fetterupdated
Os FetterupdatedOs Fetterupdated
Os Fetterupdated
oscon2007
 
Marko Gargenta_Remixing android
Marko Gargenta_Remixing androidMarko Gargenta_Remixing android
Marko Gargenta_Remixing android
Droidcon Berlin
 
Introduction to Assembly Language
Introduction to Assembly LanguageIntroduction to Assembly Language
Introduction to Assembly Language
Motaz Saad
 
Keynote 1 - Engineering Software Analytics Studies
Keynote 1 - Engineering Software Analytics StudiesKeynote 1 - Engineering Software Analytics Studies
Keynote 1 - Engineering Software Analytics Studies
ESEM 2014
 
Cleanliness is Next to Domain-Specificity
Cleanliness is Next to Domain-SpecificityCleanliness is Next to Domain-Specificity
Cleanliness is Next to Domain-Specificity
Ben Scofield
 
Cleanliness is Next to Domain-Specificity
Cleanliness is Next to Domain-SpecificityCleanliness is Next to Domain-Specificity
Cleanliness is Next to Domain-Specificity
Viget Labs
 
Noah Zoschke at Waza 2013: Heroku Secrets
Noah Zoschke at Waza 2013: Heroku SecretsNoah Zoschke at Waza 2013: Heroku Secrets
Noah Zoschke at Waza 2013: Heroku Secrets
Heroku
 
R57php 1231677414471772-2
R57php 1231677414471772-2R57php 1231677414471772-2
R57php 1231677414471772-2
ady36
 
What is systemd? Why use it? how does it work? - devoxx france 2017
What is systemd? Why use it? how does it work? - devoxx france 2017What is systemd? Why use it? how does it work? - devoxx france 2017
What is systemd? Why use it? how does it work? - devoxx france 2017
Quentin Adam
 
Performance Wins with BPF: Getting Started
Performance Wins with BPF: Getting StartedPerformance Wins with BPF: Getting Started
Performance Wins with BPF: Getting Started
Brendan Gregg
 
start_printf: dev/ic/com.c comstart()
start_printf: dev/ic/com.c comstart()start_printf: dev/ic/com.c comstart()
start_printf: dev/ic/com.c comstart()
Kiwamu Okabe
 
PHP in 2018 - Q4 - AFUP Limoges
PHP in 2018 - Q4 - AFUP LimogesPHP in 2018 - Q4 - AFUP Limoges
PHP in 2018 - Q4 - AFUP Limoges
✅ William Pinaud
 
Perl basics for Pentesters
Perl basics for PentestersPerl basics for Pentesters
Perl basics for Pentesters
Sanjeev Kumar Jaiswal
 
Dtrace и немного магии
Dtrace и немного магииDtrace и немного магии
Dtrace и немного магии
Dan Kruchinin
 
Bash tricks
Bash tricksBash tricks
Bash tricks
Carlo Caputo
 
Capital onehadoopclass
Capital onehadoopclassCapital onehadoopclass
Capital onehadoopclass
Doug Chang
 

Similar to Shell Scripting (20)

Unix 5 en
Unix 5 enUnix 5 en
Unix 5 en
 
A CTF Hackers Toolbox
A CTF Hackers ToolboxA CTF Hackers Toolbox
A CTF Hackers Toolbox
 
Naughty And Nice Bash Features
Naughty And Nice Bash FeaturesNaughty And Nice Bash Features
Naughty And Nice Bash Features
 
Linux 系統管理與安全:基本 Linux 系統知識
Linux 系統管理與安全:基本 Linux 系統知識Linux 系統管理與安全:基本 Linux 系統知識
Linux 系統管理與安全:基本 Linux 系統知識
 
Os Fetterupdated
Os FetterupdatedOs Fetterupdated
Os Fetterupdated
 
Marko Gargenta_Remixing android
Marko Gargenta_Remixing androidMarko Gargenta_Remixing android
Marko Gargenta_Remixing android
 
Introduction to Assembly Language
Introduction to Assembly LanguageIntroduction to Assembly Language
Introduction to Assembly Language
 
Keynote 1 - Engineering Software Analytics Studies
Keynote 1 - Engineering Software Analytics StudiesKeynote 1 - Engineering Software Analytics Studies
Keynote 1 - Engineering Software Analytics Studies
 
Cleanliness is Next to Domain-Specificity
Cleanliness is Next to Domain-SpecificityCleanliness is Next to Domain-Specificity
Cleanliness is Next to Domain-Specificity
 
Cleanliness is Next to Domain-Specificity
Cleanliness is Next to Domain-SpecificityCleanliness is Next to Domain-Specificity
Cleanliness is Next to Domain-Specificity
 
Noah Zoschke at Waza 2013: Heroku Secrets
Noah Zoschke at Waza 2013: Heroku SecretsNoah Zoschke at Waza 2013: Heroku Secrets
Noah Zoschke at Waza 2013: Heroku Secrets
 
R57php 1231677414471772-2
R57php 1231677414471772-2R57php 1231677414471772-2
R57php 1231677414471772-2
 
What is systemd? Why use it? how does it work? - devoxx france 2017
What is systemd? Why use it? how does it work? - devoxx france 2017What is systemd? Why use it? how does it work? - devoxx france 2017
What is systemd? Why use it? how does it work? - devoxx france 2017
 
Performance Wins with BPF: Getting Started
Performance Wins with BPF: Getting StartedPerformance Wins with BPF: Getting Started
Performance Wins with BPF: Getting Started
 
start_printf: dev/ic/com.c comstart()
start_printf: dev/ic/com.c comstart()start_printf: dev/ic/com.c comstart()
start_printf: dev/ic/com.c comstart()
 
PHP in 2018 - Q4 - AFUP Limoges
PHP in 2018 - Q4 - AFUP LimogesPHP in 2018 - Q4 - AFUP Limoges
PHP in 2018 - Q4 - AFUP Limoges
 
Perl basics for Pentesters
Perl basics for PentestersPerl basics for Pentesters
Perl basics for Pentesters
 
Dtrace и немного магии
Dtrace и немного магииDtrace и немного магии
Dtrace и немного магии
 
Bash tricks
Bash tricksBash tricks
Bash tricks
 
Capital onehadoopclass
Capital onehadoopclassCapital onehadoopclass
Capital onehadoopclass
 

More from dcarneir

Introdução ao desenvolvimento em hardware
Introdução ao desenvolvimento em hardwareIntrodução ao desenvolvimento em hardware
Introdução ao desenvolvimento em hardware
dcarneir
 
Redshift
RedshiftRedshift
Redshift
dcarneir
 
Bitcoin
BitcoinBitcoin
Bitcoin
dcarneir
 
Certificados digitais
Certificados digitaisCertificados digitais
Certificados digitais
dcarneir
 
Awk
AwkAwk
Shell Scripting
Shell ScriptingShell Scripting
Shell Scripting
dcarneir
 
Shell Scripting
Shell ScriptingShell Scripting
Shell Scripting
dcarneir
 
Shell Scripting
Shell ScriptingShell Scripting
Shell Scripting
dcarneir
 
Shell Scripting
Shell ScriptingShell Scripting
Shell Scripting
dcarneir
 
FLOSS
FLOSSFLOSS
FLOSS
dcarneir
 
IPv6
IPv6IPv6
IPv6
dcarneir
 
Regex
RegexRegex
Regex
dcarneir
 
Bancos de dados No-SQL e afins
Bancos de dados No-SQL e afinsBancos de dados No-SQL e afins
Bancos de dados No-SQL e afins
dcarneir
 

More from dcarneir (13)

Introdução ao desenvolvimento em hardware
Introdução ao desenvolvimento em hardwareIntrodução ao desenvolvimento em hardware
Introdução ao desenvolvimento em hardware
 
Redshift
RedshiftRedshift
Redshift
 
Bitcoin
BitcoinBitcoin
Bitcoin
 
Certificados digitais
Certificados digitaisCertificados digitais
Certificados digitais
 
Awk
AwkAwk
Awk
 
Shell Scripting
Shell ScriptingShell Scripting
Shell Scripting
 
Shell Scripting
Shell ScriptingShell Scripting
Shell Scripting
 
Shell Scripting
Shell ScriptingShell Scripting
Shell Scripting
 
Shell Scripting
Shell ScriptingShell Scripting
Shell Scripting
 
FLOSS
FLOSSFLOSS
FLOSS
 
IPv6
IPv6IPv6
IPv6
 
Regex
RegexRegex
Regex
 
Bancos de dados No-SQL e afins
Bancos de dados No-SQL e afinsBancos de dados No-SQL e afins
Bancos de dados No-SQL e afins
 

Recently uploaded

"Choosing proper type of scaling", Olena Syrota
"Choosing proper type of scaling", Olena Syrota"Choosing proper type of scaling", Olena Syrota
"Choosing proper type of scaling", Olena Syrota
Fwdays
 
Y-Combinator seed pitch deck template PP
Y-Combinator seed pitch deck template PPY-Combinator seed pitch deck template PP
Y-Combinator seed pitch deck template PP
c5vrf27qcz
 
Crafting Excellence: A Comprehensive Guide to iOS Mobile App Development Serv...
Crafting Excellence: A Comprehensive Guide to iOS Mobile App Development Serv...Crafting Excellence: A Comprehensive Guide to iOS Mobile App Development Serv...
Crafting Excellence: A Comprehensive Guide to iOS Mobile App Development Serv...
Pitangent Analytics & Technology Solutions Pvt. Ltd
 
5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides
DanBrown980551
 
Principle of conventional tomography-Bibash Shahi ppt..pptx
Principle of conventional tomography-Bibash Shahi ppt..pptxPrinciple of conventional tomography-Bibash Shahi ppt..pptx
Principle of conventional tomography-Bibash Shahi ppt..pptx
BibashShahi
 
Apps Break Data
Apps Break DataApps Break Data
Apps Break Data
Ivo Velitchkov
 
GraphRAG for LifeSciences Hands-On with the Clinical Knowledge Graph
GraphRAG for LifeSciences Hands-On with the Clinical Knowledge GraphGraphRAG for LifeSciences Hands-On with the Clinical Knowledge Graph
GraphRAG for LifeSciences Hands-On with the Clinical Knowledge Graph
Neo4j
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
panagenda
 
The Microsoft 365 Migration Tutorial For Beginner.pptx
The Microsoft 365 Migration Tutorial For Beginner.pptxThe Microsoft 365 Migration Tutorial For Beginner.pptx
The Microsoft 365 Migration Tutorial For Beginner.pptx
operationspcvita
 
Harnessing the Power of NLP and Knowledge Graphs for Opioid Research
Harnessing the Power of NLP and Knowledge Graphs for Opioid ResearchHarnessing the Power of NLP and Knowledge Graphs for Opioid Research
Harnessing the Power of NLP and Knowledge Graphs for Opioid Research
Neo4j
 
Leveraging the Graph for Clinical Trials and Standards
Leveraging the Graph for Clinical Trials and StandardsLeveraging the Graph for Clinical Trials and Standards
Leveraging the Graph for Clinical Trials and Standards
Neo4j
 
Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
Zilliz
 
GNSS spoofing via SDR (Criptored Talks 2024)
GNSS spoofing via SDR (Criptored Talks 2024)GNSS spoofing via SDR (Criptored Talks 2024)
GNSS spoofing via SDR (Criptored Talks 2024)
Javier Junquera
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
Tatiana Kojar
 
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfHow to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
Chart Kalyan
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
akankshawande
 
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
Edge AI and Vision Alliance
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
panagenda
 
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectorsConnector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
DianaGray10
 
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
Alex Pruden
 

Recently uploaded (20)

"Choosing proper type of scaling", Olena Syrota
"Choosing proper type of scaling", Olena Syrota"Choosing proper type of scaling", Olena Syrota
"Choosing proper type of scaling", Olena Syrota
 
Y-Combinator seed pitch deck template PP
Y-Combinator seed pitch deck template PPY-Combinator seed pitch deck template PP
Y-Combinator seed pitch deck template PP
 
Crafting Excellence: A Comprehensive Guide to iOS Mobile App Development Serv...
Crafting Excellence: A Comprehensive Guide to iOS Mobile App Development Serv...Crafting Excellence: A Comprehensive Guide to iOS Mobile App Development Serv...
Crafting Excellence: A Comprehensive Guide to iOS Mobile App Development Serv...
 
5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides
 
Principle of conventional tomography-Bibash Shahi ppt..pptx
Principle of conventional tomography-Bibash Shahi ppt..pptxPrinciple of conventional tomography-Bibash Shahi ppt..pptx
Principle of conventional tomography-Bibash Shahi ppt..pptx
 
Apps Break Data
Apps Break DataApps Break Data
Apps Break Data
 
GraphRAG for LifeSciences Hands-On with the Clinical Knowledge Graph
GraphRAG for LifeSciences Hands-On with the Clinical Knowledge GraphGraphRAG for LifeSciences Hands-On with the Clinical Knowledge Graph
GraphRAG for LifeSciences Hands-On with the Clinical Knowledge Graph
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
 
The Microsoft 365 Migration Tutorial For Beginner.pptx
The Microsoft 365 Migration Tutorial For Beginner.pptxThe Microsoft 365 Migration Tutorial For Beginner.pptx
The Microsoft 365 Migration Tutorial For Beginner.pptx
 
Harnessing the Power of NLP and Knowledge Graphs for Opioid Research
Harnessing the Power of NLP and Knowledge Graphs for Opioid ResearchHarnessing the Power of NLP and Knowledge Graphs for Opioid Research
Harnessing the Power of NLP and Knowledge Graphs for Opioid Research
 
Leveraging the Graph for Clinical Trials and Standards
Leveraging the Graph for Clinical Trials and StandardsLeveraging the Graph for Clinical Trials and Standards
Leveraging the Graph for Clinical Trials and Standards
 
Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
 
GNSS spoofing via SDR (Criptored Talks 2024)
GNSS spoofing via SDR (Criptored Talks 2024)GNSS spoofing via SDR (Criptored Talks 2024)
GNSS spoofing via SDR (Criptored Talks 2024)
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
 
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfHow to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
 
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
 
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectorsConnector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
 
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
 

Shell Scripting

  • 1. Daniel Carneiro Shell Script Parte VI
  • 2.
  • 3. Para remover muitos arquivos (500000+): rm f* bash: /bin/rm: Lista de argumentos muito longa for i in f*; do rm $i; done find -name 'f*' -exec rm {} for i in $( find -name 'f*'); do rm $i; done
  • 4. Buscar um aplicativo e matá-lo ps aux (listar processos) USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND root 1 0.0 0.0 2792 1648 ? Ss 19:27 0:00 /sbin/init root 2 0.0 0.0 0 0 ? S 19:27 0:00 [kthreadd] root 3 0.0 0.0 0 0 ? S 19:27 0:01 [migration/0] root 4 0.0 0.0 0 0 ? S 19:27 0:00 [ksoftirqd/0] root 5 0.0 0.0 0 0 ? S 19:27 0:00 [watchdog/0] root 6 0.0 0.0 0 0 ? S 19:27 0:01 [migration/1] root 7 0.0 0.0 0 0 ? S 19:27 0:00 [ksoftirqd/1] root 8 0.0 0.0 0 0 ? S 19:27 0:00 [watchdog/1] root 9 0.0 0.0 0 0 ? S 19:27 0:00 [events/0] root 10 0.0 0.0 0 0 ? S 19:27 0:00 [events/1] . . . daniel 2762 35.4 2.4 73372 70772 pts/0 Ss 22:12 22:09 bash daniel 12969 0.0 0.0 2716 1040 pts/1 R+ 23:14 0:00 ps aux
  • 5. Buscar um aplicativo e matá-lo pids= $( ps aux| grep pts/1| grep -v grep| tr -s " "| cut -d " " -f 2 ) for i in $pids; do kill $i; done
  • 6. Install Script #!/bin/bash SID= ${1:-$ORACLE_SID} echo Creating instance $SID read -r -p "Are you sure? [y/N] " response response= ${response,,} # tolower if [[ $response =~ ^(yes|y)$ ]]; then echo creating... $SID else exit fi
  • 7. Install Script mkdir $SID cp pass.sql $SID cat init.ora| sed -e "s/ORACLE_SID/ $SID /g" > $SID /init.ora cat CreateDB.sql| sed -e "s/ORACLE_SID/ $SID /g" > $SID /CreateDB.sql cat CreateDBFiles.sql| sed -e "s/ORACLE_SID/ $SID /g" > $SID /CreateDBFiles.sql cat CreateDBCatalog.sql| sed -e "s/ORACLE_SID/ $SID /g" > $SID /CreateDBCatalog.sql cat postDBCreation.sql| sed -e "s/ORACLE_SID/ $SID /g" > $SID /postDBCreation.sql

Editor's Notes

  1. tempo de execução: 16s versus 91m find procura subdirs
  2. Diferença entre ' e “