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

์ „์ฒด ๊ธ€443

[Linux & VMware Workstation] Day 7 : ํŒŒ์ผ ์ •๋ ฌ ๋ช…๋ น์–ด(sort, diff, cmp)์™€ pipe ๋ช…๋ น์–ด์˜ ์—ฐ๊ณ„ 1. sort ๋ช…๋ น์–ด๋ฅผ ํ™œ์šฉํ•œ pipe ์‹ค์Šต -> sort ๋ช…๋ น์–ด์™€ pipe ๋ช…๋ น์–ด๋ฅผ ํ•จ๊ป˜ ์‚ฌ์šฉํ•˜์—ฌ ํŒŒ์ผ์˜ ์ •๋ ฌ ์ž‘์—…์„ ์‹คํ–‰ํ•˜์˜€๋‹ค. 2. cmp ๋ช…๋ น์–ด์™€ diff ๋ช…๋ น์–ด๋ฅผ ์‚ฌ์šฉํ•œ pipe ์‹ค์Šต -> pipe ๋ช…๋ น์–ด์™€ cmp ๋ช…๋ น์–ด๋ฅผ ๊ฒฐํ•ฉํ•˜์—ฌ file1 ๊ณผ example.txt ํŒŒ์ผ์˜ ๋น„๊ต ์ž‘์—…์„ ์‹ค์‹œํ•˜์˜€๊ณ , diff ๋ช…๋ น์–ด์™€ pipe ๋ช…๋ น์–ด๋ฅผ ํ•จ๊ป˜ ์‚ฌ์šฉํ•˜์—ฌ file 1๊ณผ example.txt ํŒŒ์ผ์ด ์–ด๋Š ๋ฐ”์ดํŠธ์—์„œ๋ถ€ํ„ฐ ์ฐจ์ด๊ฐ€ ๋ฐœ์ƒํ•˜๋Š”์ง€๋ฅผ ์•Œ์•„๋ณด์•˜๋‹ค. 2022. 5. 1.
[Linux & VMware Workstation] Day 6 : ํŒŒ์ผ ๋น„๊ต & ์ •๋ ฌ ๋ช…๋ น์–ด์™€ ์˜ต์…˜ 1. cmp : compare์˜ ์•ฝ์–ด๋กœ, ๋‘ ํŒŒ์ผ์˜ ๊ณตํ†ต๋œ ๋ถ€๋ถ„๊ณผ ๋‹ค๋ฅธ ๋ถ€๋ถ„์„ ํ™•์ธํ•˜๊ณ  ์‹ถ์„ ๋•Œ ์“ฐ๋Š” ๋ช…๋ น์–ด -> file1 ๊ณผ example.txt ํŒŒ์ผ์„ cmp ๋ช…๋ น์–ด๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ๋น„๊ตํ•ด ๋ณธ ๊ฒฐ๊ณผ 1๋ฒˆ์งธ ํ–‰์˜ 1๋ฐ”์ดํŠธ์งธ์˜ ๋ถ€๋ถ„๋ถ€ํ„ฐ ๋‹ค๋ฅธ ๋ถ€๋ถ„์ด ์žˆ๋‹ค๋Š” ๊ฒƒ์„ ํ™•์ธํ•  ์ˆ˜ ์žˆ์—ˆ๋‹ค. 2. diff : differences ์˜ ์•ฝ์–ด๋กœ, ๋‘ ํŒŒ์ผ ์‚ฌ์ด์˜ ๋‚ด์šฉ์„ ๋น„๊ตํ•˜๋Š” ๋ช…๋ น์–ด -> diff ๋ช…๋ น์–ด๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ๋‘ ํŒŒ์ผ์„ ๋น„๊ตํ•ด ๋ณธ ๊ฒฐ๊ณผ, cmp ๋ช…๋ น์–ด์— ๋น„ํ•ด ๋‹ค๋ฅธ ๋ถ€๋ถ„์„ ํŽผ์ณ ๋ณด์—ฌ์คŒ์œผ๋กœ์จ ๋น„๊ต ๋‚ด์šฉ์„ ๋” ๋ช…ํ™•ํ•˜๊ณ  ์ง๊ด€์ ์œผ๋กœ ์ฐพ์•„์ค€๋‹ค๋Š” ๊ฒƒ์„ ํ™•์ธํ•  ์ˆ˜ ์žˆ์—ˆ๋‹ค. 3. sort : ํ…์ŠคํŠธ๋กœ ๋œ ํŒŒ์ผ์˜ ํ–‰๋‹จ์œ„ ์ •๋ ฌ์„ ํ•  ๋•Œ ์‚ฌ์šฉํ•˜๋Š” ๋ช…๋ น์–ด -> ํŠน์ • DB๋‚˜ ํ”„๋กœ๊ทธ๋žจ, ์‰˜ ํ”„๋กœ๊ทธ๋žจ๋“ฑ์˜ ์ž…๋ ฅ๊ฐ’์œผ๋กœ ์‚ฌ์šฉ๋˜๋Š” ๋ฐ์ดํ„ฐ๋ฅผ ์ง์ ‘ ์ •๋ ฌํ•˜.. 2022. 5. 1.
[Linux & VMware Workstation] Day 5 : ํŒŒ์ผ ์ƒ์„ฑ & ํ•˜๋“œ ๋งํฌ์™€ ์‹ฌ๋ณผ๋ฆญ ๋งํฌ 1. ๋ฃจํŠธ ๋””๋ ‰ํ† ๋ฆฌ, /home ๋””๋ ‰ํ† ๋ฆฌ, ์‚ฌ์šฉ์ž ํ™ˆ ๋””๋ ‰ํ† ๋ฆฌ(~)์˜ ํŒŒ์ผ ์‹œ์Šคํ…œ ๊ตฌ์กฐ ๊ธฐ๋ก์œผ๋กœ ์‹œ์ž‘ํ•˜๊ณ , ์‚ฌ์šฉ์ž ํ™ˆ ๋””๋ ‰ํ† ๋ฆฌ์— 'swing30' ๋ฌธ์ž์—ด์„ ์ €์žฅํ•œ swing.txt ํŒŒ์ผ ๋งŒ๋“ค๊ธฐ -> cd๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ๋ฃจํŠธ ๋””๋ ‰ํ† ๋ฆฌ๋กœ ์ด๋™ํ•˜์˜€๊ณ , cd /home์„ ์ด์š”ํ•˜์—ฌ /home ๋””๋ ‰ํ† ๋ฆฌ๋กœ ์ด๋™ํ•˜์˜€๋‹ค. ์•„๋ž˜์™€ ๊ฐ™์€ ๊ณผ์ •์„ ๊ฑฐ์ณ ์‚ฌ์šฉ์ž ํ™ˆ ๋””๋ ‰ํ† ๋ฆฌ(~)์˜ ํŒŒ์ผ ์‹œ์Šคํ…œ ๊ตฌ์กฐ ๊ธฐ๋ก์—์„œ ์‹œ์ž‘ํ•  ์ˆ˜ ์žˆ๋„๋ก ์œ„์น˜๋ฅผ ์žก์•˜๋‹ค. ๊ทธ ์ดํ›„์—๋Š” ์‚ฌ์šฉ์ž ํ™ˆ ๋””๋ ‰ํ† ๋ฆฌ์— touch ๋ช…๋ น์–ด๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ swing.txt ํŒŒ์ผ์„ ์ƒ์„ฑํ•˜์˜€๊ณ , ๊ทธ ํŒŒ์ผ ์•ˆ์— echo ๋ช…๋ น์–ด์™€ >> ๊ธฐํ˜ธ๋ฅผ ํ†ตํ•ด swing.txt ํŒŒ์ผ ์•ˆ์— "swing30"์ด๋ผ๋Š” ๋ฌธ์ž์—ด์„ ์ €์žฅํ•  ์ˆ˜ ์žˆ์—ˆ๋‹ค. 2. ์‚ฌ์šฉ์ž ํ™ˆ ๋””๋ ‰ํ† ๋ฆฌ์— practice ๋””๋ ‰ํ† ๋ฆฌ๋ฅผ ์ƒ์„ฑํ•˜๊ธฐ -.. 2022. 5. 1.
[Linux & VMware Workstation] Day 4 : ํŒŒ์ผ ๋ช…๋ น์–ด์™€ ์ ‘๊ทผ ๊ถŒํ•œ ๋ฐ ๊ทธ๋ฃน ๊ด€๋ฆฌ ๋ช…๋ น์–ด A. ํŒŒ์ผ ์‚ฌ์šฉ ๋ช…๋ น์–ด 1. cat ๋ช…๋ น์–ด : ์ด๋ฏธ ์กด์žฌํ•˜๋Š” ํŒŒ์ผ์˜ ์ •๋ณด๋ฅผ ๋ถˆ๋Ÿฌ์˜ค๋Š” ๋ฐ ์“ฐ๋Š” ๋ช…๋ น์–ด์ด๋‹ค. * cat [ ์˜ต์…˜ ] ํŒŒ์ผ๋ช… -> ์˜†๊ณผ ๊ฐ™์€ ํ˜•ํƒœ๋ฅผ ์ทจํ•˜๋Š”๋ฐ, ์ด๋•Œ '์˜ต์…˜'์— ์œ ์˜ํ•ด์•ผ ํ•œ๋‹ค. ๋งŒ๋“  ํŒŒ์ผ์˜ ์˜ต์…˜๊ณผ ๋ช…๋ น์–ด ๋’ค ์˜ต ์…˜์ด ๋‹ค๋ฅด๋ฉด ํŒŒ์ผ๋ช…์ด ๋งž๋”๋ผ๋„ ํŒŒ์ผ์„ ๋ถˆ๋Ÿฌ์˜ฌ ์ˆ˜ ์—†๊ธฐ ๋•Œ๋ฌธ * ๋‹น์—ฐํžˆ ํŒŒ์ผ์„ ๋ถˆ๋Ÿฌ์˜ค๊ธฐ ์ „ ์ด๋ฏธ ์กด์žฌํ•˜๋Š” ํŒŒ์ผ์„ ๋ถˆ๋Ÿฌ์™€์•ผ ํ•œ๋‹ค. ์žˆ์ง€๋„ ์•Š์€ ํŒŒ์ผ์ด๋‚˜ ๋””๋ ‰ํ† ๋ฆฌ๋ฅผ ๋ถˆ๋Ÿฌ์˜ค๊ฒ ๋‹ค๊ณ  ๋ช…๋ น์–ด๋ฅผ ์“ฐ๋ฉด ์•„๋ž˜์ฒ˜๋Ÿผ ๊ทธ๋Ÿฐ๊ฑฐ ์—†๋‹ค๋ฉฐ ์—๋Ÿฌ๊ฐ€ ๋‚œ๋‹ค.... * ๋„์–ด์“ฐ๊ธฐ๋ž‘ '/' ์—๋„ ์œ ์˜ํ•˜์ž. /๋ฅผ ๋นผ๋จน์œผ๋ฉด ํŒŒ์ผ์ด๋‚˜ ๋””๋ ‰ํ† ๋ฆฌ๋ฅผ ๋ถˆ๋Ÿฌ์˜ฌ ๋•Œ ์—๋Ÿฌ๊ฐ€ ๋‚œ๋‹ค. # ์ œ๋Œ€๋กœ ๋œ ํ˜•์‹์„ ๊ฐ–์ถ”์–ด์„œ cat ๋ช…๋ น์–ด๋ฅผ ์“ฐ๋ฉด ์•„๋ž˜์™€ ๊ฐ™์€ ๊ฒฐ๊ณผ๊ฐ€ ๋‚˜์˜จ๋‹ค. ๋ฐฑ์—…์€ ์–ธ์ œ ํ–ˆ๋Š”์ง€๋‚˜ ๋ฆฌ์ŠคํŠธ๋ฅผ ๋ˆ„๊ฐ€ ๋งค๋‹ˆ์ง€ํ•˜๋Š”์ง€, ์ ‘์†ํ•œ user ์˜ .. 2022. 4. 16.
[C ์–ธ์–ด] ์ฃผ์„ ์ฒ˜๋ฆฌ์™€ ์ด์Šค์ผ€์ดํ”„ ์‹œํ€€์Šค & ๋ณ€ํ™˜ ๋ฌธ์ž & ๋ณ€์ˆ˜์™€ ๋ณ€์ˆ˜๋ช… ์ž‘์„ฑ ์‹œ ์ฃผ์˜์‚ฌํ•ญ 1. ์˜ค๋Š˜์˜ ์ฒซ ์ฃผ์ œ๋Š” '์ฃผ์„'! ํ˜•ํƒœ 1 = // -> ์ฃผ๋กœ ํ•œ์ค„ ์ฃผ์„์—์„œ ์‚ฌ์šฉํ•˜๋Š” ํ˜•์‹์ž„ ํ˜•ํƒœ 2 = /**/ -> ์—ฌ๋Ÿฌ ์ค„ ์ฃผ์„์—์„œ ์‚ฌ์šฉ 2. ๋‘ ๋ฒˆ์งธ ์ฃผ์ œ '์ด์Šค์ผ€์ดํ”„ ์‹œํ€€์Šค'! *์ค„๋ฐ”๊ฟˆ = \n (\ : ๋ฌธ์„œ์—๋Š” ์—ญ์Šฌ๋ž˜์‹œ๋กœ ๋‚˜์™€ ์žˆ์–ด์„œ ๋”ฐ๋กœ ํƒ€์ž๋ฅผ ๊ธฐ์–ตํ•ด ๋†“์•„์•ผ ํ•จ) *๊ฒฝ๊ณ  = \a *๋ฐฑ์ŠคํŽ˜์ด์Šค = \b *ํƒญ = \t *๋ฐฑ์Šฌ๋ž˜์‹œ = \\ *์ž‘์€๋”ฐ์˜ดํ‘œ = \' *ํฐ๋”ฐ์˜ดํ‘œ = \" 3. ๋˜ ๋‚˜์˜จ ๋ณ€ํ™˜ ๋ฌธ์ž! %d -> ์ •์ˆ˜ %f -> ์‹ค์ˆ˜, ๋ถ€๋™์†Œ์ˆ˜์ ์ˆ˜ ( 9.0๊ฐ™์€ ๊ฑด ์ •์ˆ˜ ์•„๋‹ˆ๊ณ  ๋ถ€๋™์†Œ์ˆ˜์ ์ˆ˜๋กœ ๋ณธ๋‹ค. ) %c -> ๋ฌธ์ž %s -> ๋ฌธ์ž์—ด %f -> ์†Œ์ˆ˜์  ์•„๋ž˜ ์—ฌ์„ฏ์ž๋ฆฌ๊นŒ์ง€ ์ถœ๋ ฅ(๊ธฐ๋ณธ) ex. 3.462222 %.3f -> ์†Œ์ˆ˜์  ์•„๋ž˜ ์„ธ์ž๋ฆฌ๊นŒ์ง€ ์ถœ๋ ฅ ex. 7.777 %.1f -> ์†Œ์ˆ˜์  ์•„๋ž˜ .. 2022. 4. 12.
[C ์–ธ์–ด] ์ฝ”๋“œ ๊ตฌ์กฐ์™€ ๋ฌธ์ž, ๋ฌธ์ž์—ด ์ถœ๋ ฅ & ์ž๋ฃŒํ˜• ์ถœ๋ ฅ #include main() { ์ฝ”๋“œ ์ƒ์„ธ return 0; } # ๋ฌธ์ž๋Š” ๋ฐ˜๋“œ์‹œ ์ž‘์€๋”ฐ์˜ดํ‘œ๋กœ(''), ๋ฌธ์ž์—ด์€ ๋ฐ˜๋“œ์‹œ ํฐ๋”ฐ์˜ดํ‘œ๋กœ("")๋กœ ๋‘˜๋Ÿฌ์‹ธ์ฃผ์ž ex) R ์‹ค์ˆ˜๋กœ ์ถœ๋ ฅ, printf("%f", 3.14); %c -> ๋ฌธ์ž๋กœ ์ถœ๋ ฅ, printf("%c", 'p'); %s -> ๋ฌธ์ž์—ด๋กœ ์ถœ๋ ฅ, printf("%s", "๊ณผ์ œ"); 2022. 4. 3.