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
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
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
3回つくってわかった、 定期実行ジョブ基盤の本質情報
takai
4
3.9k
私なりのハーネスエンジニアリング ~独自の言語処理系の開発を通して~
seosoft
0
200
React Native에 현대적인 빌드 도구 더하기: Rollipop 구현기
leegeunhyeok
0
180
ActionController meets Protocol Buffers
sorah
1
800
作って学ぶSpring BootのAuto Configuration / JJUG Night Seminar 2026-10-19
rshindo
0
230
Crash Auto Pipelines
veronikapj
1
410
Spec-Driven Development - Why Vaadin Is the Perfect Fit
simas
PRO
0
250
S3 TablesのIcebergデータに、AIエージェントからアクセスしてみた / 20261016developersio2026joetsu-accessing-iceberg-in-s3tables-via-agent
kasacchiful
PRO
0
310
全ての永続トークンを、生まれる前に消し去りたい!
sylph01
3
1.7k
あなたの await、OS まで届いてる? strace で覗く JavaScript の非同期
hasutosasaki
1
2.3k
flutter_test のその先へ — Flutter アプリの LLM 機能に「評価」という品質保証を
kosukesaigusa
0
200
SODA - FACT BOOK(JP)
sodainc
1
40k
Featured
See All Featured
Become a Pro
speakerdeck
PRO
31
6.4k
Principles of Awesome APIs and How to Build Them.
keavy
128
18k
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
1
380
Bootstrapping a Software Product
garrettdimon
PRO
306
120k
New Earth Scene 8
popppiees
5
2.8k
The Anti-SEO Checklist Checklist. Pubcon Cyber Week
ryanjones
0
300
Designing Experiences People Love
moore
143
24k
WCS-LA-2024
lcolladotor
0
990
Ten Tips & Tricks for a 🌱 transition
stuffmc
1
280
Why Our Code Smells
bkeepers
PRO
340
58k
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
560
ラッコキーワード サービス紹介資料
rakko
5
5.8M