Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Bash Introduction
Search
André Augusto Costa Santos
October 24, 2013
Programming
608
210k
Bash Introduction
Introduction to the Unix command line
André Augusto Costa Santos
October 24, 2013
Tweet
Share
Other Decks in Programming
See All in Programming
快適な開発と高セキュリティを実現するCryptoKitを活用したCoreDataのデータ暗号化術
grandbig
1
300
健康第一!MetricKitで始めるアプリの健康診断 / App Health Checkups Starting with MetricKit
nekowen
4
790
LangGraphでのHuman-in-the-Loopの実装
os1ma
3
560
Amebaチョイス立ち上げの裏側 ~依存システムとの闘い~
daichi_igarashi
0
220
数値を文字列に整形する際の落とし穴とその解決策(iOSDC2024 ルーキーズLT) / iOSDC Japan 2024 Formatting Floating-Point Numbers
glassfiber
0
250
月間4.5億回再生を超える大規模サービス TVer iOSアプリのリアーキテクチャ戦略 - iOSDC2024
techtver
PRO
1
570
Mastering AsyncSequence - 使う・作る・他のデザインパターン(クロージャ、Delegate など)から移行する
treastrain
3
1.3k
LR で JSON パーサーを作る / Coding LR JSON Parser
junk0612
2
170
Desafios e Lições Aprendidas na Migração de Monólitos para Microsserviços em Java
jessilyneh
2
130
TypeScriptで 負荷テストを書こう 〜k6のシングルバイナリの秘密〜
dora1998
7
2.8k
Swiftコードバトル必勝法
toshi0383
0
140
Uncharted packages (Laravel Live Denmark)
freekmurze
0
140
Featured
See All Featured
Designing for Performance
lara
604
68k
Put a Button on it: Removing Barriers to Going Fast.
kastner
58
3.4k
The Mythical Team-Month
searls
218
43k
RailsConf 2023
tenderlove
26
790
Designing Experiences People Love
moore
138
23k
Statistics for Hackers
jakevdp
793
220k
Gamification - CAS2011
davidbonilla
79
4.9k
Bootstrapping a Software Product
garrettdimon
PRO
304
110k
Typedesign – Prime Four
hannesfritz
38
2.3k
A better future with KSS
kneath
235
17k
Agile that works and the tools we love
rasmusluckow
327
20k
Rails Girls Zürich Keynote
gr2m
93
13k
Transcript
INTRODUCTION BASH
ANDRÉ SANTOS FRANCISCO NEVES 62Gerente
[email protected]
andre-santos.pt francisconeves
[email protected]
francisconeves.com
None
UNIX BASED SYSTEMS
UNIX BASED SYSTEMS STABILITY PERFORMANCE SCALABILITY COMPATIBILITY PRICE VS WINDOWS
BASH? ‣WHAT DOES IT MEAN? ‣ADVANTAGES? WHAT IS
BASH? ‣AUTOCOMPLETE ‣MAN PAGES ‣CLEAR SCREEN HOW TO DEAL WITH
COMMANDS SOME REQUIRED
LIST ls -a -l ALL FILES LONG FORMAT MAKE DIRECTORY
mkdir [OPT] DIR -p MAKE PARENTS
CHANGE DIRECTORY cd PATH . CURRENT DIR ~ .. PARENT
DIR HOME DIR PRINT WORKING DIRECTORY pwd CREATE EMPTY FILE touch FILE
COPY cp [OPT] FROM TO MOVE OR RENAME mv FROM
TO -r COPY DIRECTORIES RECURSIVELY
REMOVE rm [OPT] FILE REMOVE DIRECTORY rmdir [OPT] DIR -r
RECURSIVELY REMOVE DIRECTORIES -f FORCE -p PARENTS
CONCATENATE AND PRINT FILES cat [OPT] FILES less [OPT] FILE
-N NUMBER THE OUTPUT LINES VIEW FILE -l NUMBER THE OUTPUT LINES
FREQUENT COMMANDS LESS Key COMMAND Space NEXT PAGE b PREVIOUS
PAGE j NEXT LINE k PREVIOUS LINE g FIRST LINE G LAST LINE <n>G LINE <n> Key COMMAND /<text> FOWARD SEARCH FOR <TEXT> ?<text> BACKWARD SEARCH FOR <TEXT> n NEXT SEARCH MATCH N PREVIOUS SEARCH MATCH = FILE INFORMATION h HELP q QUIT
DISPLAY FIRST LINES head [OPT] FILE tail [OPT] FILE -n
LAST N LINES -n FIRST N LINES DISPLAY LAST 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
COMMANDS CTRL-KEY
KILL PROCESS CTRL + C STOP PROCESS CTRL + Z
END OF FILE CTRL + D
REDIRECTION I/O
COMMAND > FILE REDIRECT STDOUT TO A FILE OVERWRITE COMMAND
>> FILE REDIRECT STDIN TO A FILE APPEND COMMAND < FILE
COMMAND1 | COMMAND2 | COMMAND3 REDIRECT THE OUTPUT FROM ONE
COMMAND AS INPUT TO THE NEXT ONE
WILDCARDS
WHAT ARE WILDCARDS?
* ? ANY SINGLE CHARACTER ANY NUMBER OF CHARACTERS
SECURITY SYSTEM AND
PERMISSIONS UNIX sudo [OPT] [USER] COMMAND ALLOWS USERS TO RUN
PROGRAMS WITH THE SECURITY PRIVILEGES OF ANOTHER USER NORMALLY THE ROOT
PERMISSIONS UNIX u u u g g g o o
o user user user group group group others others others r w x r w x r w x 4 2 1 4 2 1 4 2 1 a = all 7
CHANGE PERMISSIONS chmod [OPT] MODE FILE -R RECURSIVELY +rx g-w
777 READ AND EXECUTE FOR ALL DENY WRITE ACESS FOR GROUP READ, WRITE AND EXECUTE FOR ALL
PROCESSES UNIX COMMAND & RUN PROCESS ON BACKGROUND jobs BACKGROUND
OR SUSPENDED PROCESSES kill SIGNAL PROCESS SEND SIGNAL TO A PROCESS killall PROCESS KILL PROCESS BY NAME
top DISPLAY TOP CPU PROCESSES ps REPORTS THE PROCESS STATUS
-e FULL LISTING ALL PROCESSES -f
LEAST LAST BUT NOT
history -c CLEAR LAST COMMANDS USED time COMMAND TIME COMMAND
EXECUTION diff COMPARE FILES LINE BY LINE !* LAST MATCHED COMMAND
WALK A FILE HIERARCHY find PATH [OPT] [EXPRESSION] -name FIND
BY NAME -size FIND BY SIZE -iname CASE INSENSITIVE MODE
?