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
Shell Basic
Search
zhiyelee
April 17, 2014
Programming
3
83
Shell Basic
ls,cd,wc,grep,find
zhiyelee
April 17, 2014
Tweet
Share
Other Decks in Programming
See All in Programming
ADRを一年運用してみた/adr_after_a_year
hanhan1978
7
2.4k
MicrosoftのPlatform Engineeringガイドを読んで実際になにかやってみた
ymd65536
1
310
Random\Randomizer クラスで日常のあれこれを解決しよう! / Random\Randomizer class solves familiar trouble
cocoeyes02
0
230
HUIT新歓2024「競技プログラミング、やってみませんか?」
slephy2784
1
270
AWS CDKコントリビュートTIPS / aws-cdk-contribution-tips
gotok365
2
120
SIMD Parallel Programming with the Vector API
josepaumard
0
150
GraphQLサーバの構成要素を整理する #ハッカー鮨 #tsukijigraphql / graphql server technology selection
izumin5210
4
820
Ruby GitHub Packages
bkuhlmann
0
630
効率化に挑戦してみたらモバイル開発が少し快適になった話
ryunakayama
0
130
VS Code をプロダクトにどう取り込むか
onomax
1
360
Changed Rules: Architectures with Lightweight Stores
manfredsteyer
PRO
0
240
코틀린으로 멀티플랫폼 만들기
pangmoo
0
150
Featured
See All Featured
Docker and Python
trallard
34
2.7k
Designing the Hi-DPI Web
ddemaree
276
33k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
121
39k
Bash Introduction
62gerente
604
210k
A Tale of Four Properties
chriscoyier
151
22k
Building an army of robots
kneath
300
41k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
244
20k
Git: the NoSQL Database
bkeepers
PRO
422
63k
No one is an island. Learnings from fostering a developers community.
thoeni
16
2.1k
Ruby is Unlike a Banana
tanoku
96
10k
Principles of Awesome APIs and How to Build Them.
keavy
121
16k
The Mythical Team-Month
searls
216
42k
Transcript
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编程