๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ
Linux

[Linux-์ƒํ™œ์ฝ”๋”ฉ] Why using CLI? (pipeline)

by ์ฝ”๋”ฉํ•˜๋Š” ๋ถ•์–ด 2021. 3. 7.
๋ฐ˜์‘ํ˜•

[์ถœ์ฒ˜-์œ ํŠœ๋ธŒ ์ƒํ™œ์ฝ”๋”ฉ]

https://youtu.be/jiNfAQRJuRs?list=PLuHgQVnccGMBT57a9dvEtd6OuWpugF9SH

 

cat

ํŒŒ์ผ ๋‚ด์šฉ์„ ์ถœ๋ ฅํ•œ๋‹ค

$ cat [ํŒŒ์ผ ์ด๋ฆ„]

 

 

 

 

grep

ํŒŒ์ผ์˜ ๋‚ด์šฉ์—์„œ ํŠน์ • ๋ฌธ์ž์—ด์„ ์ฐพ๊ณ ์ž ํ•  ๋•Œ ์‚ฌ์šฉํ•˜๋Š” ๋ช…๋ น์–ด

$ grep [์ฐพ๊ณ  ์‹ถ์€ ๋‹จ์–ด] [๋ช…๋ น์„ ์ˆ˜ํ–‰ํ•  ํŒŒ์ผ๋ช…]

 

 

 

 

| (pipeline)

๋‘˜ ์ด์ƒ์˜ ๋ช…๋ น์„ ํ•จ๊ป˜ ๋ฌถ์–ด ์ถœ๋ ฅํ•˜๋Š” ๊ธฐ๋Šฅ

 

$ ls --help | grep sort

ls --help ๋ฆฌ์ŠคํŠธ๋ฅผ ์ถœ๋ ฅํ•œ๋‹ค. ๊ทธ ์ค‘์—์„œ sort๋ผ๋Š” ๋ฌธ์ž์—ด๋งŒ grepํ•œ๋‹ค

 

 

 

 

ps (process)

ํ”„๋กœ์„ธ์Šค์˜ ํ˜„์žฌ ์ƒํƒœ๋ฅผ ์ถœ๋ ฅํ•œ๋‹ค

 

๋ฐ˜์‘ํ˜•

๋Œ“๊ธ€