Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Shell Basic
Search
zhiyelee
April 17, 2014
Programming
91
3
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Shell Basic
ls,cd,wc,grep,find
zhiyelee
April 17, 2014
Transcript
49 slides
Shell Basic @zhiyelee! F2E! https://github.com/zhiyelee
How to learn • man man man ! • practice
dir/file manipulation • mkdir / mkdir -p! • rmdir /
rmdir -p! • rm -rf! • cp -i! • ln -s
cd
ls • ls -- list directory contents! • Options! •
-l,-a,-t! • -Ut
ls
tree • tree -- list files in tree-like format! •
Options! • -a,-d,-f! • -P,-I
tree
Display Files
cat • cat - Concatenate Files! • cat -n !
• cat -s
cat
cat multiple files
less & more • less/more! • less line move,more page
move! • does not read the entire input file before starting! • less -N line-number! • ls /etc | less
tail & head • tail ! • tail -f! •
tail -5! ! • head! • head -5
wc • wc -l
echo • echo -e! • echo -n
echo
Identifying Commands • type - Display A Command's Type! •
type cd! • type ll
type
Identifying Commands • which - Display An Executable's Location! •
which ls! • cat `which hlfile`
which
Redirction
Redirection • stdin,stdout,stderr! • 0 1 2! • /dev/null! •
< > >>! • Case! • redirect error! • redirect stdout and error to a file
2>&1
Permissions
" chmod – Change a file's mode! " umask –
Set the default file permissions! " su – Run a shell as another user! " sudo – Execute a command as another user! " chown – Change a file's owner
from《The Linux Command Line》William E. Shotts, Jr.
None
umask • umask! • the default permissions of created file!
• octal notation ! • express a mask of bits to be removed from a file's mode attributes! • common default value: 022 002
umask
umask 022 owner group other original file mode rw- 110
rw- 110 rw- 110 umask 000 010 010 mode of created file rw- 110 r— 100 r— 100
umask 002 owner group other original file mode rw- 110
rw- 110 rw- 110 umask 000 000 010 mode of created file rw- 110 rw- 110 r— 100
chmod • chmod! • change file mode(permissions)! • usage! •
chmod 755 file! • chmod ug+x file
chmod
Search
Grep • Options! • -v, -l,-L, -A, -B,n, -r/-R! •
Case! • get templates contains `misc` cssfile! • get templates not contain `footer.php`! • contain `misc` but not `footer.php`
get templates contains `misc` cssfile
get templates not contain `footer.php`
contain `misc` but not `footer.php`
Grep
Find • Options! • -name, -perm, -delete,-regex! • !! •
Case! • find all .swp files! • delete all .swp files! • find not .png and jpg file
find and delete
Find
find perm
trap
Case Study • deploywww! • fetch all imgs of a
cssfile! • git pu
fetch all imgs of a css file
git pu
Reference • 《The Linux Command Line》William E. Shotts, Jr.! •
20130109 - 李志业 - Shell编程
Other Decks in Programming
See All in Programming
LLM 101
dalinaum
0
540
Kotlin Fest 2026: Kotlin コンパイラに Contribute してみよう! - Kotlin/Wasm で深い再帰を書けるようにした話
ternbusty
1
420
将来の標準フォーマッター?ktfmtを深堀る
t45k
0
250
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
140
例外からRich Errorsまで Kotlinエラーハンドリングの進化を読み解く
shiita0903
0
240
仕様駆動開発入門 (何を作るかを先に決めて渡す) | 目指せ Kiro マスター 05
inariku
PRO
3
220
作れるエンジニアから、価値を届けるエンジニアへ
ryunakayama
1
860
AI駆動開発4年目の現在地(『あなたはFDEになるべきか?』イベント資料)
kumaiu
0
700
LLM 101: Exploring LLMs, Starting with Tokens.
dalinaum
0
120
AIエージェントの「テストは通るのに本番で壊れる」を減らす
shibuiwilliam
3
120
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
420
Debian JP Projectのサーバー構成
uwabami
1
180
Featured
See All Featured
Into the Great Unknown - MozCon
thekraken
41
2.8k
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
1k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
35k
Darren the Foodie - Storyboard
khoart
PRO
5
4.1k
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
1
1k
Building a Scalable Design System with Sketch
lauravandoore
464
34k
Documentation Writing (for coders)
carmenintech
77
5.7k
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
680
4 Signs Your Business is Dying
shpigford
187
23k
Typedesign – Prime Four
hannesfritz
42
3.2k
Paper Plane
katiecoart
PRO
6
55k
Designing Powerful Visuals for Engaging Learning
tmiket
1
660