๋ฐ˜์‘ํ˜•

Development knowledge/Linux 5

[Linux] systemctl ๋ช…๋ น์–ด ์‚ฌ์šฉ ๋ฐฉ๋ฒ• & ํ”„๋กœ์„ธ์Šค ์ƒํƒœ ํ™•์ธ

Intro์•ˆ๋…•ํ•˜์„ธ์š”. ์ €๋Š” AWS EC2 ์ธ์Šคํ„ด์Šค์— ์„ค์น˜๋œ ๋ฆฌ๋ˆ…์Šค์˜ ์„œ๋น„์Šค ์ƒํƒœ๋ฅผ ํ™•์ธํ•ด์•ผ ํ–ˆ๋Š”๋ฐ์š”, ์ด๋ฒˆ ์‹œ๊ฐ„์—๋Š” systemctl ๋ช…๋ น์–ด ์‚ฌ์šฉ ๋ฐฉ๋ฒ• ๊ทธ๋ฆฌ๊ณ  ํ”„๋กœ์„ธ์Šค ์ƒํƒœ ํ™•์ธ๋ฒ•์— ๋Œ€ํ•ด ์•Œ์•„๋ณด๊ฒ ์Šต๋‹ˆ๋‹ค. Systemctl?systemctl๋Š” ๋ฆฌ๋ˆ…์Šค ์‹œ์Šคํ…œ์—์„œ systemd ์‹œ์Šคํ…œ ๋ฐ ์„œ๋น„์Šค ๊ด€๋ฆฌ์ž๋ฅผ ์ œ์–ดํ•˜๊ณ  ๊ด€๋ฆฌํ•˜๊ธฐ ์œ„ํ•œ ๋ช…๋ น์–ด์ž…๋‹ˆ๋‹ค. systemd๋Š” ๋ฆฌ๋ˆ…์Šค์˜ ์ดˆ๊ธฐํ™” ์‹œ์Šคํ…œ์œผ๋กœ ๋ถ€ํŒ… ํ”„๋กœ์„ธ์Šค๋ฅผ ๊ด€๋ฆฌํ•˜๊ณ , ์‹œ์Šคํ…œ ์„œ๋น„์Šค ์‹œ์ž‘ ๋ฐ ์ค‘์ง€ ์ƒํƒœ ์กฐํšŒ ๋“ฑ์˜ ์ž‘์—…์„ ์ˆ˜ํ–‰ํ•ฉ๋‹ˆ๋‹ค.How to command#1 ์„œ๋น„์Šค(ํ”„๋กœ์„ธ์Šค) ์‹œ์ž‘ ๋ฐ ์ค‘์ง€systemctl start [์„œ๋น„์Šค๋ช…]: ํŠน์ • ์„œ๋น„์Šค๋ฅผ ์‹œ์ž‘ํ•ฉ๋‹ˆ๋‹ค.systemctl stop [์„œ๋น„์Šค๋ช…]: ํŠน์ • ์„œ๋น„์Šค๋ฅผ ์ค‘์ง€ํ•ฉ๋‹ˆ๋‹ค.systemctl restart [์„œ๋น„์Šค๋ช…]: ..

[Linux] ๋ฆฌ๋ˆ…์Šค tail ๋ช…๋ น์–ด ์‚ฌ์šฉ๋ฒ• (์‹ค์‹œ๊ฐ„ ๋กœ๊ทธ ๋ณด๋Š” ๋ฐฉ๋ฒ•)

Intro ์•ˆ๋…•ํ•˜์„ธ์š”. ์ด๋ฒˆ ์‹œ๊ฐ„์—๋Š” ๋ฆฌ๋ˆ…์Šค tail ๋ช…๋ น์–ด ์‚ฌ์šฉ๋ฒ•์— ๋Œ€ํ•ด ์•Œ์•„๋ณด๋„๋ก ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค :)  How to use๋‹ค์Œ์€ ํ…Œ์ŠคํŠธ์šฉ json ํŒŒ์ผ์ž…๋‹ˆ๋‹ค. {    "quiz": {        "sport": {            "q1": {                "question": "Which one is correct team name in NBA?",                "options": [                    "New York Bulls",                    "Los Angeles Kings",                    "Golden State Warriros",                    "Huston Rocket"     ..

[Linux] .zshrc ๋ณ€๊ฒฝ ํ›„ ๋ณ€๊ฒฝ์‚ฌํ•ญ ๋ฐ”๋กœ ์ €์žฅํ•˜๋Š” ๋ฐฉ๋ฒ•

Intro ์•ˆ๋…•ํ•˜์„ธ์š”. zsh์˜ .zshrc ๋ณ€๊ฒฝ ํ›„ ๋ฐ”๋กœ ์ ์šฉํ•˜๋Š” ๋ฐฉ๋ฒ•์— ๋Œ€ํ•ด ์•Œ์•„๋ณด๋„๋ก ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค. How to apply๋ณดํ†ต ์•„๋ž˜์˜ ๋ช…๋ น์–ด vi/vim ์„ ํ†ตํ•ด ํŒŒ์ผ์„ ์ˆ˜์ •ํ•ฉ๋‹ˆ๋‹ค. ์ˆ˜์ •ํ›„ wq ๋ช…๋ น์–ด๋ฅผ ํ†ตํ•ด ์ €์žฅํ•ด์ค๋‹ˆ๋‹ค. ํ•˜์ง€๋งŒ ์ด๋•Œ ๋ณ€๊ฒฝ์‚ฌํ•ญ์ด ๋ฐ”๋กœ ์ €์žฅ๋˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค. โžœ ~ vi .zshrc  source ํ‚ค์›Œ๋“œ๋ฅผ ํ†ตํ•ด ํ•ด๋‹น ํŒŒ์ผ์„ ํ•œ๋ฒˆ ๋” ์ž…๋ ฅํ•ด์ค˜์•ผ ๋ณ€๊ฒฝ์‚ฌํ•ญ์ด ๋ฐ”๋กœ ์ €์žฅ๋˜์–ด ์ ์šฉ๋ฉ๋‹ˆ๋‹ค :)โžœ ~ source ~/.zshrc

[Linux] ๋ฆฌ๋ˆ…์Šค Yum์ด๋ž€? Yum ์˜๋ฏธ์™€ Yum ์‚ฌ์šฉ๋ฒ•

Intro ์•ˆ๋…•ํ•˜์„ธ์š”. ์ด๋ฒˆ ์‹œ๊ฐ„์—๋Š” ๋ฆฌ๋ˆ…์Šค yum ์ด ๋ฌด์—‡์ด๊ณ , yum ์‚ฌ์šฉ๋ฒ•์— ๋Œ€ํ•ด ์•Œ์•„๋ณด๋„๋ก ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค. What is Yum (Yellodog Update Modified) ? yum์ด๋ž€ ๋ฆฌ๋ˆ…์Šค ํŒจํ‚ค์ง€ ์„ค์น˜ ๊ด€๋ฆฌ ๋„๊ตฌ์ž…๋‹ˆ๋‹ค. yum์€ rpm์˜ ํŒจํ‚ค์ง€ ์˜์กด์„ฑ ๋ฌธ์ œ๋ฅผ ๋ณด์™„ํ•œ ํŒจํ‚ค์ง€ ๊ด€๋ฆฌ ํˆด์ž…๋‹ˆ๋‹ค. Usage of yum ํŒจํ‚ค์ง€ ์„ค์น˜ yum install ํŒจํ‚ค์ง€๋ช… ํŒจํ‚ค์ง€ ์‚ญ์ œ yum remove ํŒจํ‚ค์ง€๋ช… ํŒจํ‚ค์ง€ ์—…๋ฐ์ดํŠธ yum update ํŒจํ‚ค์ง€๋ช… ํŒจํ‚ค์ง€ ์ •๋ณด ํ™•์ธ yum info ํŒจํ‚ค์ง€๋ช… ํŒจํ‚ค์ง€ ๋ชฉ๋ก ํ™•์ธ yum list ์„ค์น˜๋œ ํŒจํ‚ค์ง€ ๋ฆฌ์ŠคํŠธ ํ™•์ธ yum list installed ์ด์ƒ Yum ์ด ๋ฌด์—‡์ด๊ณ , Yum ์˜ ์‚ฌ์šฉ๋ฒ•์— ๋Œ€ํ•œ ์„ค๋ช…์ด์˜€์Šต๋‹ˆ๋‹ค.

[Linux] top ๋ช…๋ น์–ด ์ •๋ฆฌ ๋ฐ ์„ค๋ช…

Intro ์•ˆ๋…•ํ•˜์„ธ์š”. ๋ฆฌ๋ˆ…์Šค์˜ top ๋ช…๋ น์–ด์— ๋Œ€ํ•ด ์•Œ์•„๋ณด๋„๋ก ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค. top ๋ช…๋ น์–ด๋ž€? top ๋ช…๋ น์–ด๋Š” Linux์—์„œ ์‹คํ–‰ ์ค‘์ธ ํ”„๋กœ์„ธ์Šค์˜ ์‹ค์‹œ๊ฐ„์„ ํ‘œ์‹œํ•˜๊ณ  ์ปค๋„ ๊ด€๋ฆฌ ์ž‘์—…์„ ํ‘œ์‹œํ•ฉ๋‹ˆ๋‹ค. ์ด ๋ช…๋ น์–ด๋Š” CPU ๋ฐ ๋ฉ”๋ชจ๋ฆฌ ์‚ฌ์šฉ๋Ÿ‰์„ ํฌํ•จํ•œ ๋ฆฌ์†Œ์Šค ์‚ฌ์šฉ๋Ÿ‰์„ ๋ณด์—ฌ์ฃผ๋Š” ์‹œ์Šคํ…œ ์ •๋ณด ์š”์•ฝ์„ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค. top ๋ช…๋ น ๊ตฌ๋ฌธ ๋ฐ ์˜ต์…˜ top -hv | -bcEeHiOSs1 -d secs -n max -u | U user -p pid(s) -o field -w [cols] -h Help ๋ช…๋ น ๋„์›€๋ง ํŒŒ์ผ์„ ํ‘œ์‹œํ•ฉ๋‹ˆ๋‹ค. -v Version ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ ๋ฒ„์ „ ๋ฐ ์‚ฌ์šฉ ํ”„๋กฌํฌํŠธ๋ฅผ ํ‘œ์‹œํ•ฉ๋‹ˆ๋‹ค. -b Batch mode Starts top in batch mode, allowing to send the command's out..

๋ฐ˜์‘ํ˜•