'이것이 리눅스다' 책을 일고 공부하면서 느낀점과 공부하면서 조사하였던 관련된 자료를 PPT로 만든 것입니다. (this is Linux, this PPT has Many Things that Resource Related the Linux and other) 감사합니다. Thank you
'이것이 리눅스다' 책을 일고 공부하면서 느낀점과 공부하면서 조사하였던 관련된 자료를 PPT로 만든 것입니다. (this is Linux, this PPT has Many Things that Resource Related the Linux and other) 감사합니다. Thank you
Watch video on Youtube! : http://www.youtube.com/watch?v=aZDKyNtSqOo
장소 : 서울시 용산구 원효로 3가 53-5 청진 빌딩 10층 1004호 TERA TEC 사무실
시간 : 2010년 1월 30일 토요일 오후 2:00
발표 : 김성윤님, 강분도님, 노태상님 - 리눅스 커널 - 개요 및 이슈,
세미나 정보 : http://www.ubuntu.or.kr/viewtopic.php...
Place : TERA TEC Office, 1004, 10th floor, Cheongjin Bldg., Wonhyoro 3-ga, Yongsan-gu, Seoul, Korea
Time : 14:00, Saturday, 2010Y 1M 30D
Presentation : Kim Seongyun, Kang Bundo, Noh Taesang - Linux Kernel - Outline and issue
Seminar Info : http://www.ubuntu.or.kr/viewtopic.php...
About Ubuntu
Ubuntu is an ancient African word meaning 'humanity to others'.
It also means 'I am what I am because of who we all are'.
The Ubuntu operating system brings the spirit of Ubuntu to the world of computers.
http://www.ubuntu.com
About Ubuntu Korea Community
We want to be happy using Ubuntu.
'Korean Ubuntu User Forum' Welcomes your voluntary supports.
http://www.ubuntu-kr.org
리눅스 스터디 1회차 in KOSMOS
VM에 설치하므로 이미지 부분은 건너뛰세요.
on Onedrive:
https://onedrive.live.com/redir?resid=c4dd3c6db99e8d1a!11192&authkey=!ALtcH-dt9PGfl58&ithint=file%2cpptx
이 키노트에서는 기초적인 리눅스의 사용법에 대해 알려줍니다.
리눅스의 주 사용 용도인 date, cal 부터 git에 USB 디바이스 확인하는 명령어까지 소개합니다.
데비안 리눅스, 우분투 18.04 버전 기준으로 설명되었습니다. 또한 본 내용에서 특정 기업 명이나 특정 상표가 포함되었을 가능성이 있습니다. 하지만 이런 내용에는 고의성이 없음을 밝힙니다.
전체목차: https://netpple.github.io/docs/make-container-without-docker/
pid namespace는 컨테이너 안에서 독자적인 "process tree" / "process id 체계"를 제공합니다. 어떻게 가능한 것일까요? 이를 이해하기 위하여 proc filesystem과 pid 쳬계에 대해서 얘기합니다. 그리고 프로세스 트리의 최상위인 특별한 프로세스 pid1 에 대하여도 다룹니다
Watch video on Youtube! : http://www.youtube.com/watch?v=aZDKyNtSqOo
장소 : 서울시 용산구 원효로 3가 53-5 청진 빌딩 10층 1004호 TERA TEC 사무실
시간 : 2010년 1월 30일 토요일 오후 2:00
발표 : 김성윤님, 강분도님, 노태상님 - 리눅스 커널 - 개요 및 이슈,
세미나 정보 : http://www.ubuntu.or.kr/viewtopic.php...
Place : TERA TEC Office, 1004, 10th floor, Cheongjin Bldg., Wonhyoro 3-ga, Yongsan-gu, Seoul, Korea
Time : 14:00, Saturday, 2010Y 1M 30D
Presentation : Kim Seongyun, Kang Bundo, Noh Taesang - Linux Kernel - Outline and issue
Seminar Info : http://www.ubuntu.or.kr/viewtopic.php...
About Ubuntu
Ubuntu is an ancient African word meaning 'humanity to others'.
It also means 'I am what I am because of who we all are'.
The Ubuntu operating system brings the spirit of Ubuntu to the world of computers.
http://www.ubuntu.com
About Ubuntu Korea Community
We want to be happy using Ubuntu.
'Korean Ubuntu User Forum' Welcomes your voluntary supports.
http://www.ubuntu-kr.org
리눅스 스터디 1회차 in KOSMOS
VM에 설치하므로 이미지 부분은 건너뛰세요.
on Onedrive:
https://onedrive.live.com/redir?resid=c4dd3c6db99e8d1a!11192&authkey=!ALtcH-dt9PGfl58&ithint=file%2cpptx
이 키노트에서는 기초적인 리눅스의 사용법에 대해 알려줍니다.
리눅스의 주 사용 용도인 date, cal 부터 git에 USB 디바이스 확인하는 명령어까지 소개합니다.
데비안 리눅스, 우분투 18.04 버전 기준으로 설명되었습니다. 또한 본 내용에서 특정 기업 명이나 특정 상표가 포함되었을 가능성이 있습니다. 하지만 이런 내용에는 고의성이 없음을 밝힙니다.
전체목차: https://netpple.github.io/docs/make-container-without-docker/
pid namespace는 컨테이너 안에서 독자적인 "process tree" / "process id 체계"를 제공합니다. 어떻게 가능한 것일까요? 이를 이해하기 위하여 proc filesystem과 pid 쳬계에 대해서 얘기합니다. 그리고 프로세스 트리의 최상위인 특별한 프로세스 pid1 에 대하여도 다룹니다
The Bourne-Again Shell by Chet Ramey
from The Architecture of Open Source Applications I (http://aosabook.org/en/bash.html)
@ Eva
Focus on Bash as interpreter, rather than System shell.
인터프리터 동작에 초점을 맞춰 진행했습니다.
In computing, a denial-of-service (DoS) attack is an attempt to make a machine or network resource unavailable to its intended users, such as to temporarily or indefinitely interrupt or suspend services of a host connected to the Internet - Wikipedia
[IoT] MAKE with Open H/W + Node.JS - 2ndPark Jonggun
IoT 시대에 Opensource H/W 와 NodeJS 를 이용하여 누구나 나만의 H/W + S/W + Service 를 만들기 위한 교육 과정을 만들어 보았습니다.
상상했던 아이디어를 Raspberry Pi 기반으로 나만의 IoT 제품을 현실로 만들어 보세요.
Lesson 1 - Introduction : IoT개요, Opensource H/W, 라즈베리파이 기초
Lesson 2 - Linux : Raspberry Pi 에서 리눅스 활용하기
Lesson 3 - Node.JS : Raspberry Pi 에서 Node.JS 로 프로그래밍 하기
Lesson 4 - Sensor : GPIO 를 Node.JS 로 동작시켜 센서 제어하기
Lesson 5 - Project : Raspberry Pi 로 스마트폰 + 무선 IoT 오디오 제작
챕터가 완성되는대로 추가적으로 공유하겠습니다.
Circulus Site - http://www.circul.us
Circulus Group - http://group.circul.us
2. 오늘 다룰 이야기
• putty를 통한 windows 환경에서 terminal 접속
• Linux terminal 사용시 필요한 명령들
• Terminal 환경에서 파일을 다뤄보기
LinuxTerminal
1
3. 들어가기에 앞서
• Linux terminal의 장점은?
공짜다!
쉽게 설치되는 시스템/프로그래밍 관련 패키지들
알면 알 수록 일 처리의 속도가 빨라짐
효율적인 원격 작업(terminal 이용)
• 그렇다면 단점은?
Windows의 장점을 가지고 있지 못함(단언컨데, Windows는…)
LinuxTerminal
2
4. iPutty - A SSH Client for Windows
• https://bitbucket.org/daybreaker/iputty/wiki/Home
LinuxTerminal
3
7. 실습 자료 다운 받기
• 다운 받는 방법
$ wget http://libe.lavida.us/linux.zip
…
Saving to: ‘linux.zip’
100%[=====================================>] 6,156 --.-K/s in 0s
2013-09-05 21:11:10 (81.0 MB/s) - ‘linux.zip’ saved [6156/6156]
LinuxTerminal
6
8. 압축 풀고 이동하기
$ unzip linux.zip
…
$ pwd
/home/hhjeong/
$ cd linux_seminar
$ ls –l
…
$ pwd
/home/hhjeong/linux_seminar
LinuxTerminal
7
linux_ 치고 tab을 누르면?
9. txt 파일을 만들어 봅시다!
$ cat > first_file.txt
이것은 제가 처음 만든 파일입니다!
내용은 아무렇게 입력을 해보세요~
그리고 마지막에는 ctrl+d 를 눌러주세요.
ctrl누른 상태에서 d를 눌러주시면 됩니다.
LinuxTerminal
8
10. 파일 내용 보기
$ cat first_file.txt
이것은 제가 처음 만든 파일입니다!
내용은 아무렇게 입력을 해보세요~
그리고 마지막에는 ctrl+d 를 눌러주세요.
ctrl누른 상태에서 d를 눌러주시면 됩니다.
$ head -2 first_file.txt
이것은 제가 처음 만든 파일입니다!
내용은 아무렇게 입력을 해보세요~
$ tail -1 first_file.txt
ctrl누른 상태에서 d를 눌러주시면 됩니다.
LinuxTerminal
9
11. 덧붙이기
$ cat >> first_file.txt
이어서 입력해봐요
$ cat first_file.txt
이것은 제가 처음 만든 파일입니다!
내용은 아무렇게 입력을 해보세요~
그리고 마지막에는 ctrl+d 를 눌러주세요.
ctrl누른 상태에서 d를 눌러주시면 됩니다.
이어서 입력해봐요
LinuxTerminal
10
12. 여기서 잠깐
Q) 그럼 문서 편집할 때는 어떻게 하나요?
A) 일반적으로 vi/emacs등의 에디터를 사용합니다.
개인적으로는 vi를 추천하고, vim을 깔아 사용하는 것이 좋습니다.
LinuxTerminal
11http://unix.stackexchange.com/
13. 여기서 잠깐
Q) Vi를 공부하려고 합니다. 어떻게 하는게 좋을까요?
A) 다음을 이용하시면 좋습니다.
http://likelion.net/class01/likelion01_vim_seminar.pdf
http://choiyongchol.com/vim/go
LinuxTerminal
12
14. 여기서 잠깐(계속)
• 읽기 귀찮은 사람들을 위한 간단 요약
vim 파일이름
파일이 있으면 편집, 없을 경우 새로운 파일 생성
i키를 누르면 VS와 메모장 처럼 편집 가능(입력 모드)
Esc를 누르면 다시 복귀 편집 불가(일반 모드)
:를 누르면 저장, 다른 문서 편집등이 가능(명령 모드)
:q(종료)
:w(저장)
:e 다른 파일(다른 파일 편집)
:e . (현재 디렉토리 탐색)
이 말고도 정말 다양한 기능이 많습니다!
vim 쓴지 9년 짼데 아직도 모르는 기능이 많아요.
물론 쓰려면 당연히 공부를 해야…
LinuxTerminal
13
15. 그렇다면 cat는 쓸모가 없나요?
• 때때로 쓸모가 있습니다.
윈도의 텍스트 문서를 사용하는 terminal을 이용해 저장하기
1. putty 선택
2. $ cat > filename
3. 윈도 내에서 텍스트 복사
4. putty 선택 후에 마우스 우 클릭
5. ctrl+d
만약, 안 될 경우에는 enter를 친 다음 ctrl+d
LinuxTerminal
14
16. 원래 위치로 돌아가기
$ cd .. 혹은 $ cd ~
$ pwd
/home/hhjeong/
LinuxTerminal
15
18. 다시 한번 더!
• 다시 실습 자료를 다운 받아 봅시다!
• 다음의 파일을 다운 받아 봅시다.
http://likelion.net/class01/likelion01_vim_seminar.pdf
저장될 디렉토리의 위치 : /home/username/linux_seminar
저장되는 파일의 이름 : vim.pdf
힌트 : $ wget --help | more
LinuxTerminal
17
19. 앞의 문제의 정답
$ wget --help
…
Download:
-t, --tries=NUMBER set number of retries to NUMBER (0 unlimits).
--retry-connrefused retry even if connection is refused.
-O, --output-document=FILE write documents to FILE.
-nc, --no-clobber skip downloads that would download to
$ wget http://likelion.net/class01/likelion01_vim_seminar.pdf -O vim.pdf
LinuxTerminal
18
21. 알면 좋은 Linux 특징
• file/directory 대소문자 구분(case-sensitive)
• 프로그램 실행 방법
./path/to/your/excutable/file
/usr/bin에 있을 경우 file명 그대로
예시 : python hello.py
Background 실행
command-line &
접속을 종료 해도 해당 process는 살아 남음
LinuxTerminal
20
22. 기본 명령(이것만 해도 해커처럼 보
임!)
LinuxTerminal
21
명령 용도 예시
ls 현 위치의 file과 directory listing
$ ls -a
$ ls -al
$ ls -alh
mkdir directory 만들기 $ mkdir new_folder
cd directory 특정 directory로 이동
$ cd other_folder
$ cd /home/hhjeong/Workspace
$ cd ~/Workspace
cd 혹은 cd ~ change to home-directory
cd .. Parent directory로 이동
pwd 현 위치 표시
23. 기본 명령(계속)
LinuxTerminal
22
명령 용도 예시
cp src dest 파일을 복사하기
cp *.txt /etc/hello/
cp a.txt b.txt
cp * /home/world/ -R
mv src dest 파일을 이동시키거나, 이름 변경
mv hello.txt world.txt
mv * ~/world/
mv * ../dest/ -R
rm file 파일 삭제 rm a.out
rmdir directory 디렉토리 삭제(빈 디렉토리만 가능) rmdir /home/username/foo/
wc file 파일의 단어 수/문자 수/줄 수 세기
wc a.txt
wc –l a.txt
wc –c a.txt
wc –w a.txt
24. 응용 하기
• 패키지 설치하기
• 압축 풀기
• 프로세스 죽이기
• 리다이렉션
• 파일 검색하기
• 문자열 검색하기
• 파일을 입맛대로 수정하기
• bash에서 for loop
• 파일 나누고 합치기
LinuxTerminal
23
25. 패키지 설치하기
• In CentOS
$ yum install 패키지명
• In Debian(or Ubuntu)
$ apt-get install 패키지명
LinuxTerminal
24
26. 패키지 이름을 모른다면?
• Google it!
검색 키워드 “CentOS 패키지명”
검색 키워드 “Ubuntu 패키지명“
• 버전을 같이 넣어주면 검색의 완성! 보
다 정확한 결과!
LinuxTerminal
25
30. 파일 위치 검색하기
$ find . -name “*.txt”
$ find / -name “[cb]ar???_*.avi”
LinuxTerminal
29
31. 문제
• /usr/bin/ 폴더 안의 py 라는 접두어(prefix)를 가지는 모든
파일들을 찾아보시오
LinuxTerminal
30
32. 파일 내에서 문자열 검색
$ grep word filename
$ grep word *.txt
$ grep word *.txt –r
$ grep -e “V66 “ interaction.txt > V66.txt
Pattern안에 tab 입력시엔 ctrl+v 다음 tab
LinuxTerminal
31
33. awk를 이용, 특정 열 뽑기
$ awk ‘{print $1, $2}’ tcga.txt
$ awk ‘{print $1}’ tcga.txt | head -10
$ awk ‘{print $1}’ tcga.txt > tcga_id.txt
LinuxTerminal
32
36. 문제
• interaction.txt 의 구조
SNP1, SNP2, …, 측정 값1, 측정 값2
SNP수가 2개 혹은 3개 존재
• SNP 수가 2개인 행을 int2.txt에 저장, SNP 수가 3개인 행을
int3.txt에 저장
단, 측정 값 2는 제외하고 저장
• 각 파일을 측정 값의 내림 차순 정렬
• 두 파일을 합쳐서 int_all.txt 파일 생성
LinuxTerminal
35
37. for loop 작성하기
$ vim for.sh
#!/bin/bash
for num in 1 2 3 4 5 6 7
do
echo $num
done
LinuxTerminal
36
44. Linux terminal을 더 잘 쓰고 싶다
면?
• 다음의 세 파일을 설정해보자!
~/.vimrc
https://github.com/skwp/dotfiles/blob/master/vimrc
~/.screenrc
http://forcecore.tistory.com/604
• 다음 사이트도 참고해보자!
http://theyearlyprophet.com/love-your-terminal.html
LinuxTerminal
43