Notice
Recent Posts
Recent Comments
ยซ   2024/12   ยป
์ผ ์›” ํ™” ์ˆ˜ ๋ชฉ ๊ธˆ ํ† 
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31
Archives
Today
In Total
๊ด€๋ฆฌ ๋ฉ”๋‰ด

A Joyful AI Research Journey๐ŸŒณ๐Ÿ˜Š

[43~44] 230228, 230302 ๋ฆฌ๋ˆ…์Šค Ch. 2 ๋ผ์ฆˆ๋ฒ ๋ฆฌ ํŒŒ์ด๋ฅผ ์œ„ํ•œ ๋ฆฌ๋ˆ…์Šค ๊ธฐ์ดˆ ๋ฐฐ์šฐ๊ธฐ: 1. ์šด์˜ ์ฒด์ œ, 2. ์›๊ฒฉ ์ ‘์†์„ ์œ„ํ•œ VNC์™€ Putty, 3. ๋ฆฌ๋ˆ…์Šค ํŒŒ์ผ ์‹œ์Šคํ…œ, 4. ๋ฆฌ๋ˆ…์Šค ๋ช…๋ น์–ด [K-๋””์ง€ํ„ธ ํŠธ๋ ˆ์ด๋‹ 43~44์ผ] ๋ณธ๋ฌธ

๐ŸŒณBootcamp Revision 2023โœจ/Raspberry Pi, Linux, Electronics Basics

[43~44] 230228, 230302 ๋ฆฌ๋ˆ…์Šค Ch. 2 ๋ผ์ฆˆ๋ฒ ๋ฆฌ ํŒŒ์ด๋ฅผ ์œ„ํ•œ ๋ฆฌ๋ˆ…์Šค ๊ธฐ์ดˆ ๋ฐฐ์šฐ๊ธฐ: 1. ์šด์˜ ์ฒด์ œ, 2. ์›๊ฒฉ ์ ‘์†์„ ์œ„ํ•œ VNC์™€ Putty, 3. ๋ฆฌ๋ˆ…์Šค ํŒŒ์ผ ์‹œ์Šคํ…œ, 4. ๋ฆฌ๋ˆ…์Šค ๋ช…๋ น์–ด [K-๋””์ง€ํ„ธ ํŠธ๋ ˆ์ด๋‹ 43~44์ผ]

yjyuwisely 2023. 2. 28. 15:38

230228 Tue 43rd class
230302 Thu 44th class

Ch. 1 ๋ผ์ฆˆ๋ฒ ๋ฆฌ ํŒŒ์ด ์‹œ์ž‘ํ•˜๊ธฐ  (์ฃผ์ œ๋ณ„๋กœ ๋ฌถ๊ธฐ ์œ„ํ•ด ์•„๋žซ๊ธ€๋กœ ๊ธ€ ๋‚ด์šฉ ์˜ฎ๊น€.) 
Ch. 2 ๋ผ์ฆˆ๋ฒ ๋ฆฌ ํŒŒ์ด๋ฅผ ์œ„ํ•œ ๋ฆฌ๋ˆ…์Šค ๊ธฐ์ดˆ ๋ฐฐ์šฐ๊ธฐ
์ง„๋„: p. 28 ~ (๊ต์žฌ: IoT ์‚ฌ๋ฌผ์ธํ„ฐ๋„ท์„ ์œ„ํ•œ ๋ผ์ฆˆ๋ฒ ๋ฆฌํŒŒ์ด 4 ์ •์„, ์ €์ž: ์ตœ์ฃผํ˜ธ , ๊น€์žฌ๋ฒ” , ์ •๋™์ง„)
์ง„๋„: p. 62 ~ (๊ต์žฌ: IoT ์‚ฌ๋ฌผ์ธํ„ฐ๋„ท์„ ์œ„ํ•œ ๋ผ์ฆˆ๋ฒ ๋ฆฌํŒŒ์ด 4 ์ •์„, ์ €์ž: ์ตœ์ฃผํ˜ธ , ๊น€์žฌ๋ฒ” , ์ •๋™์ง„)
๊ต์žฌ ์ฝ”๋“œ ๊นƒํ—ˆ๋ธŒ: https://github.com/codingspecialist/RaspberryPi4-Book-Example
๊ต์žฌ ์†Œ์Šค ๋ฐ PPT: http://jspstudy.co.kr/main/main.jsp
์ €์ž ์นดํŽ˜: https://cafe.naver.com/metacoding

 

IoT ์‚ฌ๋ฌผ์ธํ„ฐ๋„ท์„ ์œ„ํ•œ ๋ผ์ฆˆ๋ฒ ๋ฆฌํŒŒ์ด 4 ์ •์„ | ์ตœ์ฃผํ˜ธ - ๊ต๋ณด๋ฌธ๊ณ 

IoT ์‚ฌ๋ฌผ์ธํ„ฐ๋„ท์„ ์œ„ํ•œ ๋ผ์ฆˆ๋ฒ ๋ฆฌํŒŒ์ด 4 ์ •์„ | ใ€ŽIoT ์‚ฌ๋ฌผ์ธํ„ฐ๋„ท์„ ์œ„ํ•œ ๋ผ์ฆˆ๋ฒ ๋ฆฌํŒŒ์ด 4 ์ •์„ใ€์€ ์™•์ดˆ๋ณด๋„ ๋ผ์ฆˆ๋ฒ ๋ฆฌํŒŒ์ด๋ฅผ ์ด์šฉํ•ด ๋‹ค์–‘ํ•œ IoT๋ฅผ ์ง์ ‘ ๊ฐœ๋ฐœํ•  ์ˆ˜ ์žˆ๋„๋ก ์ „๊ธฐ์ „์ž ๊ธฐ์ดˆ ์›๋ฆฌ๋ถ€ํ„ฐ ์„ผ

product.kyobobook.co.kr

์˜ค๋Š˜ ๋ฐฐ์šด ๊ฒƒ ์ค‘ ๊ธฐ์–ตํ•  ๊ฒƒ์„ ์ •๋ฆฌํ–ˆ๋‹ค.

4.3 ๋ฆฌ๋ˆ…์Šค ๋ช…๋ น์–ด ๋””๋ ‰ํ„ฐ๋ฆฌ ๊ด€๋ จ ๋ช…๋ น์–ด ์š”์•ฝ

๋ช…๋ น์–ด ์„ค๋ช…
ls (list segments)  ํŒŒ์ผ ๋ฐ ๋””๋ ‰ํ„ฐ๋ฆฌ ๋ฆฌ์ŠคํŠธ
ls -a ๋ชจ๋“  ํŒŒ์ผ๊ณผ ๋””๋ ‰ํ„ฐ๋ฆฌ ๋ฆฌ์ŠคํŠธ
ls -asl ๋ชจ๋“  ํŒŒ์ผ ์ž์„ธํžˆ ๋ฆฌ์ŠคํŠธ
mkdir (make directory) (make directory) ๋””๋ ‰ํ„ฐ๋ฆฌ ๋งŒ๋“ค๊ธฐ
cd ๋””๋ ‰ํ„ฐ๋ฆฌ (change directory) (change directory) ๋””๋ ‰ํ„ฐ๋ฆฌ ์ด๋™
cd ํ™ˆ ๋””๋ ‰ํ„ฐ๋ฆฌ๋กœ ์ด๋™
cd ~ ํ™ˆ ๋””๋ ‰ํ„ฐ๋ฆฌ๋กœ ์ด๋™
cd .. ์ƒ์œ„ ๋””๋ ‰ํ„ฐ๋ฆฌ๋กœ ์ด๋™
pwd (print making directory) ํ˜„์žฌ ๋””๋ ‰ํ„ฐ๋ฆฌ ํ™•์ธ

์ฐธ๊ณ 

 

Ch. 2 ๋ผ์ฆˆ๋ฒ ๋ฆฌ ํŒŒ์ด๋ฅผ ์œ„ํ•œ ๋ฆฌ๋ˆ…์Šค ๊ธฐ์ดˆ ๋ฐฐ์šฐ๊ธฐ

์ฑ…์˜ ๋ชฉ์ฐจ
01 _ ์šด์˜ ์ฒด์ œ

01-1 ์šด์˜์ฒด์ œ๋ž€?
01-2 ๋ฆฌ๋ˆ…์Šค ์šด์˜์ฒด์ œ์˜ ์ข…๋ฅ˜
01-3 ๋ผ์ฆˆ๋น„์•ˆ ์šด์˜์ฒด์ œ
02 _ ์›๊ฒฉ ์ ‘์†์„ ์œ„ํ•œ VNC์™€ Putty
02-1 ๊ทธ๋ž˜ํ”ฝ ๋ชจ๋“œ ์ ‘์†
02-2 ํ„ฐ๋ฏธ๋„ ๋ชจ๋“œ ์ ‘์†
03 _ ๋ฆฌ๋ˆ…์Šค ํŒŒ์ผ ์‹œ์Šคํ…œ
03-1 ๋ฆฌ๋ˆ…์Šค ํŒŒ์ผ ์‹œ์Šคํ…œ์˜ ํŠน์ง•
03-2 ๋ฆฌ๋ˆ…์Šค ๋””๋ ‰ํ„ฐ๋ฆฌ ๊ตฌ์กฐ
04 _ ๋ฆฌ๋ˆ…์Šค ๋ช…๋ น์–ด
04-1 ์‰˜(Shell)
04-2 ๊ธฐ๋ณธ ๋ช…๋ น์–ด
04-3 ํŒŒ์ผ ๋ฐ ๋””๋ ‰ํ„ฐ๋ฆฌ
04-4 ํŒŒ์ผ ์ด๋™, ์‚ญ์ œ, ๋ณต์‚ฌ ๋ช…๋ น์–ด
04-5 ํŒŒ์ผ ์ฐพ๊ธฐ ๋ช…๋ น์–ด
04-6 ๊ถŒํ•œ
04-7 ์ž…์ถœ๋ ฅ ์žฌ์ง€์ • IO Redirection
04-8 wget, apt-ge

1. ์šด์˜์ฒด์ œ(OS: Operating System)

1.1 ์šด์˜์ฒด์ œ๋ž€?

์šด์˜์ฒด์ œ๋Š” ์‹œ์Šคํ…œ ํ•˜๋“œ์›จ์–ด๋ฅผ ๊ด€๋ฆฌํ•˜๊ณ  ์‘์šฉ์†Œํ”„ํŠธ์›จ์–ด๋ฅผ ์‹คํ–‰ํ•˜๊ธฐ ์œ„ํ•˜์—ฌ ํ•˜๋“œ์›จ์–ด ์ถ”์ƒํ™” ํ”Œ๋žซํผ์„ ์ œ๊ณตํ•˜๋Š” ์‹œ์Šคํ…œ ์†Œํ”„ํŠธ์›จ์–ด์ด๋‹ค.

ex) ์ž๋™์ฐจ ์—”์ง€๋‹ˆ์–ด๋“ค์ด ์ผ๋ฐ˜ ์‚ฌ์šฉ์ž๋“ค์—๊ฒŒ ์ž๋™์ฐจ๋ฅผ ์‰ฝ๊ฒŒ ์ด์šฉํ•  ์ˆ˜ ์žˆ๊ฒŒ ํ•˜๋ ค๊ณ  ๋งŒ๋“ค์–ด ๋†“์€ ์—‘์…€, ๋ธŒ๋ ˆ์ดํฌ, ๊ธฐ์–ด๋“ค์„ ์ธํ„ฐํŽ˜์ด์Šค๋ผ๊ณ  ๋ถ€๋ฅธ๋‹ค.

์ผ๋ฐ˜ ์‚ฌ์šฉ์ž๋“ค์€ ์ปดํ“จํ„ฐ ์—”์ง€๋‹ˆ์–ด๋“ค์ฒ˜๋Ÿผ ์–ด๋–ป๊ฒŒ ์‚ฌ์šฉํ•˜๋Š”์ง€ ์•Œ ์ˆ˜ ์—†๊ธฐ ๋•Œ๋ฌธ์— ์ผ๋ฐ˜ ์‚ฌ์šฉ์ž์™€ ์ปดํ“จํ„ฐ ํ•˜๋“œ์›จ์–ด์˜ ์ค‘๊ฐ„ ์—ญํ• ์„ ํ•ด์ฃผ๋Š” ๋ฌด์—‡์ธ๊ฐ€๊ฐ€ ํ•„์š”ํ•˜๊ฒŒ ๋˜์—ˆ๊ณ , ๊ทธ ์—ญํ• ์„ ๋ฐ”๋กœ ์šด์˜์ฒด์ œ(Operating System)๊ฐ€ ๋งก๊ณ  ์žˆ๋‹ค.

- windows
- macOS
- Linux


1.2 ๋ฆฌ๋ˆ…์Šค ์šด์˜์ฒด์ œ์˜ ์ข…๋ฅ˜

๋ฆฌ๋ˆ…์Šค์˜ ํŠน์ง•: GNU ์ •์‹ (์ž์œ  ์†Œํ”„ํŠธ์›จ์–ด ์ •์‹ )์„ ์ค€์ˆ˜ํ•˜๊ธฐ ๋•Œ๋ฌธ์— ๋Œ€๋ถ€๋ถ„ ๋ฌด๋ฃŒ์ด๊ณ  ์†Œ์Šค์ฝ”๋“œ์˜ ์ž์œ ๋ฐฐํฌ๊ฐ€ ๊ฐ€๋Šฅํ•˜๊ธฐ ๋•Œ๋ฌธ์— ์ด๋ฅผ ํ† ๋Œ€๋กœ ์ˆ˜๋งŽ์€ ๋ฆฌ๋ˆ…์Šค ๋ฐฐํฌํŒ์ด ์ƒ๊ธฐ๊ฒŒ ๋˜์—ˆ๋‹ค.

GNU is an operating system that GNU's not Unix. GNU stands for Gnu's Not Unix.


2. ์›๊ฒฉ ์ ‘์†์„ ์œ„ํ•œ VNC(Virtual Network Computing)์™€ Putty

2.1 ๊ทธ๋ž˜ํ”ฝ ๋ชจ๋“œ ์ ‘์†

๋ชจ๋‹ˆํ„ฐ ์—†์ด ์‚ฌ์šฉํ•˜๊ธฐ ์œ„ํ•ด VNC ๋ทฐ์–ด ๋‹ค์šด ๋ฐ›๋Š”๋‹ค.
https://www.realvnc.com/en/connect/download/viewer/

ifconfig ์จ์„œ ip ์ฃผ์†Œ ํ™•์ธํ•œ๋‹ค. 

์›๊ฒฉ ์—ฐ๊ฒฐ ๋œ๋‹ค.

Virtual Network Computing (VNC) is a free tool that allows a client to connect to a server, and interact with the desktop of the remote machine.

2.2 ํ„ฐ๋ฏธ๋„ ๋ชจ๋“œ ์ ‘์†

Putty ๋‹ค์šด ๋ฐ›์•„์„œ ip ์ฃผ์†Œ ์ž…๋ ฅํ•˜๊ณ  ์‹คํ–‰ํ•œ๋‹ค. 
PuTTY is a free and open-source terminal emulator, serial console and network file transfer application.

์•ž ๋‹จ์›์˜ ์—๋””ํ„ฐ (ํŒŒ์ด์ฌ ํŒŒ์ผ) ์ด์šฉ ์—†์ด ๋ฐ”๋กœ ์‚ฌ์šฉํ•˜๊ธฐ ์œ„ํ•ด putty๊ฐ€ ํ•„์š”ํ•˜๋‹ค.

์ด์ œ๋Š” ๋ผ์ฆˆ๋ฒ ๋ฆฌ ํŒŒ์ด์— ๋ชจ๋‹ˆํ„ฐ, ํ‚ค๋ณด๋“œ, ๋งˆ์šฐ์Šค๋ฅผ ์—ฐ๊ฒฐํ•˜์ง€ ์•Š๊ณ  ์ „์›๋งŒ ์—ฐ๊ฒฐํ•˜๊ณ  ์œˆ๋„์šฐ ๋ฐ์Šคํฌํƒ‘์—์„œ ์›๊ฒฉ ์ ‘์†ํ•˜์—ฌ ์‚ฌ์šฉํ•˜๋ฉด ๋œ๋‹ค.

computer terminal is an electronic or electromechanical hardware device that can be used for entering data into, and transcribing[1] data from, a computer or a computing system.[2] 

๋‹จ๋ง๊ธฐ(็ซฏๆœซๆฉŸ, ๋ฌธํ™”์–ด: ๋ง๋‹จ) ๋˜๋Š” ํ„ฐ๋ฏธ๋„(์˜์–ดterminal)์€ ์ปดํ“จํ„ฐ๋‚˜ ์ปดํ“จํŒ… ์‹œ์Šคํ…œ์— ๋ฐ์ดํ„ฐ๋ฅผ ์ž…๋ ฅํ•˜๊ฑฐ๋‚˜ ํ‘œ์‹œํ•˜๋Š” ๋ฐ ์“ฐ์ด๋Š” ์ „์ž ํ•˜๋“œ์›จ์–ด ๊ธฐ๊ธฐ์ด๋‹ค. ์ปดํ“จํ„ฐ ํ„ฐ๋ฏธ๋„์€ ์ธ๊ฐ„๊ณผ ์ปดํ“จํ„ฐ์˜ ์ธํ„ฐํŽ˜์ด์Šค (HMI: human-machine interface)์˜ ํ•œ ์˜ˆ์ด๋‹ค.


4 ๋ฆฌ๋ˆ…์Šค ๋ช…๋ น์–ด

4.1 ์‰˜(Shell)

์œˆ๋„์šฐ์˜ ๋„์Šค์—์„œ ๋‚ด๋ฆฌ๋Š” ๋Œ€๋ถ€๋ถ„์˜ ๋ช…๋ น์€ command.com์ด๋ผ๋Š” ํŒŒ์ผ์ด ์ฒ˜๋ฆฌํ•œ๋‹ค.
command.com ํŒŒ์ผ์„ ์šด์˜์ฒด์ œ์˜ ์‰˜(Shell) ํ”„๋กœ๊ทธ๋žจ์ด๋ผ๊ณ  ํ•œ๋‹ค.
์‰˜ ํ”„๋กœ๊ทธ๋žจ์€ ์‚ฌ์šฉ์ž๊ฐ€ ๋‚ด๋ฆฐ ๋ช…๋ น์„ ์šด์˜์ฒด์ œ๊ฐ€ ์ˆ˜ํ–‰ํ•  ์ˆ˜ ์žˆ๋Š” ๋ช…๋ น์–ด๋กœ ํ•ด์„ํ•˜์—ฌ ์šด์˜์ฒด์ œ์— ์ „๋‹ฌํ•˜๋Š” ์ผ์„ ํ•œ๋‹ค. ๊ทธ๋ž˜์„œ ๋ช…๋ น์–ด ํ•ด์„๊ธฐ๋ผ๊ณ  ๋ถˆ๋ฆฐ๋‹ค.

์šฐ๋ฆฌ๊ฐ€ ํ•˜๋“œ์›จ์–ด๋ฅผ ์ง์ ‘์ ์œผ๋กœ ์ œ์–ดํ•˜๋Š” ๊ฒƒ์ด ์–ด๋ ต๊ธฐ ๋•Œ๋ฌธ์— ํ•˜๋“œ์›จ์–ด ์ œ์–ด๋Š” ์šด์˜์ฒด์ œ๊ฐ€ ๋Œ€์‹ ํ•˜๊ณ  ๋˜๊ณ  ์šฐ๋ฆฌ๋Š” ์šด์˜์ฒด์ œ์—๊ฒŒ ๋ช…๋ น์„ ๋‚ด๋ฆฐ๋‹ค.

์‚ฌ์šฉ์ž(๋ช…๋ น) → ์‰˜(ํ•ด์„) → ์ปค๋„(๋ช…๋ น ์ˆ˜ํ–‰ ํ›„ ๊ฒฐ๊ณผ ์ „์†ก) → ์‰˜(ํ•ด์„) → ์‚ฌ์šฉ์ž(๊ฒฐ๊ณผ ํ™•์ธ)
์ฐธ๊ณ 


๋ฆฌ๋ˆ…์Šค๋Š” ์ปค๋„์ด๋ผ๊ณ  ๋ถˆ๋ฆฌ๋Š” ํ•˜๋“œ์›จ์–ด๋ฅผ ์ง์ ‘ ์ œ์–ดํ•˜๋Š” ๋ถ€๋ถ„๊ณผ ๊ทธ ์œ„์—์„œ ์ปค๋„์— ๋ช…๋ น์„ ์ฃผ๋Š” ์‰˜๋กœ ๊ตฌ์„ฑ์ด ๋œ๋‹ค.

4.2 ๊ธฐ๋ณธ ๋ช…๋ น์–ด

1. date ๋ช…๋ น์–ด
ํ˜„์žฌ ๋‚ ์งœ ๋ฐ ์‹œ๊ฐ„์„ ํ™•์ธํ•  ์ˆ˜ ์žˆ๋‹ค.

$ date

2. hostname ๋ช…๋ น์–ด
ํ˜ธ์ŠคํŠธ์˜ ์ด๋ฆ„์„ ํ™•์ธํ•  ์ˆ˜ ์žˆ๋‹ค.

$ hostname
rasberrypi

3. ls ๋ช…๋ น์–ด
ํ˜„์žฌ ๋””๋ ‰ํ„ฐ๋ฆฌ ์•ˆ์— ์กด์žฌํ•˜๋Š” ๋ชจ๋“  ๊ฒƒ์„ ํ™•์ธํ•  ์ˆ˜ ์žˆ๋‹ค.

$Is
Desktop
Documents
Downloads
Music
Pictures
Public
Templates
Videos
python_games

4. clear ๋ช…๋ น์–ด
ํ™”๋ฉด์„ ๊นจ๋—์ด ํ•  ์ˆ˜ ์žˆ๋‹ค.

$ clear

5. password ๋ช…๋ น์–ด
์‚ฌ์šฉ์ž ๋น„๋ฐ€๋ฒˆํ˜ธ๋ฅผ ๋ณ€๊ฒฝํ•  ์ˆ˜ ์žˆ๋‹ค.

$ passwd
pi์— ๋Œ€ํ•œ ์•”ํ˜ธ ๋ณ€๊ฒฝ ์ค‘
(ํ˜„์žฌ) UNIX ์•”ํ˜ธ:
์ƒˆ UNIX ์•”ํ˜ธ ์ž…๋ ฅ:
์ƒˆ UNIX ์•”ํ˜ธ ์žฌ์ž…๋ ฅ:

$ sudo passwd root
์ƒˆ UNIX ์•”ํ˜ธ ์ž…๋ ฅ:
์ƒˆ UNIX ์•”ํ˜ธ ์žฌ์ž…๋ ฅ:
passwd: ์•”ํ˜ธ๋ฅผ ์„ฑ๊ณต์ ์œผ๋กœ ์—…๋ฐ์ดํŠธํ–ˆ์Šต๋‹ˆ๋‹ค

$ su root
์•”ํ˜ธ: 
root@rasberrypi:/home/pi#

4.3 ํŒŒ์ผ ๋ฐ ๋””๋ ‰ํ„ฐ๋ฆฌ (directory) p. 58

๋ฆฌ๋ˆ…์Šค์˜ ๋””๋ ‰ํ„ฐ๋ฆฌ๋Š” ํ•˜๋‚˜์˜ ํŒŒ์ผ๋กœ ๊ฐ„์ฃผ๋˜๋ฉฐ ํ•˜๋‚˜์˜ ๋””๋ ‰ํ„ฐ๋ฆฌ๋Š” ๋‹ค๋ฅธ ๋””๋ ‰ํ„ฐ๋ฆฌ๋“ค์„ ํฌํ•จํ•จ์œผ๋กœ์จ ๊ณ„์ธต๊ตฌ์กฐ๋ฅผ ์ด๋ฃฌ๋‹ค.
๋ถ€๋ชจ ๋””๋ ‰ํ„ฐ๋ฆฌ๋Š” ๋‹ค๋ฅธ ๋””๋ ‰ํ„ฐ๋ฆฌ๋“ค์„ ์„œ๋ธŒ ๋””๋ ‰ํ„ฐ๋ฆฌ๋กœ ๊ฐ€์ง€๊ณ  ์žˆ๋‹ค.

In computing, a directory is a file system cataloging structure which contains references to other computer files, and possibly other directories. On many computers, directories are known as folders, or drawers, analogous to a workbench or the traditional office filing cabinet.

๋ฆฌ๋ˆ…์Šค ๋””๋ ‰ํ„ฐ๋ฆฌ ํŠธ๋ฆฌ ๊ตฌ์กฐ

 

1. home ๋””๋ ‰ํ„ฐ๋ฆฌ
๋ฆฌ๋ˆ…์Šค ์‹œ์Šคํ…œ์€ ๋‹ค์ค‘ ์‚ฌ์šฉ์ž ์‹œ์Šคํ…œ์ด๋ฏ€๋กœ ์‚ฌ์šฉ์ž๋งˆ๋‹ค ๋ณ„๋„์˜ ํ™ˆ ๋””๋ ‰ํ„ฐ๋ฆฌ๊ฐ€ ์žˆ๋‹ค. ๊ณ„์ •์„ ๋งŒ๋“ค ๋•Œ ๊ด€๋ฆฌ์ž์— ์˜ํ•ด ์ •ํ•ด์ง„๋‹ค. 

์‚ฌ์šฉ์ž๋ช…์ด pi๋ผ๋ฉด /home/pi ํด๋”๊ฐ€ ์กด์žฌํ•œ๋‹ค.
cd $HOME์„ ํ†ตํ•ด /home/pi ๋””๋ ‰ํ„ฐ๋ฆฌ๋กœ ์ด๋™ ๊ฐ€๋Šฅํ•˜๋‹ค.

$ cd / # cd = change directory
$ cd $HOME

2. pwd ๋ช…๋ น์–ด (print working directory)
ํ˜„์žฌ ์ž‘์—… ๋””๋ ‰ํ„ฐ๋ฆฌ๋ฅผ ๋ณด์—ฌ์ค€๋‹ค.

$ pwd
/home/pi

3. mkdir ๋ช…๋ น์–ด (make directory)
์ƒˆ ๋””๋ ‰ํ„ฐ๋ฆฌ๋ฅผ ๋งŒ๋“œ๋Š” ๋ช…๋ น์–ด๋‹ค. (ex. ์œˆ๋„์šฐ์—์„œ ์ƒˆ ํด๋” ๋งŒ๋“ค๊ธฐ)

$ mkdir movie

cd (change directory) ๋ช…๋ น์–ด๋ฅผ ์ด์šฉํ•ด์„œ ์›ํ•˜๋Š” ์ž‘์—… ๋””๋ ‰ํ„ฐ๋ฆฌ๋กœ ์ด๋™ํ•  ์ˆ˜ ์žˆ๋‹ค.

$ cd movie

cd .. ๋ช…๋ น์–ด๋ฅผ ์‚ฌ์šฉํ•˜๋ฉด ํ•œ ๋‹จ๊ณ„ ์ƒ์œ„ ๋””๋ ‰ํ„ฐ๋ฆฌ๋กœ ์ด๋™ ๊ฐ€๋Šฅํ•˜๋‹ค.
(.. = ๋’ค๋กœ ๊ฐ€๊ธฐ)

$ cd ..

pwd ๋ช…๋ น์–ด๋ฅผ ํ†ตํ•ด ๋‚˜์˜ ์œ„์น˜๋ฅผ ๊ณ„์† ์ˆ™์ง€ํ•ด ์ค€๋‹ค.

$ pwd
/home/pi

 

4. home ๋””๋ ‰ํ„ฐ๋ฆฌ๋กœ ์ด๋™ํ•˜๋Š” 3๊ฐ€์ง€ ๋ฐฉ๋ฒ•

$ cd
$ cd /home/pi
$ cd ~/

5. touch ๋ช…๋ น์–ด
๋นˆ ํŒŒ์ผ์„ ์ƒ์„ฑํ•  ์ˆ˜ ์žˆ๋‹ค. touch ๋ช…๋ น์–ด๋Š” ๋นˆ ํŒŒ์ผ์„ ์ƒ์„ฑํ•˜๋Š” ๊ฒƒ์ด๋ฏ€๋กœ ํŒŒ์ผ ์•ˆ์— ๋‚ด์šฉ์€ ์—†๋‹ค.

$ cd ~/webapps
$ mkdir ch02
$ cd mkdir
$ touch read.txt

6. ls ๋ช…๋ น์–ด (list)
-a(์ˆจ๊ฒจ์ง„ ํŒŒ์ผ ํ‘œ์‹œ) -s(ํฌ๊ธฐ๋ฅผ kb๋‹จ์œ„๋กœ ํ‘œ์‹œ) -l(ํŒŒ์ผ์˜ ์ƒ์„ธ ์ •๋ณด ํ‘œ์‹œ)๋ฅผ ์ ์šฉ

ls ๋ช…๋ น์–ด๋Š” ๋””๋ ‰ํ„ฐ๋ฆฌ์˜ ๋‚ด์šฉ์„ ์ถœ๋ ฅํ•˜๋Š” ๋ฐ ์‚ฌ์šฉ๋œ๋‹ค.

pi@raspberrypi:~/webapps/ch02 $ cd ~/webapps/ch02
pi@raspberrypi:~/webapps/ch02 $ ls
read.txt

- ls -l ๋ช…๋ น์–ด: ํŒŒ์ผ์„ ์ƒ์„ธํžˆ ๋ณผ ์ˆ˜ ์žˆ๋‹ค.
read.txt๊ฐ€ ํด๋”์ธ์ง€ ํŒŒ์ผ์ธ์ง€, ๊ถŒํ•œ, ์†Œ์œ ์ž, ์ƒ์„ฑ๋œ ๋‚ ์งœ๋ฅผ ํ™•์ธํ•  ์ˆ˜ ์žˆ๋‹ค.

pi@raspberrypi:~/webapps/ch02 $ cd ~/webapps/ch02
pi@raspberrypi:~/webapps/ch02 $ ls -l
ํ•ฉ๊ณ„ 0
-rw-r--r-- 1 pi pi 0  2์›” 28 14:35 read.txt

ls -a ๋ช…๋ น์–ด: ์ˆจ๊ฒจ์ง„ ํด๋”์™€ ํŒŒ์ผ์˜ ๋ฆฌ์ŠคํŠธ๋ฅผ ํ™•์ธํ•  ์ˆ˜ ์žˆ๋‹ค.
์ˆจ๊น€ ํŒŒ์ผ์„ touch๋ช…๋ น์–ด๋ฅผ ํ†ตํ•ด ๋งŒ๋“ ๋‹ค. ์ˆจ๊น€ ํŒŒ์ผ์„ ์ƒ์„ฑํ•˜๋ ค๋ฉด ํŒŒ์ผ๋ช… ์•ž์— .์„ ์ถ”๊ฐ€ํ•œ๋‹ค.

pi@raspberrypi:~/webapps/ch02 $ ch ~/webapps/ch02
-bash: ch: ๋ช…๋ น์–ด๋ฅผ ์ฐพ์„ ์ˆ˜ ์—†์Œ
pi@raspberrypi:~/webapps/ch02 $ touch .hidden.txt
pi@raspberrypi:~/webapps/ch02 $ ls -a
.  ..  .hidden.txt  read.txt

ls -al ๋ช…๋ น์–ด: ์ˆจ๊ฒจ์ง„ ํด๋”์™€ ํŒŒ์ผ์˜ ๋ฆฌ์ŠคํŠธ๋ฅผ ์ƒ์„ธํžˆ ๋ณผ ์ˆ˜ ์žˆ๋‹ค.

pi@raspberrypi:~ $ cd ~/webapps/ch02
pi@raspberrypi:~/webapps/ch02 $ ls -al
ํ•ฉ๊ณ„ 8
drwxr-xr-x 2 pi pi 4096  2์›” 28 14:42 .
drwxr-xr-x 4 pi pi 4096  2์›” 28 14:38 ..
-rw-r--r-- 1 pi pi    0  2์›” 28 14:45 .hidden.txt
-rw-r--r-- 1 pi pi    0  2์›” 28 14:35 read.txt

7. cat ๋ช…๋ น์–ด (concatenate: link (things) together in a chain or series. ์—ฐ๊ฒฐํ•˜๋‹ค)
ํŒŒ์ผ์˜ ๋‚ด์šฉ์„ ํ™”๋ฉด์— ๋ฐ”๋กœ ์ถœ๋ ฅํ•  ์ˆ˜ ์žˆ๋‹ค.

$ cd ~/home
$ cat .bashrc
pi@raspberrypi:~/webapps/ch02 $ cat read.txt
์ฃผํƒ๋„์‹œ๋ณด์ฆ๊ณต์‚ฌ, HUG๋Š” ๋‹ค์Œ ๋‹ฌ 2์ผ๋ถ€ํ„ฐ ๋ถ€๋ถ€ํ•ฉ์‚ฐ์†Œ๋“ 1์–ต ์› ์ดˆ๊ณผ 1์ฃผํƒ์ž์™€ ๋ณด์œ ์ฃผํƒ๊ฐ€๊ฒฉ 9์–ต ์› ์ดˆ๊ณผ 1์ฃผํƒ์ž์— ๋Œ€ํ•ด์„œ๋„ ์ „์„ธ๋Œ€์ถœ๋ณด์ฆ์„ ํ—ˆ์šฉํ•œ๋‹ค๊ณ  ๋ฐํ˜”์Šต๋‹ˆ๋‹ค.

๊ทธ๋™์•ˆ 1์ฃผํƒ์ž๋Š” ๋ถ€๋ถ€ ํ•ฉ์‚ฐ ์†Œ๋“์ด 1์–ต ์› ์ดํ•˜์ด๊ฑฐ๋‚˜ 9์–ต ์› ์ดํ•˜ ์ฃผํƒ์„ ๋ณด์œ ํ•œ ๊ฒฝ์šฐ์—๋งŒ ์ „์„ธ๋Œ€์ถœ๋ณด์ฆ์„ ์ด์šฉํ•  ์ˆ˜ ์žˆ์—ˆ์Šต๋‹ˆ๋‹ค.

์ „์„ธ๋Œ€์ถœ๋ณด์ฆ์€ ๊ธˆ์œต๊ธฐ๊ด€์—์„œ ์ „์„ธ์ž๊ธˆ์„ ๋Œ€์ถœ๋ฐ›์„ ๋•Œ ๊ณต์‚ฌ์˜ ๋ณด์ฆ์„œ๋ฅผ ๋‹ด๋ณด๋กœ ์ด์šฉํ•ด ๋Œ€์ถœ๋ฐ›์„ ์ˆ˜ ์žˆ๋„๋ก ํ•œ ์ƒํ’ˆ์ž…๋‹ˆ๋‹ค.

๊ณต์‚ฌ์˜ ์ „์„ธ๋ณด์ฆ ํ•œ๋„์— ๋น„๋ก€ํ•ด ๋Œ€์ถœํ•œ๋„๊ฐ€ ๊ฒฐ์ •๋˜๊ณ  ์ด์šฉ์ž๋Š” ๋ณด์ฆ๋ฃŒ๋ฅผ ๋‚ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.

ํ•˜์ง€๋งŒ ๊ธˆ๋ฆฌ ์ธ์ƒ, ์ฃผํƒ๊ฐ€๊ฒฉ ํ•˜๋ฝ ๋“ฑ์œผ๋กœ ์ฃผ๊ฑฐ ๋ถ€๋‹ด์ด ๋Š˜๋ฉด์„œ 1์ฃผํƒ์ž์™€ ์‹ค์ˆ˜์š”์ž ์ฃผ๊ฑฐ ์•ˆ์ • ์ง€์›์„ ์œ„ํ•ด ๋Œ€์ƒ์„ ํ™•๋Œ€ํ–ˆ์Šต๋‹ˆ๋‹ค.

์ด๋ฒˆ ๊ทœ์ œ ์™„ํ™”๋Š” HUG, ํ•œ๊ตญ์ฃผํƒ๊ธˆ์œต๊ณต์‚ฌ, SGI์„œ์šธ๋ณด์ฆ ๋“ฑ ๋ณด์ฆ๊ธฐ๊ด€ 3์‚ฌ๊ฐ€ ๋™์ผํ•˜๊ฒŒ ์‹œํ–‰ํ•ฉ๋‹ˆ๋‹ค.

 

8. head ๋ช…๋ น์–ด
ํŒŒ์ผ์˜ ์•ž 10์ค„์„ ์ถœ๋ ฅํ•ด ์ค€๋‹ค.

$ head .bashrc
pi@raspberrypi:~/webapps/ch02 $ ~/webapps/ch02 $ cat read.txt
-bash: /home/pi/webapps/ch02: ๋””๋ ‰ํ„ฐ๋ฆฌ์ž…๋‹ˆ๋‹ค
pi@raspberrypi:~/webapps/ch02 $ head read.txt
์ฃผํƒ๋„์‹œ๋ณด์ฆ๊ณต์‚ฌ, HUG๋Š” ๋‹ค์Œ ๋‹ฌ 2์ผ๋ถ€ํ„ฐ ๋ถ€๋ถ€ํ•ฉ์‚ฐ์†Œ๋“ 1์–ต ์› ์ดˆ๊ณผ 1์ฃผํƒ์ž์™€ ๋ณด์œ ์ฃผํƒ๊ฐ€๊ฒฉ 9์–ต ์› ์ดˆ๊ณผ 1์ฃผํƒ์ž์— ๋Œ€ํ•ด์„œ๋„ ์ „์„ธ๋Œ€์ถœ๋ณด์ฆ์„ ํ—ˆ์šฉํ•œ๋‹ค๊ณ  ๋ฐํ˜”์Šต๋‹ˆ๋‹ค.

๊ทธ๋™์•ˆ 1์ฃผํƒ์ž๋Š” ๋ถ€๋ถ€ ํ•ฉ์‚ฐ ์†Œ๋“์ด 1์–ต ์› ์ดํ•˜์ด๊ฑฐ๋‚˜ 9์–ต ์› ์ดํ•˜ ์ฃผํƒ์„ ๋ณด์œ ํ•œ ๊ฒฝ์šฐ์—๋งŒ ์ „์„ธ๋Œ€์ถœ๋ณด์ฆ์„ ์ด์šฉํ•  ์ˆ˜ ์žˆ์—ˆ์Šต๋‹ˆ๋‹ค.

์ „์„ธ๋Œ€์ถœ๋ณด์ฆ์€ ๊ธˆ์œต๊ธฐ๊ด€์—์„œ ์ „์„ธ์ž๊ธˆ์„ ๋Œ€์ถœ๋ฐ›์„ ๋•Œ ๊ณต์‚ฌ์˜ ๋ณด์ฆ์„œ๋ฅผ ๋‹ด๋ณด๋กœ ์ด์šฉํ•ด ๋Œ€์ถœ๋ฐ›์„ ์ˆ˜ ์žˆ๋„๋ก ํ•œ ์ƒํ’ˆ์ž…๋‹ˆ๋‹ค.

๊ณต์‚ฌ์˜ ์ „์„ธ๋ณด์ฆ ํ•œ๋„์— ๋น„๋ก€ํ•ด ๋Œ€์ถœํ•œ๋„๊ฐ€ ๊ฒฐ์ •๋˜๊ณ  ์ด์šฉ์ž๋Š” ๋ณด์ฆ๋ฃŒ๋ฅผ ๋‚ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.

ํ•˜์ง€๋งŒ ๊ธˆ๋ฆฌ ์ธ์ƒ, ์ฃผํƒ๊ฐ€๊ฒฉ ํ•˜๋ฝ ๋“ฑ์œผ๋กœ ์ฃผ๊ฑฐ ๋ถ€๋‹ด์ด ๋Š˜๋ฉด์„œ 1์ฃผํƒ์ž์™€ ์‹ค์ˆ˜์š”์ž ์ฃผ๊ฑฐ ์•ˆ์ • ์ง€์›์„ ์œ„ํ•ด ๋Œ€์ƒ์„ ํ™•๋Œ€ํ–ˆ์Šต๋‹ˆ๋‹ค.

 

9. tail ๋ช…๋ น์–ด
ํŒŒ์ผ์˜ ๋งจ ๋’ค 10์ค„์„ ์ถœ๋ ฅํ•ด ์ค€๋‹ค..

$ tail .bashrc
pi@raspberrypi:~/webapps/ch02 $ tail read.txt

๊ทธ๋™์•ˆ 1์ฃผํƒ์ž๋Š” ๋ถ€๋ถ€ ํ•ฉ์‚ฐ ์†Œ๋“์ด 1์–ต ์› ์ดํ•˜์ด๊ฑฐ๋‚˜ 9์–ต ์› ์ดํ•˜ ์ฃผํƒ์„ ๋ณด์œ ํ•œ ๊ฒฝ์šฐ์—๋งŒ ์ „์„ธ๋Œ€์ถœ๋ณด์ฆ์„ ์ด์šฉํ•  ์ˆ˜ ์žˆ์—ˆ์Šต๋‹ˆ๋‹ค.

์ „์„ธ๋Œ€์ถœ๋ณด์ฆ์€ ๊ธˆ์œต๊ธฐ๊ด€์—์„œ ์ „์„ธ์ž๊ธˆ์„ ๋Œ€์ถœ๋ฐ›์„ ๋•Œ ๊ณต์‚ฌ์˜ ๋ณด์ฆ์„œ๋ฅผ ๋‹ด๋ณด๋กœ ์ด์šฉํ•ด ๋Œ€์ถœ๋ฐ›์„ ์ˆ˜ ์žˆ๋„๋ก ํ•œ ์ƒํ’ˆ์ž…๋‹ˆ๋‹ค.

๊ณต์‚ฌ์˜ ์ „์„ธ๋ณด์ฆ ํ•œ๋„์— ๋น„๋ก€ํ•ด ๋Œ€์ถœํ•œ๋„๊ฐ€ ๊ฒฐ์ •๋˜๊ณ  ์ด์šฉ์ž๋Š” ๋ณด์ฆ๋ฃŒ๋ฅผ ๋‚ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.

ํ•˜์ง€๋งŒ ๊ธˆ๋ฆฌ ์ธ์ƒ, ์ฃผํƒ๊ฐ€๊ฒฉ ํ•˜๋ฝ ๋“ฑ์œผ๋กœ ์ฃผ๊ฑฐ ๋ถ€๋‹ด์ด ๋Š˜๋ฉด์„œ 1์ฃผํƒ์ž์™€ ์‹ค์ˆ˜์š”์ž ์ฃผ๊ฑฐ ์•ˆ์ • ์ง€์›์„ ์œ„ํ•ด ๋Œ€์ƒ์„ ํ™•๋Œ€ํ–ˆ์Šต๋‹ˆ๋‹ค.

์ด๋ฒˆ ๊ทœ์ œ ์™„ํ™”๋Š” HUG, ํ•œ๊ตญ์ฃผํƒ๊ธˆ์œต๊ณต์‚ฌ, SGI์„œ์šธ๋ณด์ฆ ๋“ฑ ๋ณด์ฆ๊ธฐ๊ด€ 3์‚ฌ๊ฐ€ ๋™์ผํ•˜๊ฒŒ ์‹œํ–‰ํ•ฉ๋‹ˆ๋‹ค.

tail ๋ช…๋ น์–ด์˜ ์˜ต์…˜์„ ์กฐ์ •ํ•˜์—ฌ 5์ค„๋งŒ ์ถœ๋ ฅํ•  ์ˆ˜๋„ ์žˆ๋‹ค.

$ tail -5 .bashrc
pi@raspberrypi:~/webapps/ch02 $ tail -5 read.txt
๊ณต์‚ฌ์˜ ์ „์„ธ๋ณด์ฆ ํ•œ๋„์— ๋น„๋ก€ํ•ด ๋Œ€์ถœํ•œ๋„๊ฐ€ ๊ฒฐ์ •๋˜๊ณ  ์ด์šฉ์ž๋Š” ๋ณด์ฆ๋ฃŒ๋ฅผ ๋‚ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.

ํ•˜์ง€๋งŒ ๊ธˆ๋ฆฌ ์ธ์ƒ, ์ฃผํƒ๊ฐ€๊ฒฉ ํ•˜๋ฝ ๋“ฑ์œผ๋กœ ์ฃผ๊ฑฐ ๋ถ€๋‹ด์ด ๋Š˜๋ฉด์„œ 1์ฃผํƒ์ž์™€ ์‹ค์ˆ˜์š”์ž ์ฃผ๊ฑฐ ์•ˆ์ • ์ง€์›์„ ์œ„ํ•ด ๋Œ€์ƒ์„ ํ™•๋Œ€ํ–ˆ์Šต๋‹ˆ๋‹ค.

์ด๋ฒˆ ๊ทœ์ œ ์™„ํ™”๋Š” HUG, ํ•œ๊ตญ์ฃผํƒ๊ธˆ์œต๊ณต์‚ฌ, SGI์„œ์šธ๋ณด์ฆ ๋“ฑ ๋ณด์ฆ๊ธฐ๊ด€ 3์‚ฌ๊ฐ€ ๋™์ผํ•˜๊ฒŒ ์‹œํ–‰ํ•ฉ๋‹ˆ๋‹ค.

- tail -f ์˜ต์…˜์„ ์‚ฌ์šฉํ•˜๋ฉด ์‹ค์‹œ๊ฐ„์œผ๋กœ ๋ณ€๊ฒฝ๋œ ๋‚ด์šฉ์„ ํ™•์ธํ•  ์ˆ˜ ์žˆ๋‹ค.

์ฒซ ๋ฒˆ์งธ ํ„ฐ๋ฏธ๋„:

$ tail -f ~/webapps/ch02/read.txt


๋‘ ๋ฒˆ์งธ ํ„ฐ๋ฏธ๋„: nano ์—๋””ํ„ฐ๋ฅผ ์‚ฌ์šฉํ•œ๋‹ค. Ctrl + X: ์ €์žฅ ํ›„ ์ข…๋ฃŒ

$ nano ~/webapps/ch02/read.txt



๋ณ€๊ฒฝ๋œ ์ฒซ ๋ฒˆ์งธ ํ„ฐ๋ฏธ๋„

pi@raspberrypi:~/webapps/ch02 $ tail -f ~/webapps/ch02/read.txt
Hello

4.4 ํŒŒ์ผ ์ด๋™(mv), ์‚ญ์ œ(rm), ๋ณต์‚ฌ(cp) ๋ช…๋ น์–ด p. 62

1. cp ๋ช…๋ น์–ด (copy)
- ํŒŒ์ผ์„ ๋ณต์‚ฌํ•ด ์ฃผ๋Š” ๋ช…๋ น์–ด๋‹ค.
cp <๋ณต์‚ฌํ•  ๋Œ€์ƒ> <๋ณต์‚ฌ๋  ์œ„์น˜>

$ cp read.txt test


์˜ˆ์ œ)

$ cd ~/webapps/ch02
$ mkdir test #make directory
$ ls #list
read.txt test
$ cp read.txt test #copy
$ cd test #change directory
$ ls #list
read.txt



- ํŒŒ์ผ์„ ๋ณต์‚ฌํ•˜๋Š”๋ฐ ๋‹ค๋ฅธ ์ด๋ฆ„์œผ๋กœ ์ €์žฅํ•˜๋ ค๋ฉด
cp <๋ณต์‚ฌํ•  ๋Œ€์ƒ> <๋ณต์‚ฌ๋  ์œ„์น˜/ํŒŒ์ผ๋ช…>

$ cp read.txt test/rename.txt


์˜ˆ์ œ)

$ cd ~/webapps/ch02
$ ls #list
read.txt test
$ cp read.txt test/rename.txt #copy
$ cd test #change directory
$ ls #list
read.txt rename.txt



- ๋‚ด ์œ„์น˜๊ฐ€ ์–ด๋””์— ์žˆ๋“  ์ ˆ๋Œ€๊ฒฝ๋กœ๋ฅผ ํ†ตํ•ด cp๋ช…๋ น์–ด๋ฅผ ํ™œ์šฉํ•  ์ˆ˜ ์žˆ๋‹ค.
cp <๋ณต์‚ฌํ•  ๋Œ€์ƒ> <๋ณต์‚ฌ๋  ์œ„์น˜ ์ ˆ๋Œ€๊ฒฝ๋กœ/ํŒŒ์ผ๋ช…>

$ cd /home/pi/webapps/ch02/testread.txt /home/pi/webapps/ch02/test/change.txt


์˜ˆ์ œ) /์˜ ์˜๋ฏธ: ์ตœ์ƒ๋‹จ์˜ / ๋””๋ ‰ํ„ฐ๋ฆฌ๋ถ€ํ„ฐ ๊ฒ€์ƒ‰ํ•œ๋‹ค. ex) Windows์—์„œ c:\๋ถ€ํ„ฐ ๊ฒ€์ƒ‰ํ•œ๋‹ค.

$ cd /
$ pwd
/
$ cd /home/pi/webapps/ch02/testread.txt /home/pi/webapps/ch02/test/change.txt
$ cd /home/pi/webapps/ch02/test
$ ls
change.txt read.txt rename.txt

2. mv ๋ช…๋ น์–ด (move)
- ํŒŒ์ผ์„ ์ด๋™ํ•˜๋Š” ๋ช…๋ น์–ด์ž…๋‹ˆ๋‹ค.
mv <ํŒŒ์ผ๋ช…> <์ด๋™ํ•  ์œ„์น˜>

$ mv myfile.txt test

์˜ˆ์ œ) 

$ cd ~/webapps/ch02
$ touch myfile.txt
$ mv myfile.txt test
$ cd test
$ ls
change.txt myfile.txt read.txt rename.txt



mv๋ช…๋ น์–ด๋ฅผ ํ†ตํ•ด ํŒŒ์ผ๋ช…์„ ๋ณ€๊ฒฝํ•  ์ˆ˜ ์žˆ๋‹ค.
mv <ํŒŒ์ผ๋ช…> <๋‹ค๋ฅธ ์ด๋ฆ„>

$ mv myfile.txt yourfile.txt

์˜ˆ์ œ) 

$ mv myfile.txt yourfile.txt
$ ls
change.txt yourfile.txt read.txt rename.txt

 

3. rm ๋ช…๋ น์–ด (remove)
- ํŒŒ์ผ์„ ์‚ญ์ œํ•ด ์ฃผ๋Š” ๋ช…๋ น์–ด์ž…๋‹ˆ๋‹ค
ํŒŒ์ผ์‚ญ์ œ rm <ํŒŒ์ผ๋ช…>

$ rm read.txt

์˜ˆ์ œ) 

$ cd ~/webapps/ch02
$ ls
read.txt test
$ rm read.txt
$ ls
test



-r ์˜ต์…˜์„ ์‚ฌ์šฉํ•˜๋ฉด ๋””๋ ‰ํ„ฐ๋ฆฌ๋ฅผ ์‚ญ์ œํ•  ์ˆ˜ ์žˆ๋‹ค.
ํด๋”์‚ญ์ œ : rm –r <๋””๋ ‰ํ„ฐ๋ฆฌ๋ช…>

$ rm -r test

์˜ˆ์ œ)

$ cd ~/webapps/ch02/test
$ mkdir folder1
$ ls
change.txt folder1 myfile.text read.txt rename.txt
$ cd ..
$ rm test
rm: channot remove 'test': ๋””๋ ‰ํ„ฐ๋ฆฌ์ž…๋‹ˆ๋‹ค
$ rm -r test

4.5 ํŒŒ์ผ ์ฐพ๊ธฐ ๋ช…๋ น์–ด p. 64

/bin ํด๋”๋Š” ๊ธฐ๋ณธ์ ์ธ ํ™˜๊ฒฝ๋ณ€์ˆ˜๊ฐ€ ์„ค์ •๋˜์–ด ์žˆ๋Š” ํด๋”์ด๊ธฐ ๋•Œ๋ฌธ์— /bin ํด๋” ๋‚ด๋ถ€์— ์žˆ๋Š” ์‹คํ–‰ํŒŒ์ผ์€ ์–ด๋””์—์„œ๋“ ์ง€ ์‹คํ–‰ํ•  ์ˆ˜ ์žˆ๋‹ค.

์ฐธ๊ณ : https://velog.io/@dev_shu/Linux%EC%9D%98-%EA%B0%9C%EC%9A%942

/ (root): ์‹œ์Šคํ…œ ๊ด€๋ฆฌ์ž์šฉ ํ™ˆ๋””๋ ‰ํ„ฐ๋ฆฌ, ์ตœ์ƒ์œ„ (๊ถŒํ•œ ๊ฐ•ํ•จ)
home ๋ฐ‘ ํŒŒ์ผ: ์‚ฌ์šฉ์ž ๋””๋ ‰ํ„ฐ๋ฆฌ (๊ถŒํ•œ ์•ฝํ•จ)


1. which ๋ช…๋ น์–ด
- ํŠน์ • ๋ช…๋ น์–ด์˜ ์œ„์น˜๋ฅผ ์ „์ฒด ๊ฒฝ๋กœ๋กœ ์ฐพ์•„์ฃผ๋Š” ๋ช…๋ น์–ด๋‹ค.
which <๋ช…๋ น์–ด>

$ cd /
$ which rm
/bin/rm


- which ๋ช…๋ น์–ด๋ฅผ ํ†ตํ•ด python3.5 ์‹คํ–‰ํŒŒ์ผ์ด ์–ด๋”” ์žˆ๋Š”์ง€ ์•Œ ์ˆ˜ ์žˆ๋‹ค.

$ which python3.5
/usr/bin/python3.5

 

2. whereis ๋ช…๋ น์–ด
์‹คํ–‰ํŒŒ์ผ์†Œ์ŠคํŒŒ์ผ, man ํŽ˜์ด์ง€ ํŒŒ์ผ์˜ ์œ„์น˜๋ฅผ ์ฐพ์•„์ฃผ๋Š” ๋ช…๋ น์–ด๋‹ค.
whereis <ํŒŒ์ผ๋ช…>

$ whereis python3.5

 

3. find ๋ช…๋ น์–ด
find ๋ช…๋ น์–ด๋ฅผ ํ†ตํ•ด ํŠน์ • ์ด๋ฆ„์„ ๊ฐ€์ง„ ๋ชจ๋“  ํŒŒ์ผ๊ณผ ๋””๋ ‰ํ„ฐ๋ฆฌ๋ฅผ ์ฐพ์„ ์ˆ˜ ์žˆ๋‹ค.
/์˜ ์˜๋ฏธ: ์ตœ์ƒ๋‹จ์˜ / ๋””๋ ‰ํ„ฐ๋ฆฌ๋ถ€ํ„ฐ ๊ฒ€์ƒ‰ํ•œ๋‹ค. ex) Windows์—์„œ c:\๋ถ€ํ„ฐ ๊ฒ€์ƒ‰ํ•œ๋‹ค.

sudo find / -name python3.5

์•ž์— sudo๋ฅผ ๋ถ™์ด๋Š” ์ด์œ : pi ์‚ฌ์šฉ์ž๊ฐ€ ์•„๋‹Œ root์‚ฌ์šฉ์ž์˜ ๊ถŒํ•œ์„ ๋Œ€ํ–‰๋ฐ›์•„์„œ ๋ชจ๋“  ํด๋”๋ฅผ ํƒ์ƒ‰ํ•˜๊ธฐ ์œ„ํ•ด์„œ๋‹ค.
sudo (Super User DO) command in Linux is generally used as a prefix (์ ‘๋‘์‚ฌ) of some command that only superuser are allowed to run. 


4.6 ๊ถŒํ•œ p. 46

ex) root root: root ๊ถŒํ•œ์„ ๊ฐ€์ง„ ์‚ฌ๋žŒ๋งŒ ์‚ญ์ œ ๊ฐ€๋Šฅ

๋ฆฌ๋ˆ…์Šค

sudo(super user): ์Šˆํผ๊ถŒํ•œ์„ ์œ„์ž„ ์œ„ํ•œ ๋ช…๋ น์–ด
chmod(change mode): ๊ถŒํ•œ ๋ณ€๊ฒฝ
chown(change owner): ์†Œ์œ ์ž ๋ณ€๊ฒฝ

(1) file1.txt ์‚ดํŽด๋ณด๊ธฐ

x: ์‹คํ–‰ ๊ถŒํ•œ
์†Œ์œ ์ž (rw-) : ์ฝ๊ณ  ์“ฐ๋Š” ๊ถŒํ•œ ⊃ ์†Œ์œ ๊ทธ๋ฃน (r--) : ์ฝ๊ธฐ ๊ถŒํ•œ


(2) chmod ๋ช…๋ น์–ด๋ฅผ ์ด์šฉํ•˜์—ฌ file1.txt ๊ถŒํ•œ ๋ณ€๊ฒฝํ•˜๊ธฐ

์†Œ์œ ์ž์™€ ์†Œ์œ ๊ทธ๋ฃน์ด root์ด๊ณ  ๋‹ค๋ฅธ ๋ชจ๋“  ์œ ์ €๋Š” ์ฝ๊ธฐ(r--) ๊ถŒํ•œ๋งŒ ์žˆ๋Š” ์ƒํƒœ์ด๋‹ค. ๊ทธ๋Ÿฌ๋ฏ€๋กœ pi ์‚ฌ์šฉ์ž๋กœ ํ•ด๋‹น ํŒŒ์ผ์„ ์ฝ๋Š” ๊ฒƒ์€ ๊ฐ€๋Šฅํ•˜์ง€๋งŒ ์“ฐ๋Š” ๊ฒƒ์€ ๋ถˆ๊ฐ€๋Šฅํ•˜๋‹ค.

์ฐธ๊ณ : https://www.skyer9.pe.kr/wordpress/?p=627


(3) chmod ๋ช…๋ น์–ด (change mode)

chmod๋Š” ํŒŒ์ผ์˜ ๊ถŒํ•œ์„ ๋ณ€๊ฒฝํ•ด์ฃผ๋Š” ๋ช…๋ น์–ด๋‹ค์ˆซ์ž๋ฅผ ํ†ตํ•ด์„œ ๊ถŒํ•œ์„ ๋ณ€๊ฒฝํ•  ์ˆ˜ ์žˆ๋‹ค.
chmod <์ˆ˜์ •๋ฒˆํ˜ธ> <ํŒŒ์ผ๋ช…>
- rwx 3๊ฐ€์ง€ ๊ถŒํ•œ์„ ๋‹ค ์ฃผ๋ ค๋ฉด 7์„ ์ฃผ๋ฉด ๋œ๋‹ค.
r-๊ถŒํ•œ๋งŒ ์ฃผ๋ ค๋ฉด 4๋ฅผ ์ฃผ๋ฉด ๋ฉ๋‹ˆ๋‹ค. (4+0+0)
-w- ๊ถŒํ•œ๋งŒ ์ฃผ๋ ค๋ฉด 2๋ฅผ ์ฃผ๋ฉด ๋ฉ๋‹ˆ๋‹ค.
--๊ถŒํ•œ๋งŒ ์ฃผ๋ ค๋ฉด 1์„ ์ฃผ๋ฉด ๋ฉ๋‹ˆ๋‹ค.
- read์˜ ์•ฝ์ž r์€ ์ˆซ์ž 4๋กœ ํ‘œํ˜„๋ฉ๋‹ˆ๋‹ค.

 

- write์˜ ์•ฝ์ž w๋Š” ์ˆซ์ž 2๋กœ ํ‘œํ˜„๋ฉ๋‹ˆ๋‹ค.
- execute์˜ ์•ฝ์ž x๋Š” ์ˆซ์ž 1๋กœ ํ‘œํ˜„๋ฉ๋‹ˆ๋‹ค
rw-์˜ ๊ถŒํ•œ: ์ฝ๊ณ  ์“ฐ๋Š” ๊ฒƒ์ด ๊ฐ€๋Šฅํ•˜๋‹ค. (4+2=6๋ฅผ ์ฃผ๋ฉด ๋œ๋‹ค.)
r-x์˜ ๊ถŒํ•œ: ์ฝ๊ณ  ์‹คํ–‰ํ•˜๋Š” ๊ฒƒ์ด ๊ฐ€๋Šฅํ•˜๋‹ค. (4+1=5๋ฅผ ์ฃผ๋ฉด ๋œ๋‹ค.)
-wx์˜ ๊ถŒํ•œ: 2+1=3์„ ์ฃผ๋ฉด ๋œ๋‹ค.

654 would mean read and write for owner, (6)
read and execute for group (5)
and only read for everyone else
(4)


(4) chown ๋ช…๋ น์–ด (change owner)

chown ๋ช…๋ น์–ด๋Š” ํŒŒ์ผ์˜ ์†Œ์œ ์ž์™€ ์†Œ์œ ๊ทธ๋ฃน์„ ๋ณ€๊ฒฝํ•  ์ˆ˜ ์žˆ๋‹ค.
chown <์†Œ์œ ์ž> <์†Œ์œ ๊ทธ๋ฃน> <ํŒŒ์ผ๋ช… or ๋””๋ ‰ํ† ๋ฆฌ๋ช…>

pi@raspberrypi:~/webapps/ch02 $ sudo chown root:pi file1.txt
pi@raspberrypi:~/webapps/ch02 $ ls -l
ํ•ฉ๊ณ„ 8
-rw-r--rw- 1 root pi    0  3์›”  2 11:18 file1.txt
-rw-r--r-- 1 pi   pi   10  3์›”  2 11:20 file1.txt.save
-rw-r--r-- 1 pi   pi    0  3์›”  2 11:18 file2.txt
drwxr-xr-x 2 pi   pi 4096  3์›”  2 11:19 folder

4.7 ์ž…์ถœ๋ ฅ ์žฌ์ง€์ • IO Redirection p. 71

๋ฆฌ๋‹ค์ด๋ ‰์…˜์€ ํ‘œ์ค€ ์ž…์ถœ๋ ฅ์˜ ๋ฐฉํ–ฅ์„ ๋ฐ”๊ฟ”์ค€๋‹ค.
ํ‘œ์ค€ ์ž…๋ ฅ์€ ํ‚ค๋ณด๋“œํ‘œ์ค€ ์ถœ๋ ฅ์€ ๋ชจ๋‹ˆํ„ฐ์ด์ง€๋งŒ ์ด๋ฅผ ํŒŒ์ผ๋กœ ์ฒ˜๋ฆฌํ•˜๊ณ  ์‹ถ์„ ๋•Œ ์ฃผ๋กœ ์‚ฌ์šฉํ•œ๋‹ค.
(1) > ์‚ฌ์šฉ๋ฒ•

์„ ๋‹ค์‹œ ์‚ฌ์šฉํ•˜๋ฉด ๊ธฐ์กด์— ๋‚ด์šฉ์ด ์žˆ๋‹ค๋ฉด ์‚ฌ๋ผ์ง€๊ณ  ๋ฎ์–ด์“ฐ๊ฒŒ ๋œ๋‹ค.

 

(2) >> ์‚ฌ์šฉ๋ฒ•
>>์„ ์‚ฌ์šฉํ•˜๋ฉด ๊ธฐ์กด์— ๋‚ด์šฉ์— ์ถ”๊ฐ€๊ฐ€ ๋œ๋‹ค.


4.8 wget, apt-get, git clone ํŒŒ์ผ ๋‹ค์šด๋กœ๋“œ p. 72

๋ผ์ฆˆ๋ฒ ์ด ํŒŒ์ด๋Š” ์šด์˜์ฒด์ œ๋กœ ๋ผ์ฆˆ๋น„์•ˆ์„ ์‚ฌ์šฉํ•œ๋‹ค. (๋น„์•ˆ = ๋ฐ๋น„์•ˆ)
๋ผ์ฆˆ๋น„์•ˆ์€ ๋ฐ๋น„์•ˆ ๊ณ„์—ด์˜ ์šด์˜์ฒด์ œ๊ณ , ๋ฐ๋น„์•ˆ ๊ณ„์—ด์€ ์šด์˜์ฒด์ œ๋Š”. deb ํŒŒ์ผ์„ ๋‹ค์šด ๋ฐ›์•„์„œ ์„ค์น˜ํ•  ์ˆ˜ ์žˆ๋‹ค.

๋ฐ๋น„์•ˆ ๊ณ„์—ด์—์„œ๋Š”.deb ํŒŒ์ผ์„ GUI(๊ทธ๋ž˜ํ”ฝ๋ชจ๋“œ)์—์„œ๋Š” ๋งˆ์šฐ์Šค ์šฐํด๋ฆญ ํ›„ ํŒจํ‚ค์ง€ ์„ค์น˜ํ•˜๊ธฐ๋ฅผ ํด๋ฆญํ•˜์—ฌ ์„ค์น˜๊ฐ€ ๊ฐ€๋Šฅํ•˜๊ณ ,
ํ˜น์€ ํ„ฐ๋ฏธ๋„์—์„œ dpkg๋ผ๋Š” ๋ช…๋ น์–ด๋ฅผ ์ด์šฉํ•˜์—ฌ ์„ค์น˜๊ฐ€ ๊ฐ€๋Šฅํ•˜๋‹ค.

dpkg๋Š” ๋ฐ๋น„์•ˆ ํŒจํ‚ค์ง€ ๊ด€๋ฆฌ ์‹œ์Šคํ…œ์˜ ๊ธฐ์ดˆ๊ฐ€ ๋˜๋Š” ์†Œํ”„ํŠธ์›จ์–ด์ด๋‹ค. 
dpkg ๋ช…๋ น์–ด๊ฐ€ .deb ํŒจํ‚ค์ง€์˜ ์„ค์น˜, ์‚ญ์ œ, ์ •๋ณด ์ œ๊ณต์„ ์œ„ํ•ด ์‚ฌ์šฉ๋œ๋‹ค.
dpkg ๊ทธ ์ž์ฒด๋Š” ์ € ๋ ˆ๋ฒจ์˜ ๋„๊ตฌ์ด๋ฉฐ, APT์™€ ๊ฐ™์€ ๊ณ ๊ธ‰ ๋„๊ตฌ๋“ค์ด ๋ณต์žกํ•œ ํŒจํ‚ค์ง€ ๊ด€๊ณ„์™€ ํŒจํ‚ค์ง€๋ฅผ ์›๊ฒฉ์—์„œ ๋ฐ›์•„์˜ค๋Š” ๋“ฑ์˜ ์ผ์„ ํ•˜๊ฒŒ ๋œ๋‹ค. 

dpkg is the software at the base of the package management system in the free operating system Debian and its numerous derivatives. dpkg is used to install, remove, and provide information about .deb packages. dpkg itself is a low-level tool. 

์œˆ๋„์šฐ์—์„œ ์ž‘์—…ํ•œ ํŒŒ์ผ์„ ๋ผ์ฆˆ๋ฒ ๋ฆฌ๋กœ ์˜ฎ๊ธฐ๋Š” ๋ฐฉ๋ฒ•
1. ์ด๋ฉ”์ผ ์‚ฌ์šฉ


2. ์›๊ฒฉ์œผ๋กœ ๋ผ์ฆˆ๋ฒ ๋ฆฌ ํŒŒ์ด ์ ‘์†

3. ํŠน์ • ํ™ˆํŽ˜์ด์ง€(ex. ์นดํŽ˜)์— ํŒŒ์ผ์„ ์—…๋กœ๋“œํ•ด ๋‘๊ณ  http ํ”„๋กœํ† ์ฝœ์„ ์ด์šฉํ•˜์—ฌ ๋‹ค์šด๋กœ๋“œํ•œ๋‹ค.


(1) wget์„ ์ด์šฉํ•œ ๋‹ค์šด๋กœ๋“œ

wget <๋งํฌ์ฃผ์†Œ>

 

๋ฆฌ๋ˆ…์Šค ๋ฒ„์ „ ํŒŒ์ผ ์šฐ์ธก ๋งˆ์šฐ์Šค ํด๋ฆญ → ๋งํฌ ์ฃผ์†Œ ๋ณต์‚ฌ 

$ wget https://github.com/LightTable/LightTable/releases/download/0.8.1/lighttable-0.8.1-linux.tar.gz

(2) git clone์„ ์ด์šฉํ•œ ๋‹ค์šด๋กœ๋“œ

git: ํ˜‘์—…์šฉ์ด๋‹ค. git์„ ์ด์šฉํ•˜๋ฉด ๋ณ‘ํ•ฉ์˜ ๋ฌธ์ œ๋ฅผ ์ž๋™์œผ๋กœ ํ•ด๊ฒฐํ•ด ์ฃผ๋ฉฐ ๋ถ€๋ถ„์ ์œผ๋กœ ๋ณ€๊ฒฝ๋œ ๋ถ€๋ถ„์„ ํŒŒ์•…ํ•˜์—ฌ ์ž๋™์ ์œผ๋กœ ๋ณ‘ํ•ฉํ•ด ์ค€๋‹ค. ๋ฒ„์ „์„ ๊ด€๋ฆฌํ•ด ์ฃผ๋Š” ์—ญํ• ๋„ ํ•œ๋‹ค. 

gitHub
: ๋ฒ„์ „ ์ œ์–ด ๋ฐ ๊ณต๋™ ์ž‘์—…์„ ์œ„ํ•œ ์ฝ”๋“œ ํ˜ธ์ŠคํŒ… ํ”Œ๋žซํผ

๋‹ค๋ฅธ ์‚ฌ๋žŒ์—๊ฒŒ ๊ณต๊ฐœ ๊ฐ€๋Šฅ, ํ”ผ๋“œ๋ฐฑ๋ฐ›์„ ์ˆ˜ ์žˆ๋‹ค, ์˜คํ”ˆ ์†Œ์Šค์ด๋ฏ€๋กœ ๋ˆ„๊ตฌ๋‚˜ ๋‹ค์šด๋กœ๋“œํ•˜์—ฌ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋‹ค.
์˜คํ”ˆ ์†Œ์Šค๋กœ ๊ณต๊ฐœํ•˜๋Š” ์ด์œ : ์‚ฌํšŒ์ ์ธ ๊ณตํ—Œ, ๋ˆ„๊ตฐ๊ฐ€๊ฐ€ ์ด์–ด์„œ ํ”„๋กœ์ ํŠธ ๋งˆ๋ฌด๋ฆฌ, ๊ฒ€์ฆ๋ฐ›๊ธฐ 

git clone <url์ฃผ์†Œ>

https://github.com/szazo/DHT11_Python


(3) apt-get (Advanced Packaging Tool-get) ์ด์šฉํ•˜๊ธฐ

sudo apt-get install ํ”„๋กœ๊ทธ๋žจ๋ช…


apt-get
: ํ”„๋กœ๊ทธ๋žจ ํŒจํ‚ค์ง€๋ฅผ ๋‹ค์šด๋กœ๋“œํ•˜๊ณ  ์„ค์น˜ํ•˜๋Š” ๋ช…๋ น์–ด

apt-get์„ ์ด์šฉํ•˜๋Š” ๊ฒƒ: ๋ฐ๋น„์•ˆ์ด ์ œ๊ณตํ•˜๋Š” ๊ณต์‹ ์ €์žฅ์†Œ๋ฅผ ์ด์šฉํ•˜๋Š” ๊ฒƒ์ด๋ฉฐ, ๋‹ค์šด๋กœ๋“œ๋ฅผ ํ•  ์ˆ˜ ์žˆ๋Š” ๊ฒƒ๋ฟ๋งŒ ์•„๋‹ˆ๋ผ ์ž๋™์œผ๋กœ ์„ค์น˜๊ฐ€ ์ง„ํ–‰๋˜๋ฉด์„œ ํ™˜๊ฒฝ๋ณ€์ˆ˜ ์„ค์ •, ํŒŒ์ผ ๋งํฌ ์„ค์ •, ๋ฐ๋ชฌ ์„ค์ • ๋“ฑ์ด ์ž๋™์œผ๋กœ ๋˜๋ฏ€๋กœ ํŽธ๋ฆฌํ•˜๋‹ค. 

๋ฐ๋ชฌ์ด๋ž€ ๋ฆฌ๋ˆ…์Šค ์‹œ์Šคํ…œ์ด ์ฒ˜์Œ ๊ฐ€๋™๋  ๋•Œ ์‹คํ–‰๋˜๋Š” ๋ฐฑ๊ทธ๋ผ์šด๋“œ ํ”„๋กœ์„ธ์Šค์˜ ์ผ์ข…์ด๋ฉฐ, ์‚ฌ์šฉ์ž์˜ ์š”์ฒญ์„ ๊ธฐ๋‹ค๋ฆฌ๊ณ  ์žˆ๋‹ค๊ฐ€ ์š”์ฒญ์ด ๋ฐœ์ƒํ•˜๋ฉด ์ด์— ์ ์ ˆํžˆ ๋Œ€์‘ํ•˜๋Š” ๋ฆฌ์Šค๋„ˆ์™€ ๊ฐ™์€ ์—ญํ• ์„ ํ•œ๋‹ค. ์ฆ‰, ๋ฉ”๋ชจ๋ฆฌ์— ์ƒ์ฃผํ•˜๋ฉด์„œ ํŠน์ • ์š”์ฒญ์ด ์˜ค๋ฉด ์ฆ‰์‹œ ๋Œ€์‘ ํ•  ์ˆ˜ ์žˆ๋„๋ก ๋Œ€๊ธฐ ์ค‘์ธ ํ”„๋กœ์„ธ์Šค๋ฅผ ๋งํ•œ๋‹ค.
์ฐธ๊ณ : https://valuefactory.tistory.com/229

apt-get์„ ํ†ตํ•ด ๋‹ค์šด๋กœ๋“œ๋˜๋Š” ์ €์žฅ์†Œ ๋ชฉ๋ก์€ ์•„๋ž˜์™€ ๊ฐ™๋‹ค.

nano /etc/apt/sources.list

sources.list ํŒŒ์ผ ๋‚ด๋ถ€

- ๋ผ์ฆˆ๋น„์•ˆ ์ €์žฅ์†Œ๋กœ ๋ธŒ๋ผ์šฐ์ €๋ฅผ ์—ด์–ด์„œ ์ด๋™ํ•œ๋‹ค.
http://raspbian.raspberrypi.org/raspbian/

๋ผ์ฆˆ๋น„์•ˆ ์ €์žฅ์†Œ ๊ฒฝ๋กœ 1
๋ผ์ฆˆ๋น„์•ˆ ์ €์žฅ์†Œ ๊ฒฝ๋กœ 5

- apt-get์„ ์ด์šฉํ•˜์—ฌ ๋‹ค์šด๋กœ๋“œํ•œ๋‹ค.

$ sudo apt-get install scrot

- scrot ํ”„๋กœ๊ทธ๋žจ์€ ํ™”๋ฉด ์บก์ณ ํ”„๋กœ๊ทธ๋žจ์ด๋‹ค. 
๋‹ค์Œ ๋ช…๋ น์–ด๋ฅผ ์ž…๋ ฅํ•œ ๋’ค ๋“œ๋ž˜๊ทธ๋ฅผ ํ•˜๋ฉด home/pi ๊ฒฝ๋กœ์— ์ž๋™์œผ๋กœ ์‚ฌ์ง„์ด ์ €์žฅ๋œ๋‹ค. 

$ scrot -s

4.9 ํŒŒ์ผ ์••์ถ• (tar: Tape ARchiver)

๋ผ์ฆˆ๋น„์•ˆ์—์„œ tar ๋ช…๋ น์–ด๋ฅผ ์ด์šฉํ•˜์—ฌ ํŒŒ์ผ์„ ์••์ถ•ํ•˜๊ณ  ์••์ถ•์„ ํ•ด์ œํ•  ์ˆ˜ ์žˆ๋‹ค.
tar
๋กœ ์••์ถ•ํ•˜๋Š” ๋ฐฉ์‹์—๋Š” ๋‘ ๊ฐ€์ง€๊ฐ€ ์žˆ๋‹ค.

tar๋กœ ์••์ถ•: ํŒŒ์ผ๊ณผ ํด๋”๋ฅผ ํ•˜๋‚˜์˜ ํŒŒ์ผ๋กœ ๋ฌถ์–ด์ฃผ๋Š” ์œ ํ‹ธ๋ฆฌํ‹ฐ์ด๋‹ค. ์ฃผ๋กœ ๋ฐฑ์—… ์šฉ๋„๋กœ ์‚ฌ์šฉํ•œ๋‹ค.
tar.gz๋กœ ์••์ถ•: ํŒŒ์ผ ๋ฐ ํด๋”๋“ค์„ ๋ฌถ์–ด์„œ ์••์ถ•ํ•œ๋‹ค.

a TAR file creates one archive file out of multiple files without compressing them,
while the GZ file format compresses a file without creating an archive
.

tar
tar -cvf: ์••์ถ•
tar -xvf: ์••์ถ• ํ•ด์ œ

tar.gz
tar.gz -cvf: ์••์ถ•
tar.gz -xvf: ์••์ถ• ํ•ด์ œ
 
(1) tar ์••์ถ•
$ mikdir aaa
$ tar -cvf aaa.tar aaa #aaa ํด๋”๋ฅผ aaa.tar๋กœ ์••์ถ•

(2) tar ์••์ถ• ํ•ด์ œ

$ tar -xvf aaa.tar # ํ˜„์žฌ ๊ฒฝ๋กœ์— aaa.tar ํŒŒ์ผ ์••์ถ•ํ’€๊ธฐ


(3) tar.gz ์••์ถ•

$ mkdir ccc
$ tar -zcvf ccc.tar.gz ccc # ccc ํด๋”๋ฅผ ccc.tar.gz๋กœ ์••์ถ•


(4) tar.gz ์••์ถ• ํ•ด์ œ

$ tar - zxvf ccc.tar.gz # ํ˜„์žฌ ๊ฒฝ๋กœ์— aaa.tar.gz ํŒŒ์ผ ์••์ถ•ํ’€๊ธฐ


(5) zip ์••์ถ• ํ•ด์ œ

$ sudo apt-get install unzip
$ unzip ํŒŒ์ผ๋ช…

 

728x90
๋ฐ˜์‘ํ˜•

'๐ŸŒณBootcamp Revision 2023โœจ > Raspberry Pi, Linux, Electronics Basics' ์นดํ…Œ๊ณ ๋ฆฌ์˜ ๋‹ค๋ฅธ ๊ธ€

[46] 230306 Ch. 5 ๋ผ์ฆˆ๋ฒ ๋ฆฌํŒŒ์ด GPIO ๋ฐ ์„ผ์„œ ํ™œ์šฉํ•˜๊ธฐ: 3. ์ดˆ์ŒํŒŒ์„ผ์„œ(HC-SR04) ์‹ค์Šต, 4. PIR(Passive Infrared Sensor) ์„ผ์„œ(HC-SR501) ์‹ค์Šต, 5. ์•„๋‚ ๋กœ๊ทธ ์‹ ํ˜ธ์™€ SPI(Serial Peripheral Interface) ํ†ต์‹  [K-๋””์ง€ํ„ธ ํŠธ๋ ˆ์ด๋‹ 4..  (0) 2023.03.06
[45] 230303 Ch. 5 ๋ผ์ฆˆ๋ฒ ๋ฆฌํŒŒ์ด GPIO ๋ฐ ์„ผ์„œ ํ™œ์šฉํ•˜๊ธฐ: 1. GPIO(General Purpose Input Output) ์ œ์–ด ๋ฐ ํ…Œ์ŠคํŠธ, 2. PWM(Pulse Width Modulation) ์ œ์–ด [K-๋””์ง€ํ„ธ ํŠธ๋ ˆ์ด๋‹ 45์ผ]  (0) 2023.03.03
[45] 230303 Ch. 4 ๋ผ์ฆˆ๋ฒ ๋ฆฌ ํŒŒ์ด๋ฅผ ์œ„ํ•œ ์ „์ž ๊ธฐ์ดˆ ๋ฐฐ์šฐ๊ธฐ: 1. ์•Œ๊ธฐ ์‰ฌ์šด ์ „์žํšŒ๋กœ, 2. ๋ฐ์ดํ„ฐ์‹œํŠธ์™€ ํšŒ๋กœ๋ฅผ ์ฐธ๊ณ ํ•˜์—ฌ ์ „์ž ๋ถ€ํ’ˆ ์•Œ์•„๋ณด๊ธฐ [K-๋””์ง€ํ„ธ ํŠธ๋ ˆ์ด๋‹ 45์ผ]  (0) 2023.03.03
[42] 230227 Ch. 1 ๋ผ์ฆˆ๋ฒ ๋ฆฌ ํŒŒ์ด ์‹œ์ž‘ํ•˜๊ธฐ: 1. ์‚ดํŽด๋ณด๊ธฐ, 2. ์‹ค์Šต ์ค€๋น„๋ฌผ, 3. SD Card Formatter๋กœ SD Card ํฌ๋งท์‹œํ‚ค๊ธฐ 4. ๋ผ์ฆˆ๋น„์•ˆ ๋‹ค์šด ๋ฐ SD ์นด๋“œ ์„ธํŒ…, 5. ๋ผ์ฆˆ๋น„์•ˆ ์‹คํ–‰ํ•˜๊ธฐ, 6 ๋ผ์ฆˆ๋ฒ ๋ฆฌ ํŒŒ์ด ํ™˜๊ฒฝ ์„ค์ •ํ•˜..  (0) 2023.02.27
Comments