Linux操作系统使用



Similar documents
本文由筱驀釹贡献

ebook35-2

Microsoft Word - linux命令及建议.doc

PowerPoint 演示文稿

投影片 1

lect03.ppt

Microsoft Word - PS2_linux_guide_cn.doc

像 客 样 使 命令行 徐 东

Microsoft Word - 第5章.doc

第零章、為何要學作業系統

ebook15-C

Linux Ubuntu Part Linux Ubuntu Linux UNIX...19 Linux...19 Linux Linux...21 Linux GNU FSF Open So urce.

Unix®t Œ fi z.PDF

第 4 章 Linux shell 程序设计 shell UNIX/Linux Linux shell shell if case while for shell Linux Linux 本章主要介绍 Linux shell( 默认是 bash) 的语法结构 变量定义及赋值引用 标点符号 控制语句等

untitled

ebook70-21

Microsoft PowerPoint - 第7章 Linux基本命令

Linux 操作系统课程社区创作

Web

ebook70-22

Shell

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

ebook70-5

Cygwin & vim

mannal

Linux服务器构建与运维管理

epub 63-3

DOS下常用的网络命令.PDF


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

ebook70-14

untitled

2

鳥 哥 的 Linux 私 房 菜 -- 檔 案 與 目 錄 管 理 7. 針 對 本 文 的 建 議 : 目 錄 與 路 徑 : 由 前 一 章 節 Linux 的 檔 案 權 限 與 目 錄 配 置 中 約

Solaris ( ) Solaris Shell awk gawk vi emacs OK mode 1

1. 发 行 情 况 格 力 地 产 于 2014 年 12 月 25 日 发 行 9.8 亿 元 可 转 债 其 中, 原 股 东 优 先 配 售 亿 元 ( 万 手 ), 占 本 次 发 行 总 量 的 21.66% 网 上 向 一 般 社 会 公 众 投 资 者 发

目 录 1 新 闻 政 策 追 踪 住 建 部 : 坚 持 因 城 施 策 完 善 房 地 产 宏 观 调 控 行 业 数 据 追 踪 限 购 政 策 落 地, 新 房 成 交 回 落 库 存 微 降, 一 线 去 化 表 现 稍

自由軟體教學平台

untitled

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

易盛8

Bourne Shell及shell编程

UNIX Shell Shell UNIX, 21 UN IX, UNIX UNIX UNIX vi UNIX UNIX Shell, UNIX Shell Shell UNIX Shell, Shell Shell Shell Shell Shell UNIX, (CIP) UNIX Shell

Sun Fire V440 Server Administration Guide - zh_TW

ebook71-8

Microsoft Word - UserManualForEaton_SC.doc

C/C++ - 字符输入输出和字符确认

ebook15-4

作 業 系 統 簡 介 光 有 電 腦 硬 體, 會 不 容 易 使 用 必 須 要 有 適 當 的 程 式, 才 方 便 操 作 硬 體 衍 生 作 業 系 統 需 求 : 提 供 方 便 使 用 者 執 行 程 式 平 台 有 效 使 用 各 種 電 腦 硬 體 資 源 Jingo C. Lia

自由軟體教學平台

PowerPoint Presentation

CCNA 3 Module 5 Switching Concepts

<4D F736F F D2047CEF7B7C920B9ABCBBED1D0BEBFB1A8B8E62E646F63>

epub 73-5

自由軟體教學平台

投影片 1

Sun StorEdge 3000 系列安装、操作和维护手册 (3310)

2-2

Microsoft PowerPoint - lect01.ppt

行 业 研 究 证 券 行 业 周 报 1 1. 行 业 一 周 走 势 上 周 ( , 下 同 ) 沪 深 3 下 降.49%, 券 商 行 业 下 降 2.36%, 跑 输 大 盘 上 市 券 商 中 太 平 洋 上 涨 1.2%, 涨 幅 最 大 ; 广 发 证 券

软件概述

Linux 目 录 结 构 与 Windows 将 硬 盘 看 做 C 盘 D 盘 几 个 独 立 的 分 区 不 同,Linux 将 整 个 文 件 系 统 看 做 一 棵 树, 这 棵 树 的 树 根 叫 做 根 目 录, 用 / 表 示 各 个 分 区 通 过 挂 载 (mount) 到 文

User ID 150 Password - User ID 150 Password Mon- Cam-- Invalid Terminal Mode No User Terminal Mode No User Mon- Cam-- 2

ebook62-1

投影片 1

<4D F736F F D D342DA57CA7DEA447B14D2DA475B57BBB50BADEB27AC3FEB14DA447B8D5C344>

宏观与策略研究

(\244j\257d\276\307\274\351_ C.indd_70%.pdf)

Microsoft Word - 國文.doc

Linux入门基础培训

投资高企 把握3G投资主题

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

Instruction_8723_8725_8729

PowerPoint Presentation

jsj0.nps

網路安全:理論與實務 第二版

FA-3000_Ver1.00

华恒家庭网关方案

专题研究.doc

ebook 99-1

投影片 1

01

IP505SM_manual_cn.doc

epub 61-2

untitled

快 速 入 门 (Linux) 概 述 文 档 目 的 本 文 档 介 绍 了 如 何 快 速 创 建 Linux 系 统 实 例 远 程 连 接 实 例 部 署 环 境 等 旨 在 引 导 您 一 站 式 完 成 实 例 的 创 建 登 录 和 快 速 环 境 部 署 云 服 务 器 ECS 实

投影片 1

Microsoft Word - word2007排版

I B :

Java Desktop System 呂衄盋 2 呂衄说柔

计算机在汉语研究中的应用――以字频统计为例

292 shell shell C shell ~/.cshrc shell ~/.login ~/.logout ~/.history.cshrc shell shell /etc/passwd ~name NIS NIS+ * 0? [abc...] a-za-z0-9

産 産 産 産 産 爲 爲 爲 爲

05_資源分享-NFS及NIS.doc

ME3208E2-1.book

Microsoft Word - 第四章 資料分析

Sun Update Connection System Sun Microsystems, Inc Network Circle Santa Clara, CA U.S.A

Microsoft Word - Sameul book 1 and 2.doc

东吴证券研究所

文章题目

Transcription:

Linux

vi shell Linux

Linux Linux 5

UNIX time-stamp UNICS Sep 1969... UNIX Time- Sharing System First Edition(V1) Nov 3, 1971 FreeBSD 5.1 Jun 9,2003 BSD/OS 5.0 (BSDI) May 2,2003... V6 May 1976 BSD 1977... Version7 1979 OpenBSD 3.4 beta Aug 11,2003 Solaris 10 Preview Jul 29,2003... 4.4 BSD 1993 System V Release 4 (SVR 4) 1988 HP-UX 11i v2 for Intel Itanium May 19,2003 IRIX 6.5.20 May 7,2003 Mac OS X 10.2.7 Aug 18,2003 AIX 5L v5.2 Update May 23,2003 NetBSD 1.6.1 Apr 14,2003 True Unix V5.1B Jan 20,2003 SCO UnixWare 7.1.3/OKP Jul 31,2003 6

Linus Torvalds Alan Cox 1969.12.28 Helsinki, Finland Richard Stallman Eric Raymond Gnu(Gnu is Not Unix),FSF 7

Linus version 2.0 8

Open Source Open Source 9

Open Source 10

Open Source http://www.gnu.org http://www.tldp.org http://www.kernel.org http://www.linux.org http://www.linuxforum.org http://www.redhat.com http://www.apache.org http://www.samba.org http://www.linuxaid.org http://www.oreilly.com http://www.oreilly.com.cn Tim Oreilly 11

Linux Shell 12

Linux (Distributions) (SuSE,SCO,TurboLinux,Conectivia) 13

kernel 2.4.18-4 2.5.23-32 / patch 2.4.22 2003 8 29 beta 2.6.0-test4 2003 8 29 http://www.kernel.org 14

Linux time-stamp Linux 0.01 Aug 1, 1991 Linux 1.0...... Aug 1, 1994 Linux 1.0.6 Apr 3, 1994 Linux 1.0.9 Apr 17, 1994... Linux 1.2 Mar 7, 1995 Linux 1.1.0 Apr 6, 1994... Linux 1.1.95 Mar 2, 1995 Linux 1.2 Mar 7, 1995 Linux 1.2.13 Aug 2, 1995... Linux 1.3 Jun 12, 1995...... Linux 2.2.25 Mar 17, 2003 Linux 2.4.21 Jun 13, 2003 Linux 2.5.75 Jul 10, 2003 Linux 2.6.1-test1 Jul 13, 2003 15

Shell Shell Bourne Shell sh Steve Bourne Bourne Again Shell bash Korn Shell ksh Korn C Shell csh BSD tcsh tcsh BSD Shell ---- bash Shell 16

Linux Windows Linux shell 17

root Linux 19

root root UNIX script 20

telnet NIS(Network Information System) rsh 21

IP telnet VIP VIP Login: root Password: 22

#rsh c0305 ( rsh,c0305 ) $exit $logout ctrl-d $ %, # 23

: passwd $passwd yangkun s old password: yangkun s new password: Enter the new password again: 24

$command options arguments $ls l news $mail -f newmail ( ) $mail - f newmail $mail -f newmail $mail newmail -f ( ) ( ) ( ) options $who -m -u $who -mu $who -m-u $who -m u ( ) ( ) 25

shell Enter shell ls LS Ls ls \ Enter > 26

Ctrl-c Ctrl-d Ctrl-s Ctrl-q Ctrl-u Ctrl-l backspace 27

Linux 29

/ /tmp /bin /home /etc /usr /var yang zhang share man data 30

Linux / /home /bin /sbin /usr /usr/bin /usr/sbin /usr/lib /usr/doc Linux /usr/man /usr/spool 31

Linux /var /dev /etc 32

255 / /usr/share/doc 33

- inode index node - 34

Linux 26 # @ _ *? > < / ; $ \ + - 255 35

txt,pdf,jpg /dev/tty1 #file // 36

ASCII 37

i / i i i 38

/ /etc, /usr/share pwd./ /home/yang./data/today data/today /home/yang/data/today ( /home/yang) $cd /home/yang/data/today $cd data/today $cd./data/today 39

ls pwd cd mkdir rmdir 40

ls list ls 26-1 -a.... -l -R 41

ls [root@lenovo /root ]# ls la t [root@lenovo /root ]# ls t* 42

pwd Print Working Directory 43

cd Changing Directory cd cd [ ] cd ~ $cd $cd ~ $cd /usr/share $cd.. // // // /usr/share // 44

mkdir Make Directory mkdir mkdir [-p] [-m][ ] -p -m chmod 45

mkdir( ) data, rwx $mkdir m 777 data /home/yang/data /home #mkdir p /home/yang/data // shell # 46

rmdir Remove Directory rmdir rmdir [-p] [ ] -p new data data new #rmdir p new/data 47

cp mv rm ln find touch 48

cp copy cp cp [ ] [ ] cp r [ ] [ ] file1,file2 data data new $cp file1 file2 data $cp file* data $cp r data new 49

mv move mv, mv [ ] [ ] file1 $mv file1 file data file1 file2 new $mv data/file1 file2 /new 50

rm remove rm [ ][ ] -r -i file1 $rm file1 /home/yang/data $rm rf /home/yang/data 51

ln link ln ln [ ] ln [ ] -s -d file1,file2 data, new $ln s /home/file1 /home/file2 /home/data new dir3 dir4 $ln d dir3 dir4 52

find find find [ ] [ ] locate,whereis 53

find -atime n -ctime n -amin n -cmin n -empty -name name -type x n*24 n*24 n n x d, f x c, x b, x p x l, x s 54

find /home 7 : $find /home -atime 7 -print /usr/src core $find /usr/src -name core -exec rm { } \ ; /home.jpg 100K $find /home -name " *.jpg " -size 100k 55

touch touch [ ] [YY]MMDDhhmm -a -c -t touch $touch foo $touch t 9802231245 foo 56

cat more head tail 57

concatenate cat cat [ ] [ ] cat $cat 123 123 file1 file2 file3 $ cat file1 file2 > file3 file3 58

more more more [ ] [ ], less +/< > +< > -n n -c foo cpu $more +/cpu foo foo 10 $more c 10 foo 59

head 10 head [ ] -c N N -n N N foo 5 $head 5 foo 60

tail 10 tail [ ] -c N N -n N N +N N 61

comm diff 62

comm common) comm [-123] file1 file2 63 (in -1-2 -3 comm $comm 12 file1 file2 file1 file2 hello hello hello good goodbye hi hi hi

diff differences diff [ ] file1 file2 -c -C n n -r n1 a n3,n4 n1,n2 d n3 n1,n2 c n3,n4 a- d- c- 64

diff $diff file1 file2 file1 file2 1 hello 1 hello 2c2 2 good 2 goodbye < good 3 hi 3 hi --- 4 This is a try. 4 Me too. > goodbye 4c4 < This is a tr --- > Me too. 65

chmod chown chgrp 66

rwx rwx rwx user group others r w x 67

7 6 4 user group others rwx rw- r-- 111 110 100 4+2+1 4+2+0 4+0+0 umask file -rw-r--r-- 644 directory drwxr-xr-x 755 68

chmod change mode chmod [ ] u g o + - = 69

chmod filename $chmod 777 filename filename, $chmod 644 filename $chmod a+w filename $chmod o-wr,g-wr filename $chmod o=r filename 70

chown change owner chown chmod [ ] -v -r 71

change group chgrp chgrp chgrp [ ] -v -r 72

vi

vi visual editor ex <<UNIX is a Four Letter Word... and Vi is a Two Letter Abbreviation>> Vim (Vi IMproved) 74

75

vi #vi filename ~ ~ ~ ~ file [New file] 76

vi Esc Ctrl-[ :q :q! vi :x vi :wq vi shift Z :wq 77

i I (insert) a A (append) o O (open) 78

<up_arrow> Ctrl+P - k <left-arrow> Backspace h l <right-arrow> Space + j Ctrl+N <down-arrow> 79

^ 0 $ [ ] G [ ] [Enter] [ ] 80

x nx n X nx n dd D dw d0 d5g 5 81

u U 82

. #include <stdio.h> main () { } 83

o Esc #include <stdio.h> { main () printf(); }. #include <stdio.h> { } main () printf(); printf(); printf(); 84

Ctrl+U Ctrl+D Ctrl+F Ctrl+B 85

1. vi vi 2. <a> <i> 3. 4. <Esc> 5. :w file, 6. vi :q, 86

shell

88

Shell 89

(meta-data) * [ ] [ - ] 90

0 STDIN 1 STDOUT 2 STDERR 91

command < filename command > filename command 2> filename 92

$cmd1 cmd2 ls lpr #ls lpr 93

shell <Tab> #pass<tab> // passwd 94

Shell shell shell 95

set var=sting unset var echo $ 96

set int=5 set var1=abcd set var2=var1$efgh var2 abcdefgh var2 echo $var2 abcdefgh 97

nohup jobs 99

Linux PID 100

101

PID(Process ID) PPID(Parent Process ID) 201 1 206 201 207 206 102

$echo $$ 201 $bash SHELL $echo $$ 206 $date tue sept 5 11:18:26 gmt 1995 $<ctrl-d> SHELL $echo $$ 201 103

ps report process status ps [ ] -a tty -f -r -u -x 104

ps $ps -f UID PID PPID TTY COMMAND john 201 1 1 -ksh john 206 201 1 ksh john 209 206 1 ls-l TTY : 105

ctrl-c kill kill 106

$ps -f UID PID PPID TTY COMMAND john 206 201 1 ksh john 209 206 1 ls -R $kill 209 $kill 9 209 107

nohup no hang-up $nohup ls -R l > out & $nohup ls -R l & & bg background fg foreground ctrl-z 108

Linux

date #date Thu Jan 27 05:34:40 CST 2000 110

time $time [options] command [arguments] $time ls $time ls -R 111

cal calendar #cal 2 1995 February 1995 Sun Mon Tue Wed Thu Fri Sat 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 112

clear clear the screen ctrl-l #clear 113

echo echo [-n] STRING -n #echo This is a command. This is a command. #echo This is a command This is a command. #echo -n Enter data-> Enter data->#_ 114

grep grep [ ] [ ][ 1 2 ].txt hello #grep hello *.txt file1 ramble.*b #grep ramble\.\*b file1 115

wc word count #wc [-c] [-l] [-w] filename -c -l -w $wc myfile 17 126 1085 myfile lines words 116

bc $bc $bc -l 117

su switch user $su [option] username 118

ping #ping 10.99.241.204 PING 10.99.19.44 (10.99.19.44) from 10.99.19.44 : 56(84) bytes of data. 64 bytes from 10.99.19.44: icmp_seq=1 ttl=255 time=0.092 ms 64 bytes from 10.99.19.44: icmp_seq=2 ttl=255 time=0.022 ms 64 bytes from 10.99.19.44: icmp_seq=3 ttl=255 time=0.020 ms 64 bytes from 10.99.19.44: icmp_seq=4 ttl=255 time=0.019 ms 120

who #who notes lft0 Jan 23 09:18 notes pts/0 Jan 24 01:19 (:0.0) root pts/1 Jan 27 05:34 (128.0.0.71) #who am i (whoami) root pts/1 Jan 27 05:34 (128.0.0.71) 121

finger shell #finger root Login name: root Directory: / Shell: /bin/ksh On since Jan 27 05:34:17 on pts/1, 14 seconds Idle Time from 128.0.0.71 No Plan. 122

manual man man info man (man1-man9) #man ls [ ] NAME SYNOPSIS DESCRIPTION OPTION 123

--help --help $ls --help 124

Questions & Answer