SlideShare a Scribd company logo
1 of 35
Download to read offline
BASH
INTRODUCTION
ANDRÉ SANTOS
62Gerente

andreccdr@gmail.com

andre-santos.pt

FRANCISCO NEVES
francisconeves contact@francisconeves.com francisconeves.com
UNIX BASED SYSTEMS
UNIX BASED SYSTEMS
STABILITY
PERFORMANCE
SCALABILITY
COMPATIBILITY
PRICE

VS WINDOWS
WHAT IS

BASH?

‣WHAT DOES IT MEAN?
‣ADVANTAGES?
HOW TO DEAL WITH

BASH?

‣AUTOCOMPLETE
‣MAN PAGES
‣CLEAR SCREEN
SOME REQUIRED

COMMANDS
LIST

ls

MAKE
DIRECTORY

mkdir [OPT] DIR
-p

-a

ALL FILES

-l

LONG FORMAT

MAKE PARENTS
CHANGE
DIRECTORY

cd PATH

PRINT WORKING
DIRECTORY

pwd

CREATE
EMPTY FILE

touch FILE

.
..
~

CURRENT DIR
PARENT DIR
HOME DIR
COPY

cp [OPT] FROM TO
-r

MOVE OR
RENAME

COPY DIRECTORIES RECURSIVELY

mv FROM TO
REMOVE

rm [OPT] FILE
-r
-f

REMOVE
DIRECTORY

RECURSIVELY REMOVE DIRECTORIES
FORCE

rmdir [OPT] DIR
-p

PARENTS
CONCATENATE
AND PRINT FILES

cat [OPT] FILES
-l

VIEW FILE

NUMBER THE OUTPUT LINES

less [OPT] FILE
-N

NUMBER THE OUTPUT LINES
LESS

FREQUENT COMMANDS

Key

COMMAND

Key

COMMAND

Space

NEXT PAGE

/<text>

FOWARD SEARCH FOR <TEXT>

b

PREVIOUS PAGE

?<text>

BACKWARD SEARCH FOR <TEXT>

j

NEXT LINE

n

NEXT SEARCH MATCH

k

PREVIOUS LINE

N

PREVIOUS SEARCH MATCH

g

FIRST LINE

=

FILE INFORMATION

G

LAST LINE

h

HELP

<n>G

LINE <n>

q

QUIT
DISPLAY
FIRST LINES

head [OPT] FILE
-n

DISPLAY
LAST LINES

FIRST N LINES

tail [OPT] FILE
-n

LAST N LINES
PRINT LINES MATCHING A PATTERN
grep [OPT] PATTERN [FILE...]
-c

DISPLAY THE NUMBER OF MATCHED LINES

-i

IGNORE CASE SENSITIVITY

-l

DISPLAY THE FILENAMES

-n

DISPLAY THE LINE NUMBERS

-w

MATCH WHOLE WORD
WORD COUNT
wc [OPT] FILE
-l

LINE COUNT

-c

BYTE COUNT

-m

CHARACTER COUNT

-w

WORD COUNT
CTRL-KEY
COMMANDS
KILL PROCESS

CTRL + C

STOP PROCESS

CTRL + Z

END OF FILE

CTRL + D
I/O

REDIRECTION
REDIRECT STDOUT TO A FILE
COMMAND

APPEND

OVERWRITE
> FILE

COMMAND

REDIRECT STDIN TO A FILE
COMMAND

<

FILE

>>

FILE
REDIRECT THE OUTPUT FROM ONE COMMAND AS
INPUT TO THE NEXT ONE
COMMAND1 | COMMAND2 | COMMAND3
WILDCARDS
WHAT ARE

WILDCARDS?
*

ANY NUMBER OF CHARACTERS

?

ANY SINGLE CHARACTER
SYSTEM AND

SECURITY
UNIX PERMISSIONS
ALLOWS USERS TO RUN PROGRAMS WITH THE
SECURITY PRIVILEGES OF ANOTHER USER
sudo [OPT] [USER] COMMAND

NORMALLY THE ROOT
UNIX PERMISSIONS
a = all
u

g

o

user

group

others

r

w

x

r

w

x

r

w

x

4

2

1

4

2

1

4

2

1

7
CHANGE PERMISSIONS
chmod [OPT] MODE FILE
-R

RECURSIVELY
+rx

READ AND EXECUTE FOR ALL

g-w

DENY WRITE ACESS FOR GROUP

777

READ, WRITE AND EXECUTE FOR ALL
UNIX PROCESSES
COMMAND &
jobs
kill SIGNAL PROCESS
killall PROCESS

RUN PROCESS ON BACKGROUND
BACKGROUND OR SUSPENDED PROCESSES
SEND SIGNAL TO A PROCESS
KILL PROCESS BY NAME
DISPLAY TOP CPU PROCESSES
top
REPORTS THE PROCESS STATUS
ps

-f

FULL LISTING

-e

ALL PROCESSES
LAST BUT NOT

LEAST
LAST COMMANDS USED
history

-c

CLEAR

TIME COMMAND EXECUTION
time COMMAND

COMPARE FILES LINE BY LINE
diff

!*

LAST MATCHED COMMAND
WALK A FILE HIERARCHY
find PATH [OPT] [EXPRESSION]
-name

FIND BY NAME

-size

FIND BY SIZE

-iname

CASE INSENSITIVE MODE
?

More Related Content

What's hot

Dhcp presentation 01
Dhcp presentation 01Dhcp presentation 01
Dhcp presentation 01
maverick4489
 
Redes Avançadas - 3.Noções de Projeto de Redes
Redes Avançadas - 3.Noções de Projeto de RedesRedes Avançadas - 3.Noções de Projeto de Redes
Redes Avançadas - 3.Noções de Projeto de Redes
Mauro Tapajós
 

What's hot (20)

Static Routing
Static RoutingStatic Routing
Static Routing
 
Dhcp presentation 01
Dhcp presentation 01Dhcp presentation 01
Dhcp presentation 01
 
Apresentação sobre ipv6
Apresentação sobre ipv6Apresentação sobre ipv6
Apresentação sobre ipv6
 
Network address translation
Network address translationNetwork address translation
Network address translation
 
DNS Security (DNSSEC) With BIG-IP Global Traffic Manager
DNS Security (DNSSEC) With BIG-IP Global Traffic ManagerDNS Security (DNSSEC) With BIG-IP Global Traffic Manager
DNS Security (DNSSEC) With BIG-IP Global Traffic Manager
 
DNS server configuration
DNS server configurationDNS server configuration
DNS server configuration
 
Cisco router basic
Cisco router basicCisco router basic
Cisco router basic
 
what is Private and publis ip address
what is Private and publis ip addresswhat is Private and publis ip address
what is Private and publis ip address
 
Open shortest path first (ospf)
Open shortest path first (ospf)Open shortest path first (ospf)
Open shortest path first (ospf)
 
Tech 101: Understanding Firewalls
Tech 101: Understanding FirewallsTech 101: Understanding Firewalls
Tech 101: Understanding Firewalls
 
1000 Ccna Questions And Answers
1000 Ccna Questions And Answers1000 Ccna Questions And Answers
1000 Ccna Questions And Answers
 
Aula 00 - Introducao ao Windows Server .pdf
Aula 00 - Introducao ao Windows Server .pdfAula 00 - Introducao ao Windows Server .pdf
Aula 00 - Introducao ao Windows Server .pdf
 
Traceroute- A Networking Tool
Traceroute- A Networking ToolTraceroute- A Networking Tool
Traceroute- A Networking Tool
 
Linux server administration syllabus
Linux server administration syllabusLinux server administration syllabus
Linux server administration syllabus
 
Redes Avançadas - 3.Noções de Projeto de Redes
Redes Avançadas - 3.Noções de Projeto de RedesRedes Avançadas - 3.Noções de Projeto de Redes
Redes Avançadas - 3.Noções de Projeto de Redes
 
NGINX 101: Web Traffic Encryption with SSL/TLS and NGINX
NGINX 101: Web Traffic Encryption with SSL/TLS and NGINXNGINX 101: Web Traffic Encryption with SSL/TLS and NGINX
NGINX 101: Web Traffic Encryption with SSL/TLS and NGINX
 
Network Address Translation (NAT)
Network Address Translation (NAT)Network Address Translation (NAT)
Network Address Translation (NAT)
 
Enderecamento ip
Enderecamento ipEnderecamento ip
Enderecamento ip
 
Primeiros passos com a API do Zabbix - Webinar JLCP
Primeiros passos com a API do Zabbix - Webinar JLCPPrimeiros passos com a API do Zabbix - Webinar JLCP
Primeiros passos com a API do Zabbix - Webinar JLCP
 
InterPlanetary File System (IPFS)
InterPlanetary File System (IPFS)InterPlanetary File System (IPFS)
InterPlanetary File System (IPFS)
 

Viewers also liked

Barriers to the diffusion of the VSM (Nuno Rosa, 2016)
Barriers to the diffusion of the VSM (Nuno Rosa, 2016)Barriers to the diffusion of the VSM (Nuno Rosa, 2016)
Barriers to the diffusion of the VSM (Nuno Rosa, 2016)
Nuno Rosa
 
ShopAlikePT_March2016_PT_Presentation
ShopAlikePT_March2016_PT_PresentationShopAlikePT_March2016_PT_Presentation
ShopAlikePT_March2016_PT_Presentation
Pedro de Almeida
 
Digital Marketing Journey - Lecture INP & ISG
Digital Marketing Journey - Lecture INP & ISGDigital Marketing Journey - Lecture INP & ISG
Digital Marketing Journey - Lecture INP & ISG
Inês Tomás Mateus
 
Mais do que um viral
Mais do que um viralMais do que um viral
Mais do que um viral
Armando Alves
 
[Brazil] guia internet_marketing (1)
[Brazil] guia internet_marketing (1)[Brazil] guia internet_marketing (1)
[Brazil] guia internet_marketing (1)
Ricardo Belchior
 

Viewers also liked (20)

Evolução modelos de negócio na internet.
Evolução modelos de negócio na internet.Evolução modelos de negócio na internet.
Evolução modelos de negócio na internet.
 
Barriers to the diffusion of the VSM (Nuno Rosa, 2016)
Barriers to the diffusion of the VSM (Nuno Rosa, 2016)Barriers to the diffusion of the VSM (Nuno Rosa, 2016)
Barriers to the diffusion of the VSM (Nuno Rosa, 2016)
 
Como produzir um artigo de referencia para a wikipedia (manuel de sousa)
Como produzir um artigo de referencia para a wikipedia (manuel de sousa)Como produzir um artigo de referencia para a wikipedia (manuel de sousa)
Como produzir um artigo de referencia para a wikipedia (manuel de sousa)
 
ShopAlikePT_March2016_PT_Presentation
ShopAlikePT_March2016_PT_PresentationShopAlikePT_March2016_PT_Presentation
ShopAlikePT_March2016_PT_Presentation
 
Digital Marketing Journey - Lecture INP & ISG
Digital Marketing Journey - Lecture INP & ISGDigital Marketing Journey - Lecture INP & ISG
Digital Marketing Journey - Lecture INP & ISG
 
Agent Eighteen 2010 Mockup
Agent Eighteen 2010 MockupAgent Eighteen 2010 Mockup
Agent Eighteen 2010 Mockup
 
Prompt en
Prompt enPrompt en
Prompt en
 
Mais do que um viral
Mais do que um viralMais do que um viral
Mais do que um viral
 
Visions of Portugal by the.pt
Visions of Portugal by the.ptVisions of Portugal by the.pt
Visions of Portugal by the.pt
 
Apresentação
ApresentaçãoApresentação
Apresentação
 
Set n'match
Set n'matchSet n'match
Set n'match
 
The Authentic Experiences
The Authentic ExperiencesThe Authentic Experiences
The Authentic Experiences
 
Launching tech products
Launching tech productsLaunching tech products
Launching tech products
 
TEDxMatosinhos - À Bolina
TEDxMatosinhos - À BolinaTEDxMatosinhos - À Bolina
TEDxMatosinhos - À Bolina
 
Scheduled releases @ Commit Porto 2016
Scheduled releases @ Commit Porto 2016Scheduled releases @ Commit Porto 2016
Scheduled releases @ Commit Porto 2016
 
Apresentação Grão Torrado
Apresentação Grão TorradoApresentação Grão Torrado
Apresentação Grão Torrado
 
[Brazil] guia internet_marketing (1)
[Brazil] guia internet_marketing (1)[Brazil] guia internet_marketing (1)
[Brazil] guia internet_marketing (1)
 
Meet-Beat Your Way To Sales Growth and Productivity Improvement
Meet-Beat Your Way To  Sales Growth and Productivity ImprovementMeet-Beat Your Way To  Sales Growth and Productivity Improvement
Meet-Beat Your Way To Sales Growth and Productivity Improvement
 
Novas Regras Domínios .PT 2014 - DNS.PT
Novas Regras Domínios .PT 2014 - DNS.PTNovas Regras Domínios .PT 2014 - DNS.PT
Novas Regras Domínios .PT 2014 - DNS.PT
 
Talk TEDx Vila Real - "Encontrar a Psicologia Positiva nas histórias nos dias"
Talk TEDx Vila Real - "Encontrar a Psicologia Positiva nas histórias nos dias"Talk TEDx Vila Real - "Encontrar a Psicologia Positiva nas histórias nos dias"
Talk TEDx Vila Real - "Encontrar a Psicologia Positiva nas histórias nos dias"
 

Similar to Bash Introduction

프로토추천♬♬W­Е­4­9­닷­С­О­М♬♬고액배팅사이트め고액배팅사이트め프로토
프로토추천♬♬W­Е­4­9­닷­С­О­М♬♬고액배팅사이트め고액배팅사이트め프로토프로토추천♬♬W­Е­4­9­닷­С­О­М♬♬고액배팅사이트め고액배팅사이트め프로토
프로토추천♬♬W­Е­4­9­닷­С­О­М♬♬고액배팅사이트め고액배팅사이트め프로토
itsming
 
Lecture 2 - C Programming.pdf
Lecture 2 - C Programming.pdfLecture 2 - C Programming.pdf
Lecture 2 - C Programming.pdf
ssuser02936f
 
Arp Dan Ipconfig Syntax
Arp Dan Ipconfig  SyntaxArp Dan Ipconfig  Syntax
Arp Dan Ipconfig Syntax
guestcc37e8c
 
Effective codereview | Dave Liddament | CODEiD
Effective codereview | Dave Liddament | CODEiDEffective codereview | Dave Liddament | CODEiD
Effective codereview | Dave Liddament | CODEiD
CODEiD PHP Community
 

Similar to Bash Introduction (20)

프로토추천♬♬W­Е­4­9­닷­С­О­М♬♬고액배팅사이트め고액배팅사이트め프로토
프로토추천♬♬W­Е­4­9­닷­С­О­М♬♬고액배팅사이트め고액배팅사이트め프로토프로토추천♬♬W­Е­4­9­닷­С­О­М♬♬고액배팅사이트め고액배팅사이트め프로토
프로토추천♬♬W­Е­4­9­닷­С­О­М♬♬고액배팅사이트め고액배팅사이트め프로토
 
Lecture 2 - C Programming.pdf
Lecture 2 - C Programming.pdfLecture 2 - C Programming.pdf
Lecture 2 - C Programming.pdf
 
Linux Tutorial For Beginners | Linux Administration Tutorial | Linux Commands...
Linux Tutorial For Beginners | Linux Administration Tutorial | Linux Commands...Linux Tutorial For Beginners | Linux Administration Tutorial | Linux Commands...
Linux Tutorial For Beginners | Linux Administration Tutorial | Linux Commands...
 
Arp Dan Ipconfig Syntax
Arp Dan Ipconfig  SyntaxArp Dan Ipconfig  Syntax
Arp Dan Ipconfig Syntax
 
Raj linux
Raj linux Raj linux
Raj linux
 
Introduction to the linux command line.pdf
Introduction to the linux command line.pdfIntroduction to the linux command line.pdf
Introduction to the linux command line.pdf
 
Basic
BasicBasic
Basic
 
How Do I Unix
How Do I UnixHow Do I Unix
How Do I Unix
 
Configuration and lifecycle in Mixed environments
Configuration and lifecycle in Mixed environmentsConfiguration and lifecycle in Mixed environments
Configuration and lifecycle in Mixed environments
 
Prabu linux
Prabu linuxPrabu linux
Prabu linux
 
Prabu linux
Prabu linuxPrabu linux
Prabu linux
 
Command line for the beginner - Using the command line in developing for the...
Command line for the beginner -  Using the command line in developing for the...Command line for the beginner -  Using the command line in developing for the...
Command line for the beginner - Using the command line in developing for the...
 
Leveraging a distributed architecture to your advantage
Leveraging a distributed architecture to your advantageLeveraging a distributed architecture to your advantage
Leveraging a distributed architecture to your advantage
 
Effective codereview | Dave Liddament | CODEiD
Effective codereview | Dave Liddament | CODEiDEffective codereview | Dave Liddament | CODEiD
Effective codereview | Dave Liddament | CODEiD
 
Babitha.linux
Babitha.linuxBabitha.linux
Babitha.linux
 
Babitha.linux
Babitha.linuxBabitha.linux
Babitha.linux
 
Babitha.linux
Babitha.linuxBabitha.linux
Babitha.linux
 
Babitha.linux
Babitha.linuxBabitha.linux
Babitha.linux
 
Babitha.linux
Babitha.linuxBabitha.linux
Babitha.linux
 
Babitha.linux
Babitha.linuxBabitha.linux
Babitha.linux
 

Recently uploaded

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Recently uploaded (20)

A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 

Bash Introduction