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

[Linux-์ƒํ™œ์ฝ”๋”ฉ] IO Redirection2 : input

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

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

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

 

cat์€ ํŒŒ์ผ์˜ ๋‚ด์šฉ์„ ์ฝ์–ด์˜ค๋Š” ๋ช…๋ น์–ด๋‹ค

 

๊ทธ๋ƒฅ ๋ช…๋ น์–ด cat ๋งŒ ์ž…๋ ฅํ•˜๋ฉด ์ž…๋ ฅํ•˜๋Š” ์ฆ‰์‹œ ๋ฐ”๋กœ ์ถœ๋ ฅ์ด ๋œ๋‹ค

 

 

 

head

์•ž์—์„œ๋ถ€ํ„ฐ 10ํ–‰๊นŒ์ง€๋งŒ ์ถœ๋ ฅํ•œ๋‹ค.

$ head -n1 linux.txt

linux.txt ํŒŒ์ผ์˜ 1์ค„๋งŒ ์ถœ๋ ฅํ•œ๋‹ค

 

 

$ head -n1 < linux.txt > one.txt

head -n1 < linux.txt์˜ ํ‘œ์ค€ ์ถœ๋ ฅ์„ one.txt์— ์ €์žฅํ•œ๋‹ค.

๋ฐ˜์‘ํ˜•

๋Œ“๊ธ€