1-Ch03

Similar documents
휠세미나3 ver0.4

Microsoft PowerPoint - comp_prac_081223_2.pptx

01Àå

LXR 설치 및 사용법.doc

강의10

슬라이드 1

/chroot/lib/ /chroot/etc/

6주차.key

Page 2 of 6 Here are the rules for conjugating Whether (or not) and If when using a Descriptive Verb. The only difference here from Action Verbs is wh

PowerChute Personal Edition v3.1.0 에이전트 사용 설명서

GNU/Linux 1, GNU/Linux MS-DOS LOADLIN DOS-MBR LILO DOS-MBR LILO... 6

ORANGE FOR ORACLE V4.0 INSTALLATION GUIDE (Online Upgrade) ORANGE CONFIGURATION ADMIN O

Page 2 of 5 아니다 means to not be, and is therefore the opposite of 이다. While English simply turns words like to be or to exist negative by adding not,

µðÇÃ24-Ç¥Áö´Ü¸é

CD-RW_Advanced.PDF

K7VT2_QIG_v3

하나님의 선한 손의 도우심 이세상에서 가장 큰 축복은 하나님이 나와 함께 하시는 것입니다. 그 이 유는 하나님이 모든 축복의 근원이시기 때문입니다. 에스라서에 보면 하나님의 선한 손의 도우심이 함께 했던 사람의 이야기 가 나와 있는데 에스라 7장은 거듭해서 그 비결을

MPLAB C18 C

¹Ìµå¹Ì3Â÷Àμâ

PowerPoint 프레젠테이션

PRO1_09E [읽기 전용]

참고 금융분야 개인정보보호 가이드라인 1. 개인정보보호 관계 법령 개인정보 보호법 시행령 신용정보의 이용 및 보호에 관한 법률 시행령 금융실명거래 및 비밀보장에 관한 법률 시행령 전자금융거래법 시행령 은행법 시행령 보험업법 시행령 자동차손해배상 보장법 시행령 자본시장과

untitled

Solaris Express Developer Edition

歯 조선일보.PDF

<32B1B3BDC32E687770>

(Exposure) Exposure (Exposure Assesment) EMF Unknown to mechanism Health Effect (Effect) Unknown to mechanism Behavior pattern (Micro- Environment) Re


Sena Technologies, Inc. HelloDevice Super 1.1.0

011°�³²°¡Á·½Å¹®-ÃÖÁ¾¼öÁ¤

본문서는 초급자들을 대상으로 최대한 쉽게 작성하였습니다. 본문서에서는 설치방법만 기술했으며 자세한 설정방법은 검색을 통하시기 바랍니다. 1. 설치개요 워드프레스는 블로그 형태의 홈페이지를 빠르게 만들수 있게 해 주는 프로그램입니다. 다양한 기능을 하는 플러그인과 디자인

28 THE ASIAN JOURNAL OF TEX [2] ko.tex [5]

네이버 오픈소스 세미나 key

PowerPoint 프레젠테이션


untitled

2011´ëÇпø2µµ 24p_0628

Microsoft PowerPoint - 07-EDU-LinuxUser-3.ppt

Stage 2 First Phonics

10X56_NWG_KOR.indd

MySQL-Ch10

C++-¿Ïº®Çؼ³10Àå


4. #include <stdio.h> #include <stdlib.h> int main() { functiona(); } void functiona() { printf("hihi\n"); } warning: conflicting types for functiona

DE1-SoC Board

H3050(aap)

1

#중등독해1-1단원(8~35)학

2 min 응용 말하기 01 I set my alarm for It goes off. 03 It doesn t go off. 04 I sleep in. 05 I make my bed. 06 I brush my teeth. 07 I take a shower.

chapter4

희망풍차는 우리 주변의 소외된 어린이, 어르신, 다문화가족, 북한이주민과의 결연을 통해 생계, 의료, 주거, 교육 등 대상자에게 꼭 필요한 도움을 제공하는 국민참여형 통합적 맞춤형 휴먼 서비스입니다.

04-다시_고속철도61~80p

Hi-MO 애프터케어 시스템 편 5. 오비맥주 카스 카스 후레쉬 테이블 맥주는 천연식품이다 편 처음 스타일 그대로, 부탁 케어~ Hi-MO 애프터케어 시스템 지속적인 모발 관리로 끝까지 스타일이 유지되도록 독보적이다! 근데 그거 아세요? 맥주도 인공첨가물이

PowerPoint Presentation

1. efolder 시스템구성 A. DB B. apache - mod-perl - PHP C. SphinxSearch ( 검색서비스 ) D. File Storage 2. efolder 설치순서 A. DB (MySQL) B. efolder Service - efolder

ETL_project_best_practice1.ppt

Microsoft PowerPoint - chap9 [호환 모드]

PowerPoint 프레젠테이션

다. 최신 버전의 rpm 패키지 버전을 다운로드해 다음과 같이 설 치한다. 단 debuginfo의 rpm 패키지는 설치할 필요가 없다. 하기 위한 옵션이고, init는 저장소를 초기화하기 위한 cvs 명령 어이다. - 새로 설치한 경우 : rpm -ivh cvs* -

현대영화연구

5/12¼Ò½ÄÁö


,,,,,, (41) ( e f f e c t ), ( c u r r e n t ) ( p o t e n t i a l difference),, ( r e s i s t a n c e ) 2,,,,,,,, (41), (42) (42) ( 41) (Ohm s law),

LCD Display

1. exit logout 하는 command 는아주간단하다. exit 을커맨드에서입력하고 return 키를누르면 logout 된다. 2. ls & command option 현재 directory 에서 file 의 list 를보는명령어, 즉 DOS 에서의 dir 에해

목차 BUG offline replicator 에서유효하지않은로그를읽을경우비정상종료할수있다... 3 BUG 각 partition 이서로다른 tablespace 를가지고, column type 이 CLOB 이며, 해당 table 을 truncate

농심-내지


13주-14주proc.PDF

단위: 환경정책 형산강살리기 수중정화활동 지원 10,000,000원*90%<절감> 형산강살리기 환경정화 및 감시활동 5,000,000원*90%<절감> 9,000 4, 민간행사보조 9,000 10,000 1,000 자연보호기념식 및 백일장(사생,서예)대회 10

<B1E2C8B9BEC828BFCFBCBAC1F7C0FC29322E687770>

Microsoft PowerPoint - unix02.ppt [호환 모드]

- 2 -

소개 TeraStation 을 구입해 주셔서 감사합니다! 이 사용 설명서는 TeraStation 구성 정보를 제공합니다. 제품은 계속 업데이트되므로, 이 설명서의 이미지 및 텍스트는 사용자가 보유 중인 TeraStation 에 표시 된 이미지 및 텍스트와 약간 다를 수

본문01

Copyright 2004 Sun Microsystems, Inc Network Circle, Santa Clara, CA U.S.A..,,. Sun. Sun. Berkeley BSD. UNIX X/Open Company, Ltd.. Sun, Su

11¹Ú´ö±Ô

<C7CFB4C3B0F8BFF828C0FCC7CFC1F6B8F8C7D1C6EDC1F6292D31302E3128C3D6C1BE292D31302E31342E687770>

<BABBB9AE2E687770>

¹Ì¼ú-°¢·ÐÁß¿ä³»¿ëb74öÁ¤2š

#Ȳ¿ë¼®

1_2•• pdf(••••).pdf

3항사가 되기 위해 매일매일이 시험일인 듯 싶다. 방선객으로 와서 배에서 하루 남짓 지내며 지내며 답답함에 몸서리쳤던 내가 이제는 8개월간의 승선기간도 8시간같이 느낄 수 있을 만큼 항해사로써 체질마저 변해가는 듯해 신기하기도 하고 한편으론 내가 생각했던 목표를 향해

May 2014 BROWN Education Webzine vol.3 감사합니다. 그리고 고맙습니다. 목차 From Editor 당신에게 소중한 사람은 누구인가요? Guidance 우리 아이 좋은 점 칭찬하기 고맙다고 말해주세요 Homeschool [TIP] Famil

2힉년미술

1) 음운 체계상의 특징 음운이란 언어를 구조적으로 분석할 때, 가장 작은 언어 단위이다. 즉 의미분화 를 가져오는 최소의 단위인데, 일반적으로 자음, 모음, 반모음 등의 분절음과 음장 (소리의 길이), 성조(소리의 높낮이) 등의 비분절음들이 있다. 금산방언에서는 중앙

09김정식.PDF

0125_ 워크샵 발표자료_완성.key

112초등정답3-수학(01~16)ok

목차도비라

라즈베리파이 프로그래밍_130912(최종).indd

Something that can be seen, touched or otherwise sensed

Remote UI Guide

2 공제회 소식 노후자금, 매달 연금처럼 받으세요 신용 등급 세분화 1~2등급 1000만원 확대 회원대여 이용 한도 변경 장기저축급여 분할급여금 낮은 세율로 높은 실수령액 시중 상품보다 안정성 높아 퇴직 시점 한 번만 신청 가능 한국교직원공제회의 연금형 상품 장기저축급

별지 제10호 서식

퇴좈저널36호-4차-T.ps, page Preflight (2)

한국외국어대학교 세계와 만나는 가장 빠른 길 한국외대는 진리( 眞 理 ), 평화( 平 和 ), 창조( 創 造 )의 창학 정신을 바탕으로 국가와 세계 발전에 기여할 수 있는 잠재력을 지닌 인재를 선발하고자 노력하고 있습니다. 자주적 탐구인 합리적 사고 폭넓은 지식 정심대

우리나라의 전통문화에는 무엇이 있는지 알아봅시다. 우리나라의 전통문화를 체험합시다. 우리나라의 전통문화를 소중히 여기는 마음을 가집시다. 5. 우리 옷 한복의 특징 자료 3 참고 남자와 여자가 입는 한복의 종류 가 달랐다는 것을 알려 준다. 85쪽 문제 8, 9 자료

상품 전단지

::: 해당사항이 없을 경우 무 표시하시기 바랍니다. 검토항목 검 토 여 부 ( 표시) 시 민 : 유 ( ) 무 시 민 참 여 고 려 사 항 이 해 당 사 자 : 유 ( ) 무 전 문 가 : 유 ( ) 무 옴 브 즈 만 : 유 ( ) 무 법 령 규 정 : 교통 환경 재

Transcription:

Chapter 3 3 Linux Linux 106

Chapter 3 1 Linux Part 1 107

Part Example> [root@kugstone /etc]# shutdown - Usage: shutdown [-akrhfnc] [-t secs] time [warning message] -a: use /etc/shutdown.allow -k: don t really shutdown, only warn. -r: reboot after shutdown. -h: halt after shutdown. -f: do a fast reboot (skip fsck). -F: Force fsck on reboot. -n: do not go through init but go down real fast. -c: cancel a running shutdown. -t secs: delay between warning and kill signal. ** the time argument is mandatory! (try now ) ** [root@kugstone /etc]# shutdown -k -t 120 disk replacing job 108

Chapter 3 Part 1 [root@kugstone /etc]# cat /etc/inittab # # inittab This file describes how the INIT process should set up # the system in a certain run-level. # # Author: Miquel van Smoorenburg, <miquels@drinkel.nl. mugnet.org> # Modified for RHS Linux by Marc Ewing and Donnie Barnes # # Default runlevel. The runlevels used by RHS are: # 0 - halt (Do NOT set initdefault to this) # 1 - Single user mode # 2 - Multiuser, without NFS (The same as 3, if you do not have networking) # 3 - Full multiuser mode # 4 - unused # 5 - X11 # 6 - reboot (Do NOT set initdefault to this) # id:5:initdefault: # System initialization. 109

Part si::sysinit:/etc/rc.d/rc.sysinit l0:0:wait:/etc/rc.d/rc 0 l1:1:wait:/etc/rc.d/rc 1 l2:2:wait:/etc/rc.d/rc 2 l3:3:wait:/etc/rc.d/rc 3 l4:4:wait:/etc/rc.d/rc 4 l5:5:wait:/etc/rc.d/rc 5 l6:6:wait:/etc/rc.d/rc 6 # Things to run in every runlevel. ud::once:/sbin/update # Trap CTRL-ALT-DELETE ca::ctrlaltdel:/sbin/shutdown -t3 -r now # When our UPS tells us power has failed, assume we have a few minutes # of power left. Schedule a shutdown for 2 minutes from now. # This does, of course, assume you have powerd installed and your # UPS connected and working correctly. pf::powerfail:/sbin/shutdown -f -h +2 Power Failure; System Shutting Down # If power was restored before the shutdown kicked in, cancel it. pr:12345:powerokwait:/sbin/shutdown -c Power Restored; Shutdown Cancelled # Run gettys in standard runlevels 1:2345:respawn:/sbin/mingetty tty1 2:2345:respawn:/sbin/mingetty tty2 3:2345:respawn:/sbin/mingetty tty3 4:2345:respawn:/sbin/mingetty tty4 5:2345:respawn:/sbin/mingetty tty5 6:2345:respawn:/sbin/mingetty tty6 # Run xdm in runlevel 5 # xdm is now a separate service x:5:respawn:/etc/x11/prefdm -nodaemon [root@kugstone /etc]# 110

Chapter 3 [root@kugstone /etc]# shutdown -y -i6 Part 1 2 Linux [kugstone@kugstone /]$ rm -r /tmp rm: remove write-protected file /tmp/install.log? y rm: cannot unlink /tmp/install.log : Operation not permitted rm: directory /tmp/.mozilla is write protected; descend into it anyway? y rm: cannot change to directory /tmp/.mozilla : Permission denied rm: directory /tmp/.gnome is write protected; descend into it anyway? y rm: cannot change to directory /tmp/.gnome : Permission denied rm: directory /tmp/.gnome_private is write protected; descend into it anyway? ~ ~ 111

Part [root@kugstone /etc]# su root password: [root@kugstone /etc]# T I P [root@kugstone /etc]# cat /etc/passwd root:x:0:0:root:/root:/bin/bash bin:x:1:1:bin:/bin: daemon:x:2:2:daemon:/sbin: adm:x:3:4:adm:/var/adm: lp:x:4:7:lp:/var/spool/lpd: sync:x:5:0:sync:/sbin:/bin/sync ~ ~ kugstone:x:500:500::/home/kugstone:/bin/bash [root@kugstone /etc]# [root@kugstone /etc]# cat /etc/passwd grep kugstone 112

Chapter 3 kugstone:x:500:500::/home/kugstone:/bin/bash [root@kugstone /etc]# Part 1 [root@kugstone /etc]# cat /etc/group root:x:0:root bin:x:1:root,bin,daemon ~ ~ kugstone:x:500: [root@kugstone /etc]# 113

Part 114

Chapter 3 [root@kugstone /etc]# useradd -D # GROUP=100 HOME=/home INACTIVE=-1 EXPIRE= SHELL=/bin/bash SKEL=/etc/skel [root@kugstone /etc]# useradd kug -d /home/kug # [root@kugstone /etc]# ls -al /home total 60 drwxr-xr-x 15 root root 44096 Apr 8 13:50. drwxr-xr-x 20 root root 44096 Apr 8 11:18.. drwxr-xr-x 2 root root 44096 Apr 28 2001 acrobat4 drwxr-xr-x 2 root root 4096 Apr 28 2001 hanterm drwx------ 4 kug kug 4096 Apr 8 13:50 kug # drwx------ 12 kugstone kugstone 4096 Apr 4 00:40 kugstone ~ [root@kugstone /etc]# cat /etc/passwd grep kug kugstone:x:500:500::/home/kugstone:/bin/bash kug:x:501:501::/home/kug:/bin/bash [root@kugstone /etc]# cat /etc/group grep kug kugstone:x:500: kug:x:501: [root@kugstone /etc]# Part 1 [root@kugstone /etc]# userdel kug [root@kugstone /etc]# userdel kug userdel: user kug does not exist [root@kugstone /etc]# # 115

Part 3 Linux [root@kugstone kugstone]# pwd /home/kugstone [root@kugstone kugstone]# # 116

Chapter 3 Part 1 117

Part [kugstone@kugstone bin]$ pwd # /usr/bin [kugstone@kugstone bin]$ cd $HOME # [kugstone@kugstone kugstone]$ pwd /home/kugstone [kugstone@kugstone kugstone]$ [kugstone@kugstone kugstone]$ cd $HOME/test [kugstone@kugstone test]$ pwd /home/kugstone/test [kugstone@kugstone test]$ 118

Chapter 3 Part 1 [kugstone@kugstone kugstone]$ mkdir -v test # mkdir: created directory test [kugstone@kugstone kugstone]$ mkdir test # mkdir: cannot create directory test : File exists [kugstone@kugstone kugstone]$ mkdir -p test # [kugstone@kugstone kugstone]$ [kugstone@kugstone /]$ pwd / [kugstone@kugstone /]$ mkdir $HOME/imsi # [kugstone@kugstone /]$ cd $HOME/imsi [kugstone@kugstone imsi]$ pwd /home/kugstone/imsi [kugstone@kugstone imsi]$ 119

Part T I P [root@kugstone wongo]# pwd /home/wongo [root@kugstone wongo]# cd example [root@kugstone example]# cd.. [root@kugstone wongo]# cd $HOME [root@kugstone /root]# pwd /root [root@kugstone /root]# 120

Chapter 3 Part 1 [root@kugstone imsi]# ls temp1 temp2 temp3 temp4 [root@kugstone imsi]# mv temp1 temp2 [root@kugstone imsi]# cd temp2 [root@kugstone temp2]# ls temp1 [root@kugstone temp2]# ls aa bb cc dd ee temp1 [root@kugstone imsi]# mv -b aa temp2 mv: overwrite temp2/aa? y [root@kugstone imsi]# ls bb temp2 temp3 temp4 [root@kugstone imsi]# cd temp2 [root@kugstone temp2]# ls aa aa~ bb cc dd ee temp1 [root@kugstone imsi]# cd temp2 [root@kugstone temp2]# ls aa aa~ bb cc dd ee temp1 [root@kugstone temp2]# cd.. [root@kugstone imsi]# mv -i bb temp2 mv: overwrite temp2/bb? y [root@kugstone imsi]# mv -f cc temp2 # # # -b aa~ # # 121

Part [root@kugstone /root]# pwd /root [root@kugstone /root]# cat.bashrc #.bashrc # User specific aliases and functions alias rm= rm -i alias cp= cp -i alias mv= mv -i # mv # Source global definitions if [ -f /etc/bashrc ]; then. /etc/bashrc fi [root@kugstone /root]# 122

Chapter 3 [root@kugstone imsi]# rmdir -v temp3 # rmdir: removing directory, temp3 [root@kugstone imsi]# pwd /home/wongo/imsi [root@kugstone imsi]# rmdir -pv temp1/temp2 # rmdir: removing directory, temp1/temp2 rmdir: removing directory, temp1 [root@kugstone imsi]# Part 1 4 Linux 123

Part [root@kugstone imsi]# date Mon Apr 9 13:04:28 EDT 2001 [root@kugstone imsi]# touch aa [root@kugstone imsi]# ls -al aa -rw-r--r-- 1 root root 0 Apr 9 13:04 aa [root@kugstone imsi]# touch -m aa [root@kugstone imsi]# ls -al aa -rw-r--r-- 1 root root 0 Apr 9 13:06 aa [root@kugstone imsi]# T I P [root@kugstone imsi]# cat -b aa # 1test of line 124

Chapter 3 2cat is very beautiful [root@kugstone imsi]# cat -e aa # $ test of line$ cat is very beautiful$ [root@kugstone imsi]# Part 1 [root@kugstone imsi]# cat > bb its my program [1]+ Stopped cat >bb [root@kugstone imsi]# cat bb its my program [root@kugstone imsi]# cat bb >cc [root@kugstone imsi]# cat cc its my program [root@kugstone imsi]# cat bb >>cc [root@kugstone imsi]# cat cc its my program its my program [root@kugstone imsi]# # (^z) # # # 125

Part [root@kugstone imsi]# ls -l total 8 -rw-r--r-- 1 root root 35 Apr 9 13:45 aa -rw-r--r-- 1 root root 35 Apr 9 13:45 bb [root@kugstone imsi]# cp -i aa bb # cp: overwrite bb? y [root@kugstone imsi]# ls -l total 8 -rw-r--r-- 1 root root 35 Apr 9 13:45 aa -rw-r--r-- 1 root root 35 Apr 9 16:50 bb [root@kugstone imsi]# cp -p aa bb # cp: overwrite bb? y [root@kugstone imsi]# ls -l total 8 -rw-r--r-- 1 root root 35 Apr 9 13:45 aa -rw-r--r-- 1 root root 35 Apr 9 13:45 bb [root@kugstone imsi]# 126

Chapter 3 Part 1 [root@kugstone imsi]# ls -l total 4 -rw-r--r-- 1 root root 0 Apr 9 17:00 aa -rw-r--r-- 1 root root 0 Apr 9 17:00 bb -rw-r--r-- 1 root root 0 Apr 9 17:00 cc drwxr-xr-x 2 root root 4096 Apr 9 17:00 temp [root@kugstone imsi]# rm aa [root@kugstone imsi]# ls bb cc temp [root@kugstone imsi]# rm -i bb rm: remove bb? y [root@kugstone imsi]# ls cc temp [root@kugstone imsi]# rm temp rm: temp is a directory [root@kugstone imsi]# rm -r temp [root@kugstone imsi]# ls cc [root@kugstone imsi]# 127

Part Most commands optionally preceded by integer argument k. Defaults in brackets. Star (*) indicates argument becomes new default. ------------------------------------------------------------------- <space> Display next k lines of text [current screen size] z Display next k lines of text [current screen size]* <return> Display next k lines of text [1]* d or ctrl-d Scroll k lines [current scroll size, initially 11]* q or Q or <interrupt> Exit from more s Skip forward k lines of text [1] f Skip forward k screenfuls of text [1] b or ctrl-b Skip backwards k screenfuls of text [1] Go to place where previous search started = Display current line number /<regular expression> Search for kth occurrence of regular expression [1] n Search for kth occurrence of last r.e [1] 128

Chapter 3!<cmd> or :!<cmd> Execute <cmd> in a subshell v Start up /usr/bin/vi at current line ctrl-l Redraw screen :n Go to kth next file [1] :p Go to kth previous file [1] :f Display current file name and line number. Repeat previous command ------------------------------------------------------------------- --More--(17%) Part 1 [root@kugstone example]# man more more +7 # 7 SYNOPSIS more [-dlfpcsu] [-num] [+/ pattern] [+ linenum] [file...] DESCRIPTION ~ ~ [root@kugstone example]# man more more +/Command...skipping Command line options are described below. Options are also taken from the environment variable MORE (make sure to precede them with a dash ( - )) but command line options will override them. [root@kugstone example]# 129

Part [root@kugstone example]# cat sample.c #include <stdio.h> main() { printf( Hello World\n ); } [root@kugstone example]# head -1 sample.c #include <stdio.h> [root@kugstone example]# head sample.c #include <stdio.h> main() { printf( Hello World\n ); } [root@kugstone example]# tail -2 sample.c printf( Hello World\n ); } [root@kugstone example]# # 1 # 10 # 2 [root@kugstone example]# tail -f sample.c #include <stdio.h> main() { # 130

Chapter 3 printf( Hello World\n ); } add first line... add seconf line... # Part 1 cat name.txt 1 kug jkyoung wan 302-9278 KOREA 2 KUG ji su 506-0988 USA 3 kang yan jung 123-5678 CHINA 4 li youn ju 444-4444 ENGLAND 5 chi nam su 457-9800 TILAND 6 am bi ju 566-0099 ITALY sort name.txt 1 kug jkyoung wan 302-9278 KOREA 2 KUG ji su 506-0988 USA 3 kang yan jung 123-5678 CHINA 4 li youn ju 444-4444 ENGLAND 5 chi nam su 457-9800 TILAND 6 am bi ju 566-0099 ITALY sort -r name.txt 6 am bi ju 566-0099 ITALY 5 chi nam su 457-9800 TILAND 4 li youn ju 444-4444 ENGLAND 3 kang yan jung 123-5678 CHINA 2 KUG ji su 506-0988 USA 1 kug jkyoung wan 302-9278 KOREA # # 131

Part cat name.txt 1 kug jkyoung wan 302-9278 KOREA 2 KUG ji su 506-0988 USA 3 kang yan jung 123-5678 CHINA 4 li youn ju 444-4444 ENGLAND 5 5_chi nam su 457-9800 TILAND 6 am bi ju 566-0099 ITALY 7 4_am bi ju 566-0099 ITALY sort +1-2 name.txt 7 4_am bi ju 566-0099 ITALY 5 5_chi nam su 457-9800 TILAND 6 am bi ju 566-0099 ITALY 3 kang yan jung 123-5678 CHINA 1 kug jkyoung wan 302-9278 KOREA 2 KUG ji su 506-0988 USA 4 li youn ju 444-4444 ENGLAND cat /etc/passwd root:x:0:0:root:/root:/bin/bash bin:x:1:1:bin:/bin: daemon:x:2:2:daemon:/sbin: 132

Chapter 3 adm:x:3:4:adm:/var/adm: lp:x:4:7:lp:/var/spool/lpd: sync:x:5:0:sync:/sbin:/bin/sync shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown halt:x:7:0:halt:/sbin:/sbin/halt mail:x:8:12:mail:/var/spool/mail: ~ ~ sort -t: +0-1 /etc/passwd adm:x:3:4:adm:/var/adm: amanda:x:33:6:amanda user:/var/lib/amanda:/bin/bash apache:x:48:48:apache:/var/www:/bin/false bin:x:1:1:bin:/bin: daemon:x:2:2:daemon:/sbin: ftp:x:14:50:ftp User:/var/ftp: games:x:12:100:games:/usr/games: gdm:x:42:42::/home/gdm:/bin/bash gopher:x:13:30:gopher:/usr/lib/gopher-data: Part 1 sort name.txt>a sort name.txt>b sort -m a b >c cat c 1 kug jkyoung wan 302-9278 KOREA 1 kug jkyoung wan 302-9278 KOREA 2 KUG ji su 506-0988 USA 2 KUG ji su 506-0988 USA 3 kang yan jung 123-5678 CHINA 3 kang yan jung 123-5678 CHINA 4 li youn ju 444-4444 ENGLAND 4 li youn ju 444-4444 ENGLAND 5 5_chi nam su 457-9800 TILAND 5 5_chi nam su 457-9800 TILAND 6 am bi ju 566-0099 ITALY 133

Part 6 am bi ju 566-0099 ITALY 7 4_am bi ju 566-0099 ITALY 7 4_am bi ju 566-0099 ITALY sort -u c 1 kug jkyoung wan 302-9278 KOREA 2 KUG ji su 506-0988 USA 3 kang yan jung 123-5678 CHINA 4 li youn ju 444-4444 ENGLAND 5 5_chi nam su 457-9800 TILAND 6 am bi ju 566-0099 ITALY 7 4_am bi ju 566-0099 ITALY 134

Chapter 3 cat name.tmp # Tug jkyoung wan 302-9278 KOREA KUG ji su 506-0988 USA am bi ju 566-0099 ITALY cat name.txt # 1 kug jkyoung wan 302-9278 KOREA 2 KUG ji su 506-0988 USA 3 kang yan jung 123-5678 CHINA 4 li youn ju 444-4444 ENGLAND 5 5_chi nam su 457-9800 TILAND 6 am bi ju 566-0099 ITALY 7 4_am bi ju 566-0099 ITALY diff name.tmp name.txt # 1,4c1,7 < Tug jkyoung wan 302-9278 KOREA < < KUG ji su 506-0988 USA < am bi ju 566-0099 ITALY --- > 1 kug jkyoung wan 302-9278 KOREA > 2 KUG ji su 506-0988 USA > 3 kang yan jung 123-5678 CHINA > 4 li youn ju 444-4444 ENGLAND > 5 5_chi nam su 457-9800 TILAND > 6 am bi ju 566-0099 ITALY > 7 4_am bi ju 566-0099 ITALY Part 1 135

Part cmp name.tmp name.txt name.tmp name.txt differ: char 1, line 1 cmp -l name.tmp name.txt 1 124 61 2 165 40 3 147 153 4 40 165 5 152 147 6 153 40 7 171 152 8 157 153 ~ comm name.tmp name.txt 1 kug jkyoung wan 302-9278 KOREA 2 KUG ji su 506-0988 USA 3 kang yan jung 123-5678 CHINA 4 li youn ju 444-4444 ENGLAND 5 5_chi nam su 457-9800 TILAND 6 am bi ju 566-0099 ITALY 7 4_am bi ju 566-0099 ITALY Tug jkyoung wan 302-9278 KOREA KUG ji su 506-0988 USA am bi ju 566-0099 ITALY 136

Chapter 3 Part 1 comm -2 name.tmp name.txt # 1, 3 Tug jkyoung wan 302-9278 KOREA KUG ji su 506-0988 USA am bi ju 566-0099 ITALY find. -name *.txt -print./name.txt 137

Part find / -name *.txt -print -depth find: /proc/1390/fd: No such file or directory /var/mars_nwe/sys/readme.txt /var/www/icons/small/readme.txt /etc/squid/mib.txt /etc/tripwire/twcfg.txt /etc/tripwire/twpol.txt /usr/share/doc/html/en/kppp/ttys-cua.txt ~ ~ T I P ls -l total 36 drwxr-xr-x 2 root root 4096 Mar 25 20:33 imsi -rw-r--r-- 1 root root 92 Mar 25 21:19 name.tmp -rw-r--r-- 1 root root 232 Mar 25 21:08 name.txt -rw-r--r-- 1 root root 84 Mar 25 20:33 sample.c find. -size +20 -print find. -size +1 -print../imsi 138

Chapter 3 find. -size -1 -print Part 1 ls -l total 16 drwxr-xr-x 2 root root 4096 Mar 25 20:33 imsi -rw-r--r-- 1 root root 92 Mar 25 21:19 name.tmp -rw-r--r-- 1 root root 232 Mar 25 21:08 name.txt -rw-r--r-- 1 root root 84 Mar 25 20:33 sample.c date Wed Apr 25 21:34:58 KST 2001 find. -mtime 31 -print../name.tmp./name.txt./imsi./sample.c find. -name *.txt -print -exec cat {} \;./name.txt 1 kug jkyoung wan 302-9278 KOREA 2 KUG ji su 506-0988 USA 3 kang yan jung 123-5678 CHINA 4 li youn ju 444-4444 ENGLAND 5 5_chi nam su 457-9800 TILAND 6 am bi ju 566-0099 ITALY 7 4_am bi ju 566-0099 ITALY./sample.txt 139

Part #include<stdio.h> main() { printf( Hello World!!\n ); } find. -name *.txt -print -ok rm {} \;./name.txt < rm..../name.txt >? n./sample.txt < rm..../sample.txt >? n find. \( -name *.c -o -name *.txt \) - 140

Chapter 3 print./name.txt./sample.c./sample.txt Part 1 ls imsi name.tmp name.txt sample.c sample.txt cat name.txt 1 kug jkyoung wan 302-9278 KOREA 2 KUG ji su 506-0988 USA 3 kang yan jung 123-5678 CHINA 4 li youn ju 444-4444 ENGLAND 5 5_chi nam su 457-9800 TILAND 6 am bi ju 566-0099 ITALY 7 4_am bi ju 566-0099 ITALY split -3 name.txt # 3 ls x* xaa xab xac # cat xaa 141

Part 1 kug jkyoung wan 302-9278 KOREA 2 KUG ji su 506-0988 USA 3 kang yan jung 123-5678 CHINA compress name.txt ls -al name* -rw-r--r-- 1 root root 92 Mar 25 21:19 name.tmp -rw-r--r-- 1 root root 188 Mar 25 21:08 name.txt.z uncompress name.txt.z compress * 142

Chapter 3 ls *.Z name.tmp.z name.txt.z sample.c.z sample.txt.z xaa.z xab.z uncompress * ls imsi name.tmp name.txt sample.c sample.txt xaa xab xac Part 1 compress sample.txt ls -al sam* -rw-r--r-- 1 root root 84 Mar 25 20:33 sample.c -rw-r--r-- 1 root root 73 Apr 25 21:35 sample.txt.z zcat sample.txt.z #include<stdio.h> main() { printf( Hello World!!\n ); } cat sample.c #include<stdio.h> main() { printf( Hello World!!\n ); 143

Part } wc sample.c 5 6 58 sample.c # ls a.out imsi name.tmp name.txt sample.c sample.txt.z ls wc -l # 6 144

Chapter 3 cat cut.txt first second third cut -c1-3 cut.txt # 1-3 fir cut -f1 cut.txt # first Part 1 cat /etc/passwd root:x:0:0:root:/root:/bin/bash bin:x:1:1:bin:/bin: daemon:x:2:2:daemon:/sbin: adm:x:3:4:adm:/var/adm: ~ ~ cut -f1 -d: /etc/passwd root bin daemon adm ~ ~ 145

Part who root :0 Mar 25 19:44 root pts/0 Mar 25 19:44 root pts/1 Mar 25 19:55 root pts/2 Mar 25 20:47 who cut -c1-4 sort uniq -c 4 root cat a kug kang li cat b 111-1234 222-1234 333-1234 paste a b kug 111-1234 kang 222-1234 li 333-1234 paste -d* a b kug*111-1234 # 146

Chapter 3 kang*222-1234 li*333-1234 *444-1234 Part 1 paste -s a b kug kang li 111-1234 222-1234 333-1234 444-1234 cat c kug 111-1234 kang 222-1234 li 333-1234 cut -f1 c>c1 cut -f2 c>c2 paste c2 c1 111-1234 kug 222-1234 kang 333-1234 li # 1 # 2 147

Part cat c kug 111-1234 kang 222-1234 li 333-1234 tr k A <c Aug 111-1234 Aang 222-1234 li 333-1234 cat c kug 111-1234 kang 222-1234 li 333-1234 tr a-z A-Z <c KUG 111-1234 KANG 222-1234 LI 333-1234 tr \[a-z\] \[A-Z\] <c KUG 111-1234 KANG 222-1234 LI 333-1234 # cat c kug 111-1234 kang 222-1234 li 333-1234 tr -d [0-9] <c 148

Chapter 3 kug - kang - li - Part 1 cat c kug 111-1234 kang 222-1234 li 333-1234 tr -cd [0-8] <c 111123422212343331234 5 Linux cat name.txt 1 kug jkyoung wan 302-9278 KOREA 2 kug ji su 506-0988 USA 3 kang yan jung 123-5678 CHINA 4 li youn ju 444-4444 ENGLAND 5 chi nam su 457-9800 TILAND 6 am bi ju 566-0099 ITALY # 149

Part grep am name.txt # am chi nam su 457-9800 TILAND am bi ju 566-0099 ITALY cat name.txt 1 kug jkyoung wan 302-9278 KOREA 2 kug ji su 506-0988 USA 3 kang yan jung 123-5678 CHINA 4 li youn ju 444-4444 ENGLAND 5 chi nam su 457-9800 TILAND 6 am bi ju 566-0099 ITALY grep -v am name.txt # 1 kug jkyoung wan 302-9278 KOREA 2 kug ji su 506-0988 USA 3 kang yan jung 123-5678 CHINA 4 li youn ju 444-4444 ENGLAND grep -n am name.txt # 5:5 chi nam su 457-9800 TILAND 6:6 am bi ju 566-0099 ITALY 150

Chapter 3 grep -c kug name.txt 2 Part 1 ls imsi name.tmp name.txt sample.c grep -l kug * grep: imsi: Is a directory name.tmp name.txt grep -l kug / grep: /: Is a directory cat name.txt 1 kug jkyoung wan 302-9278 KOREA 2 KUG ji su 506-0988 USA 3 kang yan jung 123-5678 CHINA 4 li youn ju 444-4444 ENGLAND 5 chi nam su 457-9800 TILAND 151

Part 6 am bi ju 566-0099 ITALY grep -y kug name.txt 1 kug jkyoung wan 302-9278 KOREA 2 KUG ji su 506-0988 USA grep KUG name.txt 2 KUG ji su 506-0988 USA # # grep -w ku name.txt grep -w kug name.txt 1 kug jkyoung wan 302-9278 KOREA 152

Chapter 3 grep ^k name.txt grep ^k name.txt grep ^4 name.txt 4 li youn ju 444-4444 ENGLAND grep a$ name.txt grep A$ name.txt 1 kug jkyoung wan 302-9278 KOREA 2 KUG ji su 506-0988 USA 3 kang yan jung 123-5678 CHINA grep ^$ name.txt Part 1 grep k.. name.txt 1 kug jkyoung wan 302-9278 KOREA 3 kang yan jung 123-5678 CHINA grep I... name.txt # I 5 chi nam su 457-9800 TILAND 6 am bi ju 566-0099 ITALY 153

Part grep [LMN] name.txt 3 kang yan jung 123-5678 CHINA 4 li youn ju 444-4444 ENGLAND 5 chi nam su 457-9800 TILAND 6 am bi ju 566-0099 ITALY grep [L-N] name.txt 3 kang yan jung 123-5678 CHINA 4 li youn ju 444-4444 ENGLAND 5 chi nam su 457-9800 TILAND 6 am bi ju 566-0099 ITALY grep ^[K4] name.txt 4 li youn ju 444-4444 ENGLAND w 8:59pm up 2:21, 4 users, load average: 0.04, 0.07, 0.08 USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT root pts/0-7:44pm 1:15m 0.00s 0.00s /bin/catroot pts/1-7:55pm 0.00s 0.28s 0.01s w root pts/2-8:47pm 9:14 0.07s 0.07s /bin/bas w grep sh root pts/2-8:47pm 9:22 0.07s 0.07s /bin/bash w grep sh 154

Chapter 3 root pts/2-8:47pm 11:43 0.07s 0.07s /bin/bash w grep sh wc -l 1 Part 1 Q u i z 155

>> Q uestion 1. 5. 2. 3. 4. 6. 7. 157

Part 8. 9. 10. 11. 14. 15. 16. 17. 12. 13. 18. 19. 158

Chapter 3 20. 21. 26. 27. Part 1 22. 28. 23. 24. 25. 29. 30. 31. 159

Part 32. 38. 33. 34. 35. 36. 37. 39. 40. 41. 42. 160

Chapter 3 43. 44. 45. 46. 49. 50. 51. Part 1 47. 52. 48. 53. 161

Part 54. 55. 56. 57. 58. 59. 60. 61. 62. 63. 162

Chapter 3 64. 65. 66. 70. 71. 72. Part 1 67. 68. 69. 73. 74. 75. 163