首页 UNIX操作系统教程(华为培训)

UNIX操作系统教程(华为培训)

举报
开通vip

UNIX操作系统教程(华为培训)UNIX操作系统教程(华为培训) UNIX 华为技术有限公司 培训中心 一九九八年八月 supplies and get to use, the registration of company assets, record maintenance, maintenance of effective management; 2.6 cost management: preparation of the annual administrative budget, control administrative c...

UNIX操作系统教程(华为培训)
UNIX操作系统教程(华为 培训 焊锡培训资料ppt免费下载焊接培训教程 ppt 下载特设培训下载班长管理培训下载培训时间表下载 ) UNIX 华为技术有限公司 培训中心 一九九八年八月 supplies and get to use, the registration of company assets, record maintenance, maintenance of effective management; 2.6 cost management: preparation of the annual administrative budget, control administrative costs, determine the scope of cost-sharing, sharing the office expenses by month; 2.7 information management: responsible for documents, materials, information and publicity, communication links, and ensure promptly, ranking officers reporting; responsible for the collation and analysis of information, provide the basis for corporate decisions; corporate culture construction, planning, editing, internal publications; 2.8 vehicle management: responsible for the management, repairs and maintenance of vehicles; 2.9 legal disputes: the company responsible for the handling of disputes; 2.10 other: maintaining normal working order, and security. General Manager General Manager job description 1, 1.1 develop strategies and plans: according to company strategic planning, establish the annual management plan, reported to the Board of Directors for approval; 1.2 decomposition measures: according to the Board of Directors issued the annual management plan, annual index of decomposition, through the Organization of coordination mandate in charge of the Department Organization and implementation, ensuring comprehensive implementation of annual indicators; 1.3 inspection: convenes the General Manager Office, through 内 容 简 介 本书从华为公司产品维护的角度出发~以SCO UNIX为例~简要地介绍了有关UNIX操作系统的应用和维护的基础知识。本书分为三篇~第一篇是基础篇~介绍了UNIX操作系统的基本知识和维护操作~主要是课堂讲授的内容,第二篇是深入篇~主要介绍了维护方面的知识~供自学用,第三篇是上机指导篇~供上机用。本书假定读者已经具备了DOS操作系统的知识。 本书可供用户学员在进行华为产品培训时使用~也可供其他UNIX维护人员参考。 深圳市华为技术有限公司,1998 1998年版权所有,保留一切权利。 非经本公司书面许可时,任何单位和个人不得擅自摘抄、复制 本书的部分或全部,并以任何形式传播。 ,,Copyright 1998 by Huawei Technologies Co.Ltd. All Rights Reserved. No part of this document may be reproduced or transmitted in any form or by any means without prior written consent of Huawei . ,,,,,,,,HUAWEI、华为、C&C08、EAST8000、HONET、视点、INtess、ETS、 ,SBS,、TELLIN,、ViewPoint、InfoLink,、NetKey,、Quidway,、SYNLOCK, 均为深圳市华为技术有限公司的商标,不得仿冒。 操作系统UNIX 汪济民徐智利编 深圳市华为技术有限公司培训中心 出版 1998年8月第版 1 1998年8月第1次印刷 印数:1-1000册 supplies and get to use, the registration of company assets, record maintenance, maintenance of effective management; 2.6 cost management: preparation of the annual administrative budget, control administrative costs, determine the scope of cost-sharing, sharing the office expenses by month; 2.7 information management: responsible for documents, materials, information and publicity, communication links, and ensure promptly, ranking officers reporting; responsible for the collation and analysis of information, provide the basis for corporate decisions; corporate culture construction, planning, editing, internal publications; 2.8 vehicle management: responsible for the management, repairs and maintenance of vehicles; 2.9 legal disputes: the company responsible for the handling of disputes; 2.10 other: maintaining normal working order, and security. General Manager General Manager job description 1, 1.1 develop strategies and plans: according to company strategic planning, establish the annual management plan, reported to the Board of Directors for approval; 1.2 decomposition measures: according to the Board of Directors issued the annual management plan, annual index of decomposition, through the Organization of coordination mandate in charge of the Department Organization and implementation, ensuring comprehensive implementation of annual indicators; 1.3 inspection: convenes the General Manager Office, through 目 录 第一篇 基础篇 第一章 UNIX操作系统概述 ............................................................................................. 1 1.1 UNIX操作系统简介 ............................................................................................. 1 1 一、UNIX特点 .................................................................................................. 二、UNIX流派及 标准 excel标准偏差excel标准偏差函数exl标准差函数国标检验抽样标准表免费下载红头文件格式标准下载 ........................................................................................ 2 1.2 UNIX系统组成 .................................................................................................... 2 1.3 与UNIX有关的几个名词 .................................................................................... 3 第二章 UNIX常用操作 .................................................................................................... 4 2.1 启动终端 ............................................................................................................ 4 2.2 登录 ................................................................................................................... 5 2.3 UNIX命令 ........................................................................................................... 5 一、UNIX命令格式 ........................................................................................... 5 二、特殊按键..................................................................................................... 6 三、UNIX常用简单命令 .................................................................................... 7 四、UNIX用户间简单通讯命令 .......................................................................... 8 2.4 注销(退出UNIX系统) .................................................................................... 10 10 第三章 UNIX文件系统 ..................................................................................................3.1 UNIX文件系统分类 ........................................................................................... 10 3.2 UNIX文件类型 .................................................................................................. 10 3.3 UNIX树型目录结构 ........................................................................................... 11 3.4 UNIX文件名称 .................................................................................................. 12 3.5 UNIX文件存取权限 ........................................................................................... 12 3.6 UNIX重定向与管道 ........................................................................................... 15 3.7 UNIX文件系统常用命令 .................................................................................... 15 第四章 UNIX文件系统常用工具和实用程序................................................................... 17 4.1 vi编辑器的最基本用法 ...................................................................................... 17 4.2 利用find命令查找文件 ..................................................................................... 18 4.3 grep命令基本用法 ............................................................................................. 19 4.4 利用cmp命令比较文件..................................................................................... 20 4.5 文件的备份和恢复实用程序 .............................................................................. 20 一、tar命令 ..................................................................................................... 20 二、cpio命令 ................................................................................................... 21 4.6 文件压缩和解压程序 ......................................................................................... 22 一、compress 压缩命令 ................................................................................... 22 二、pack 压缩文件 .......................................................................................... 22 三、gzip 压缩文件 ........................................................................................... 22 四、pkzip压缩文件 .......................................................................................... 23 第五章 UNIX简单维护与管理........................................................................................ 23 5.1 UNIX开机举例 .................................................................................................. 23 5.2 UNIX关机举例 .................................................................................................. 23 5.3 修改系统时间 ................................................................................................... 23 supplies and get to use, the registration of company assets, record maintenance, maintenance of effective management; 2.6 cost management: preparation of the annual administrative budget, control administrative costs, determine the scope of cost-sharing, sharing the office expenses by month; 2.7 information management: responsible for documents, materials, information and publicity, communication links, and ensure promptly, ranking officers reporting; responsible for the collation and analysis of information, provide the basis for corporate decisions; corporate culture construction, planning, editing, internal publications; 2.8 vehicle management: responsible for the management, repairs and maintenance of vehicles; 2.9 legal disputes: the company responsible for the handling of disputes; 2.10 other: maintaining normal working order, and security. General Manager General Manager job description 1, 1.1 develop strategies and plans: according to company strategic planning, establish the annual management plan, reported to the Board of Directors for approval; 1.2 decomposition measures: according to the Board of Directors issued the annual management plan, annual index of decomposition, through the Organization of coordination mandate in charge of the Department Organization and implementation, ensuring comprehensive implementation of annual indicators; 1.3 inspection: convenes the General Manager Office, throughi 5.4 如何控制后台进程 ............................................................................................ 23 5.5 如何查看磁盘使用情况 ..................................................................................... 24 5.6 掉电故障及处理 ................................................................................................ 24 第六章 网络通信 ........................................................................................................... 25 6.1 TCP/IP协议....................................................................................................... 25 6.2 查看网上用户信息 ............................................................................................ 25 6.3 使用mail 发送和接收电子邮件.......................................................................... 25 一、发送电子邮件............................................................................................ 26 二、阅读电子邮件............................................................................................ 26 6.4 在网络上登录和拷贝 ......................................................................................... 26 一、telnet ......................................................................................................... 26 二、ftp............................................................................................................. 28 基础篇小结 .................................................................................................................... 30 基础篇习题 .................................................................................................................... 31 第二篇 深入篇 第一章 UNIX启动和定时管理........................................................................................ 32 1.1 UNIX启动过程 .................................................................................................. 32 1.2 UNIX用户的登录过程 ....................................................................................... 32 1.3 daemon进程 ...................................................................................................... 33 1.4 UNIX系统的定时器 ........................................................................................... 33第二章 UNIX用户管理 .................................................................................................. 34 2.1用户管理 ........................................................................................................... 35 一、增加新用户 ............................................................................................... 35 二、删除用户................................................................................................... 35 一、增加新用户组............................................................................................ 35 二、删除用户组 ............................................................................................... 36 2.2 采用另外一种方法增加和删除用户 .................................................................... 36 一、增加用户................................................................................................... 36 二、删除用户................................................................................................... 37 第三章 存储设备的使用 ................................................................................................. 38 3.1创建设备 ........................................................................................................... 38 3.2 mount和umount命令......................................................................................... 38 一、mount命令 ................................................................................................ 38 二、umount命令 .............................................................................................. 39 3.3 软盘的使用 ....................................................................................................... 39 一、软盘设备的创建 ........................................................................................ 39 二、软盘的格式化............................................................................................ 40 三、安装文件系统............................................................................................ 40 四、软盘的挂接 ............................................................................................... 40 3.4 硬盘的使用 ....................................................................................................... 40 一、SCSI接口卡 .............................................................................................. 41 二、SCSI硬盘设备的创建 ................................................................................ 41 三、硬盘的分区 ............................................................................................... 42 supplies and get to use, the registration of company assets, record maintenance, maintenance of effective management; 2.6 cost management: preparation of the annual administrative budget, control administrative costs, determine the scope of cost-sharing, sharing the office expenses by month; 2.7 information management: responsible for documents, materials, information and publicity, communication links, and ensure promptly, ranking officers reporting; responsible for the collation and analysis of information, provide the basis for corporate decisions; corporate culture construction, planning, editing, internal publications; 2.8 vehicle management: responsible for the management, repairs and maintenance of vehicles; 2.9 legal disputes: the company responsible for the handling of disputes; 2.10 other: maintaining normal working order, and security. General Manager General Manager job description 1, 1.1 develop strategies and plans: according to company strategic planning, establish the annual management plan, reported to the Board of Directors for approval; 1.2 decomposition measures: according to the Board of Directors issued the annual management plan, annual index of decomposition, through the Organization of coordination mandate in charge of the Department Organization and implementation, ensuring comprehensive implementation of annual indicators; 1.3 inspection: convenes the General Manager Office, through 四、硬盘的挂接 ............................................................................................... 42 3.5 CD-ROM的使用 ................................................................................................ 42 一、CD-ROM设备的创建................................................................................. 42 二、CD-ROM的挂接........................................................................................ 43 第四章 网络、主机和路由参数设置 ............................................................................... 43 4.1 /etc/networks文件 .............................................................................................. 43 4.2 /etc/hosts文件.................................................................................................... 43 4.3 /etc/gateways文件 .............................................................................................. 44 4.4 设置步骤 .......................................................................................................... 45 4.5 测试 ................................................................................................................. 45 深入篇小结 .................................................................................................................... 45 深入篇习题 .................................................................................................................... 45 第三篇 UNIX上机指导 第一部分 上机环境 ........................................................................................................ 46 1.1 UNIX主机环境 .................................................................................................. 46 1.2 工作站环境 ....................................................................................................... 46 第二部分 在工作站上登录UNIX .................................................................................... 47 2.1 NetTerm的安装 ................................................................................................. 47 2.2 NetTerm的使用 ................................................................................................. 47 第三部分 UNIX常用命令的使用 .................................................................................... 48 3.1 常用命令之一 ................................................................................................... 48 3.2 常用命令之二(选做) ......................................................................................... 52 3.3 常用命令之三 ................................................................................................... 52 第四部分 ftp的使用....................................................................................................... 53 4.1 ftp的安装 .......................................................................................................... 53 4.2 使用ftp拷贝文件 .............................................................................................. 54 附录 附录A UNIX命令速查表 ............................................................................................. 55 附录B 习题参考答案 ..................................................................................................... 57 基础篇习题参考答案 ............................................................................................... 57 深入篇习题参考答案 ............................................................................................... 58 supplies and get to use, the registration of company assets, record maintenance, maintenance of effective management; 2.6 cost management: preparation of the annual administrative budget, control administrative costs, determine the scope of cost-sharing, sharing the office expenses by month; 2.7 information management: responsible for documents, materials, information and publicity, communication links, and ensure promptly, ranking officers reporting; responsible for the collation and analysis of information, provide the basis for corporate decisions; corporate culture construction, planning, editing, internal publications; 2.8 vehicle management: responsible for the management, repairs and maintenance of vehicles; 2.9 legal disputes: the company responsible for the handling of disputes; 2.10 other: maintaining normal working order, and security. General Manager General Manager job description 1, 1.1 develop strategies and plans: according to company strategic planning, establish the annual management plan, reported to the Board of Directors for approval; 1.2 decomposition measures: according to the Board of Directors issued the annual management plan, annual index of decomposition, through the Organization of coordination mandate in charge of the Department Organization and implementation, ensuring comprehensive implementation of annual indicators; 1.3 inspection: convenes the General Manager Office, throughiii 第一篇 基础篇 第一章 UNIX操作系统概述 1.1 UNIX操作系统简介 UNIX是较早广泛使用的计算机操作系统之一,它的第一版于1969年在Bell 实验室 17025实验室iso17025实验室认可实验室检查项目微生物实验室标识重点实验室计划 产生,1975年对外公布,1976年以后在Bell实验室外广泛使用。 一、UNIX特点 UNIX操作系统是一种非常流行的多任务、多用户操作系统,应用非常广泛。UNIX的主要特点为: 多任务(Multi-tasking) UNIX是一个多任务操作系统,在它内部允许有多个任务同时运行。而DOS操作系统是单任务的操作系统,不能同时运行多个任务。早期的UNIX操作系统的多任务是靠分时(time sharing)机构实现的,现在有些UNIX除了具有分时机制外,还加入了实时(real-time)多任务能力,用于象实时控制、数据采集等实时性要求较高的场合。 多用户(Multi-users) UNIX又是一个多用户操作系统,它允许多个用户同时使用。在UNIX中,每位用户运行自己的或公用的程序,好象拥有一台单独的机器。DOS操作系统是单用户的操作系统,只允许一个用户使用。 并行处理能力 UNIX支持多处理器系统,允许多个处理器协调并行运行。 管道 UNIX允许一个程序的输出作为另外一个程序输入,多个程序串起来看起来好象一条管道一样。通过各个简单任务的组合,就可以完成更大更复杂的任务,并极大提高了操作的方便性。后来DOS操作系统也借鉴并提供了这种机制。 功能强大的Shell UNIX的命令解释器由Shell实现。UNIX提供了三种功能强大的Shell,每种Shell本身就是一种解释型高级语言,通过用户编程就可创造无数命令,使用方便。 安全保护机制 UNIX提供了非常强大的安全保护机制,防止系统及其数据未经许可而被非法访问。 稳定性好 在目前使用的操作系统中,UNIX是比较稳定的。UNIX具有非常强大的错误处理能力,保护系统的正常运行。 用户界面 传统的UNIX用户界面采用命令行方式,命令较难记忆,很难普及到非计算机专业人员。这也是长期以来UNIX遭受指责的主要原因,但现在大多数的UNIX都加入的图形界面,可操作性大大增强。 supplies and get to use, the registration of company assets, record maintenance, maintenance of effective management; 2.6 cost management: preparation of the annual administrative budget, control administrative costs, determine the scope of cost-sharing, sharing the office expenses by month; 2.7 information management: responsible for documents, materials, information and publicity, communication links, and ensure promptly, ranking officers reporting; responsible for the collation and analysis of information, provide the basis for corporate decisions; corporate culture construction, planning, editing, internal publications; 2.8 vehicle management: responsible for the management, repairs and maintenance of vehicles; 2.9 legal disputes: the company responsible for the handling of disputes; 2.10 other: maintaining normal working order, and security. General Manager General Manager job description 1, 1.1 develop strategies and plans: according to company strategic planning, establish the annual management plan, reported to the Board of Directors for approval; 1.2 decomposition measures: according to the Board of Directors issued the annual management plan, annual index of decomposition, through the Organization of coordination mandate in charge of the Department Organization and implementation, ensuring comprehensive implementation of annual indicators; 1.3 inspection: convenes the General Manager Office, through1 强大的网络支持 UNIX具有很强的联网功能,目前流行的TCP/IP协议就是UNIX的缺省网络协议,正是因为UNIX和TCP/IP的完美结合,促进了UNIX、TCP/IP以及Internet的推广和普及。目前UNIX一直是Internet上各种服务器的首选操作系统。 移植性好 UNIX操作系统的源代码绝大部分用C语言写成,非常便于移植到其它计算机上,再加上初期UNIX组织对UNIX源代码宽松的管理政策,促进了UNIX的发展和普及。 很早以前,就应用到几乎所有16位及以上的计算机上,包括微机、工作站、服务器、小型机、多处理机和大型机等等。 二、UNIX流派及标准 UNIX和其它操作系统不同,UNIX的生产厂家很多,由于历史的原因,不同厂家生产的UNIX有一些细微区别,这就产生了不同的UNIX流派。 传统上认为包含了AT&T源代码的产品是真正的UNIX,而没有包含AT&T源代码的称为近似系统。下面是常见的不同厂家生产的UNIX产品: UNIX产品 计算机 生产厂家 SCO UNIX PC兼容机 SCO公司 XENIX PC兼容机 微软, SCO Digital公司 Digital Unix Dec Alpha机 Solaris Sun工作站 Sun公司 AIX IBM机 IBM公司 一些组织一直在对UNIX进行标准化工作,形成了一系列UNIX标准,下面是两个传统公认的UNIX标准版本: UNIX System V 这原是AT&T公司制定的标准版本,以后成为事实上的工业标准,传统上被认为是最正宗的UNIX。目前UNIX System V的版本有SVR 3.2、SVR 4.0、SVR 4.2 (SVR的全称是System V Release)。SCO UNIX就是采用的就是UNIX System V。 BSD UNIX 这是加州大学Burkeley分校发表的UNIX版本(称为BSD UNIX ,即Berkeley Software Distribution Version of UNIX)。目前流行的BSD UNIX版本有BSD 4.2、BSD 4.3和BSD 4.4版。Solaris的早期版本采用的就是BSD UNIX。 UNIX SRV4里也集中了许多BSD的特性。SVR4.2把网络和图形作为UNIX的一个标准部件。SVR4.2支持除PC机以外的所有平台,PC机的UNIX版本将用Unixware。 1.2 UNIX系统组成 UNIX操作系统结构由三大部分组成: (1) Kernel(内核) (2) Shell(外壳) (3) 工具及应用程序 supplies and get to use, the registration of company assets, record maintenance, maintenance of effective management; 2.6 cost management: preparation of the annual administrative budget, control administrative costs, determine the scope of cost-sharing, sharing the office expenses by month; 2.7 information management: responsible for documents, materials, information and publicity, communication links, and ensure promptly, ranking officers reporting; responsible for the collation and analysis of information, provide the basis for corporate decisions; corporate culture construction, planning, editing, internal publications; 2.8 vehicle management: responsible for the management, repairs and maintenance of vehicles; 2.9 legal disputes: the company responsible for the handling of disputes; 2.10 other: maintaining normal working order, and security. General Manager General Manager job description 1, 1.1 develop strategies and plans: according to company strategic planning, establish the annual management plan, reported to the Board of Directors for approval; 1.2 decomposition measures: according to the Board of Directors issued the annual management plan, annual index of decomposition, through the Organization of coordination mandate in charge of the Department Organization and implementation, ensuring comprehensive implementation of annual indicators; 1.3 inspection: convenes the General Manager Office, through 工具及应用程序 Shell Kernel 硬件 UNIX Kernel(UNIX内核) 是UNIX操作系统的核心,指挥调度UNIX机器的运行,直接控制计算机的资源,保护用户程序不受错综复杂的硬件事件细节的影响。 UNIX Shell(UNIX外壳) 是一个UNIX的特殊程序,是UNIX内核和用户的接口,是UNIX的命令解释器、也是一种解释性高级语言。目前常见的Shell有三种: Shell类型 简称 命令 主要特点 最老、使用最广泛,每个UNIX都提供。 Bourne Shell B Shell sh 是对B Shell的扩充,兼容B Shell。 Korn Shell K Shell ksh 格式有点象C语言。功能强,命令记忆稍难,在C-Shell csh 大学和学院中较为流行。 一般系统缺省为Bourne Shell, 本文以此Shell为例。 要想将当前Shell改为其它 Shell,只需在操作系统提示符下键入相应的Shell命令即可。如在其它Shell下键输入命令: ksh 就进入了K Shell。 工具及应用程序 UNIX提供了很多工具软件和应用程序供用户使用,如vi编辑器、文件查找、备份等等。 1.3 与UNIX有关的几个名词 终端(Terminal) 终端是用户和计算机进行实时交互的接口设备。终端一般由显示器、键盘和终端控制器组成,有的还带有鼠标。显示器和键盘与终端控制器相连,终端控制器通过通用端口(如串口)和计算机主机相连。用户通过终端和计算机交流。一台UNIX主机可以连多个终端。终端分为两类:字符终端和图形终端。 仿真终端 在某计算机上运行某一特定程序,把计算机当作另一台计算机的终端使用。supplies and get to use, the registration of company assets, record maintenance, maintenance of effective management; 2.6 cost management: preparation of the annual administrative budget, control administrative costs, determine the scope of cost-sharing, sharing the office expenses by month; 2.7 information management: responsible for documents, materials, information and publicity, communication links, and ensure promptly, ranking officers reporting; responsible for the collation and analysis of information, provide the basis for corporate decisions; corporate culture construction, planning, editing, internal publications; 2.8 vehicle management: responsible for the management, repairs and maintenance of vehicles; 2.9 legal disputes: the company responsible for the handling of disputes; 2.10 other: maintaining normal working order, and security. General Manager General Manager job description 1, 1.1 develop strategies and plans: according to company strategic planning, establish the annual management plan, reported to the Board of Directors for approval; 1.2 decomposition measures: according to the Board of Directors issued the annual management plan, annual index of decomposition, through the Organization of coordination mandate in charge of the Department Organization and implementation, ensuring comprehensive implementation of annual indicators; 1.3 inspection: convenes the General Manager Office, through3 目前仿真终端与UNIX主机的连接方式主要有网络连接和串口连接。 控制台(Console) 这是一种特殊的终端,由显示器、键盘(和鼠标)组成,分别连到主机的专用接口(监视器接口、键盘接口、鼠标接口)上。一般一台主机只能接一个控制台,控制台可以完成普通终端不能完成的工作:非常重要的信息(如严重的错误信息)只能在控制台上显示,有些特殊的任务(如执行修复工作)也只能在控制台上完成。除了实现以上特殊功能外,控制台还可以象其它终端那样工作。 用户名(User) UNIX是多用户操作系统,它允许多个用户同时使用。每个用户拥有用户名、登录口令以及操作特权。用户每次使用UNIX时必须先登录:输入用户名和口令。一般用户的UNIX操作系统提示符一般为”$”。 用户组(Group) 若干个用户可以组成一组,同组内的用户可以共享信息。 root用户 UNIX的超级用户,拥有其他用户没有的特权。root用户的UNIX操作系统提示符一般为”#”。 进程(Process) 是正在执行的程序。UNIX允许多个进程同时存在,每个进程都有唯一代号称为进程标识符(pid --- process id)。 前台进程(Foreground process) 可以和用户直接进行人机交互的进程。前台进程序可以接收键盘输入并将结果显示在显示器上。缺省状态下用户启动的UNIX程序运行在前台。 后台进程(Background process) 不直接和用户进行交互的进程。用户一般是感觉不到后台进程程序的运行。UNIX有很多系统进程在后台执行。 设备(Device) 或称设备文件,代表某个硬件,如磁盘、软盘、串口。UNIX对硬件的存取操作都是通过设备文件来完成的。设备文件放在/dev目录下,如/dev/hd0表示第一个软盘驱动器。 原始设备(Raw device) 也称为裸设备,没有经过加工的设备文件。原始设备文件名以r开头,如/dev/rhd0表示第一个软盘驱动器原始设备。 第二章 UNIX常用操作 2.1 启动终端 对于专用终端,当打开终端电源后就会自动出现登录信息。对于网络连接的仿真终端,要先打开计算机,再运行TCP/IP协议驱动程序和终端仿真程序即可。 supplies and get to use, the registration of company assets, record maintenance, maintenance of effective management; 2.6 cost management: preparation of the annual administrative budget, control administrative costs, determine the scope of cost-sharing, sharing the office expenses by month; 2.7 information management: responsible for documents, materials, information and publicity, communication links, and ensure promptly, ranking officers reporting; responsible for the collation and analysis of information, provide the basis for corporate decisions; corporate culture construction, planning, editing, internal publications; 2.8 vehicle management: responsible for the management, repairs and maintenance of vehicles; 2.9 legal disputes: the company responsible for the handling of disputes; 2.10 other: maintaining normal working order, and security. General Manager General Manager job description 1, 1.1 develop strategies and plans: according to company strategic planning, establish the annual management plan, reported to the Board of Directors for approval; 1.2 decomposition measures: according to the Board of Directors issued the annual management plan, annual index of decomposition, through the Organization of coordination mandate in charge of the Department Organization and implementation, ensuring comprehensive implementation of annual indicators; 1.3 inspection: convenes the General Manager Office, through 2.2 登录 当终端与UNIX系统连通后,在终端上会出现”login:”提示符。在”login:”提示符下输入用户名,出现”password:”后再输入口令,如以abc用户登录的过程为: Login: abc Password: 输入的口令并不显示出来,输入完口令后,一般会出现上次的登录信息,以及UNIX的版本号。当出现TERM一行时,要求输入所使用的终端类型。最后出现UNIX Shell提示符,等待用户输入命令。 2.3 UNIX命令 一、UNIX命令格式 1、UNIX命令提示符 在命令行下,操作系统会显示一提示符,提示用户在此提示符后可以输入一行命令。不同的Shell有不同的缺省提示符: B Shell和K Shell的缺省提示符为"$"; C Shell的缺省提示符为"%"; 但当以root用户登录时,系统提示符统一缺省为"#"。 用户可以更改自己的缺省Shell和提示符。 2、基本命令格式 在Shell提示符下,就可以输入UNIX命令。UNIX命令的基本格式如下: command 参数1 参数2 ... 参数n UNIX命令由一个命令(command)和零到多个参数构成,命令和参数之间,以及参数与参数之间用空格隔开。UNIX的命令格式和DOS的命令格式相似,但UNIX的命令区分大小写,且命令和参数之间必须隔开。如:对DOS来说是以下四条命令是相同的: cd\tmp cd \tmp CD \tmp cd \Tmp 对UNIX操作系统来说,改变目录的命令也是cd命令,以下是正确的UNIX cd命令: cd /tmp cd /Tmp supplies and get to use, the registration of company assets, record maintenance, maintenance of effective management; 2.6 cost management: preparation of the annual administrative budget, control administrative costs, determine the scope of cost-sharing, sharing the office expenses by month; 2.7 information management: responsible for documents, materials, information and publicity, communication links, and ensure promptly, ranking officers reporting; responsible for the collation and analysis of information, provide the basis for corporate decisions; corporate culture construction, planning, editing, internal publications; 2.8 vehicle management: responsible for the management, repairs and maintenance of vehicles; 2.9 legal disputes: the company responsible for the handling of disputes; 2.10 other: maintaining normal working order, and security. General Manager General Manager job description 1, 1.1 develop strategies and plans: according to company strategic planning, establish the annual management plan, reported to the Board of Directors for approval; 1.2 decomposition measures: according to the Board of Directors issued the annual management plan, annual index of decomposition, through the Organization of coordination mandate in charge of the Department Organization and implementation, ensuring comprehensive implementation of annual indicators; 1.3 inspection: convenes the General Manager Office, through5 但tmp和Tmp是两个不同的目录。以下两条命令: cd/tmp CD /tmp 已经不是cd命令了。 3、在一行中运行多个命令 可以在一行中输入多个命令,命令间用“;”分开,如: mkdir tmp ; cp file1 tmp/file2 ; ls -l tmp UNIX会顺序执行以上三条命令。 4、在后台运行程序 要让程序在后台执行,只需在命令行的最后加上“&”符号。 [例1] 在后台运行find命令,在当前目录及其子目路下查找文件名为abc的文件。 执行命令和立即显示的内容如下: $ find . -name abc -print& 10722 $ ... 10722表示进程号(PID)。当find命令在后台执行完后,会显示结果。 当在后台运行命令时,最好将其输出重定向输出到一个文件中去,以便以后检查。 [例2] 在后台运行find命令,在当前目录及其子目路下查找文件名为abc的文件并将结果存到myfind文件中。 执行命令如下: $ find . -name abc -print>myfind& 在运行后台程序的同时可以继续输入命令。 5、nohup命令 当终端退出后,由该终端启动的后台程序自动退出。要想终端退出后程序不停止运行,则要用nohup命令启动后台程序。如对于例2的命令加入nohup后变为: $ nohup find . -name abc -print>myfind& 二、特殊按键 在UNIX命令操作中有一些特殊键,列表如下: 结束键盘输入或退出当前shell Ctrl + d 中断键,停止当前动作回到shell Del 暂停屏幕输出 Ctrl+s supplies and get to use, the registration of company assets, record maintenance, maintenance of effective management; 2.6 cost management: preparation of the annual administrative budget, control administrative costs, determine the scope of cost-sharing, sharing the office expenses by month; 2.7 information management: responsible for documents, materials, information and publicity, communication links, and ensure promptly, ranking officers reporting; responsible for the collation and analysis of information, provide the basis for corporate decisions; corporate culture construction, planning, editing, internal publications; 2.8 vehicle management: responsible for the management, repairs and maintenance of vehicles; 2.9 legal disputes: the company responsible for the handling of disputes; 2.10 other: maintaining normal working order, and security. General Manager General Manager job description 1, 1.1 develop strategies and plans: according to company strategic planning, establish the annual management plan, reported to the Board of Directors for approval; 1.2 decomposition measures: according to the Board of Directors issued the annual management plan, annual index of decomposition, through the Organization of coordination mandate in charge of the Department Organization and implementation, ensuring comprehensive implementation of annual indicators; 1.3 inspection: convenes the General Manager Office, through 继续屏幕输出 Ctrl+q kill键,删除光标所在行的所有字符 Ctrl+u 结束当前的操作状态(如vi) Esc 三、UNIX常用简单命令 下表列出了几个简单的UNIX命令: 解释 UNIX命令 命令举例 查看帮助信息 man man date 查看日期 date date 显示日历 cal cal 1998 显示大写大字 banner banner “ABCD” 计算器 bc bc 修改口令 passwd passwd 查看谁在使用系统 who who 查看我是谁 who am i who am i 显示用户信息 finger finger 用户名 清除屏幕 clear clear 1、man命令 - 查看帮助信息 举例: 查看man的使用方法: man 查看finger命令的帮助信息: man finger 2、date命令 - 显示、修改日期和时间 显示时间的命令如下: date 显示如下: Mon Aug 17 13:43:14 NST 1998 表示NST标准时间,1998年8月17日13:43:14,星期一。 3、cal命令 - 显示日历 举例: 显示1998年全年日历: cal 1998 显示1998年8月日历: cal 8 1998 4、banner命令 - 显示大写大字 举例:在屏幕上用大字显示“HUAWEI”,命令如下 banner "HUAWEI" 5、bc命令 - 简单计算器 bc命令可以进行加、减、乘、除、求模、乘方运算,运算符分别为“+”“-”“*”“/” “%”“^”。bc使用举例如下 bc 以后输入算式即可,如: 1234 * 3 + 2^4 supplies and get to use, the registration of company assets, record maintenance, maintenance of effective management; 2.6 cost management: preparation of the annual administrative budget, control administrative costs, determine the scope of cost-sharing, sharing the office expenses by month; 2.7 information management: responsible for documents, materials, information and publicity, communication links, and ensure promptly, ranking officers reporting; responsible for the collation and analysis of information, provide the basis for corporate decisions; corporate culture construction, planning, editing, internal publications; 2.8 vehicle management: responsible for the management, repairs and maintenance of vehicles; 2.9 legal disputes: the company responsible for the handling of disputes; 2.10 other: maintaining normal working order, and security. General Manager General Manager job description 1, 1.1 develop strategies and plans: according to company strategic planning, establish the annual management plan, reported to the Board of Directors for approval; 1.2 decomposition measures: according to the Board of Directors issued the annual management plan, annual index of decomposition, through the Organization of coordination mandate in charge of the Department Organization and implementation, ensuring comprehensive implementation of annual indicators; 1.3 inspection: convenes the General Manager Office, through7 按回车显示结果,以后等待输入其它算式。按+d键退出bc。 6、passwd命令 - 修改口令 要修改自己的口令,只需运行: passwd 以后系统会提示输入原来口令,并输入新口令。 7、who命令 - 查看正在使用UNIX的用户 用法如下: who 系统会显示正在使用UNIX的用户名、终端号和登录时间。要查看使用者自己的信息,运行: who am i 8、finger命令 - 显示用户信息 finger命令比who命令显示的信息量大,功能强。基本使用方法如下: 显示登录信息: finger 显示smith用户详细信息: finger smith 9、clear命令 - 清除屏幕 clear 四、UNIX用户间简单通讯命令 UNIX提供许多方式让用户相互通信,它允许你以文本的方式发送及接收信息。你可以传递信息给其他用户、所有用户、或自己。信息来源可以是文本文件或直接由键盘输入的内容。 (一)write 命令 可使用write 实用程序向已登录的另一个用户发送一条报文,当对方也使用write 命令时,双方之间就建立了通信。 当用户使用write 命令时,就在对方用户终端上显示提示信息。write 命令的格式如下: write destination-user [terminal] 其中,destination-user 是你想与之通信的用户注册名,通常使用who 命令查看其注册名。如果对方在多台终端上登录,可通过用terminal 来控制write 的报文送向指定的终端。为了建立与其他用户的双向通话,用户和对方每次必须执行write 命令,且必须指定注册名。一般在使用UNIX 进行通话时,通信双方有一些约定:用“o” 表示结束一条报文,“oo” 表示结束这次通信,用ctrl-d 退出write 命令。 [例1] UNIX上两用户alex 和jenny 通过write命令通信。 在alex的所在终端上(表示回车): $ write alex Hi Alex, are you there? o Message from Alex (tty11)[Sat Jan 5 15:08]…. Yes Jenny, I?m here. o …… Thank you ,Alex, bye! oo supplies and get to use, the registration of company assets, record maintenance, maintenance of effective management; 2.6 cost management: preparation of the annual administrative budget, control administrative costs, determine the scope of cost-sharing, sharing the office expenses by month; 2.7 information management: responsible for documents, materials, information and publicity, communication links, and ensure promptly, ranking officers reporting; responsible for the collation and analysis of information, provide the basis for corporate decisions; corporate culture construction, planning, editing, internal publications; 2.8 vehicle management: responsible for the management, repairs and maintenance of vehicles; 2.9 legal disputes: the company responsible for the handling of disputes; 2.10 other: maintaining normal working order, and security. General Manager General Manager job description 1, 1.1 develop strategies and plans: according to company strategic planning, establish the annual management plan, reported to the Board of Directors for approval; 1.2 decomposition measures: according to the Board of Directors issued the annual management plan, annual index of decomposition, through the Organization of coordination mandate in charge of the Department Organization and implementation, ensuring comprehensive implementation of annual indicators; 1.3 inspection: convenes the General Manager Office, through Ctrl-d $ 该例说明了使用write 命令实现Alex 和Jenny 的通信过程。首先Jenny 使用前两行向Alex发送了一条报文,接下来的两行是Alex 发送的报文Jenny 收到了,省略号表示他们的通信继续。最后,Jenny 用thank you,Alex,bye~oo 告诉Alex没有话要说了,并在下一行开始键入ctrl-d 来退出write 并回到shell。 (二)使用talk双方对话 talk 命令是一个虚拟通信命令,它允许登录双方通过键盘实时对话,其格式如下: talk user-name [terminal]〈CR〉 注意,使用talk 进行双方对话时,双方使用的机器体系结构必须相同。当对方给出响应的talk命令后,双方终端上都显示 [connect established] 时,双方可双工通信了。双方可以以任意的速度从键盘输入,talk 把你的输入一行一行的显示在你和对方的屏幕上。用退出talk 。 (三)使用mesg 拒绝和允许接收报文 mesg 命令允许或拒绝接收由其它终端发来的write 和talk通讯信息。mesg命令在本地终端运行,其使用格式如下: mesg [y] [n]〈CR〉 其中,y 表示允许接收,n 表示拒绝接收。如既不给出y 也不给出n ,则 报告 软件系统测试报告下载sgs报告如何下载关于路面塌陷情况报告535n,sgs报告怎么下载竣工报告下载 现在的许可状态。例: [例1] 显示状态: $mesg 则命令的执行结果为: is y 或 is n [例2] 拒绝接收由其它终端发来的write 和talk通讯信息: $mesg n $mesg is n (四)wall 广播式消息传递 所有登录用户都可收到该消息。仅超级用户使用该命令。wall命令有以下几种格式: # wall # wall filename send a message to all the people。” # wall “ supplies and get to use, the registration of company assets, record maintenance, maintenance of effective management; 2.6 cost management: preparation of the annual administrative budget, control administrative costs, determine the scope of cost-sharing, sharing the office expenses by month; 2.7 information management: responsible for documents, materials, information and publicity, communication links, and ensure promptly, ranking officers reporting; responsible for the collation and analysis of information, provide the basis for corporate decisions; corporate culture construction, planning, editing, internal publications; 2.8 vehicle management: responsible for the management, repairs and maintenance of vehicles; 2.9 legal disputes: the company responsible for the handling of disputes; 2.10 other: maintaining normal working order, and security. General Manager General Manager job description 1, 1.1 develop strategies and plans: according to company strategic planning, establish the annual management plan, reported to the Board of Directors for approval; 1.2 decomposition measures: according to the Board of Directors issued the annual management plan, annual index of decomposition, through the Organization of coordination mandate in charge of the Department Organization and implementation, ensuring comprehensive implementation of annual indicators; 1.3 inspection: convenes the General Manager Office, through9 2.4 注销(退出UNIX系统) 在每次使用完后,一定要进行注销,以防他人通过你的帐号进入系统,并保证系统的完整性。注销过程如下:在UNIX提示符下,运行: $ exit 或 $ logout 或直接按键: Ctrl+d。 由于UNIX操作系统的不同,注销的命令也可能不同。 第三章 UNIX文件系统 3.1 UNIX文件系统分类 UNIX操作系统可由多个可以动态安装及拆卸的文件系统组成。UNIX文件系统主要分为两大类:根文件系统和附加文件系统。 根文件系统(the root file system) 每一个UNIX操作系统在其主硬盘上至少含有一个文件系统,它包含构成操作系统的程序和目录,一般由“/”符号来表示。 附加文件系统 除根文件系统外的其它文件系统,如/u文件系统,AFS文件系统等。附加文件系统必须挂(mount)到根文件系统的某个目录下才能使用。 以后如无特别声明,本文都是针对根文件系统来进行说明的。 3.2 UNIX文件类型 在UNIX中文件共分为四种: 1 普通文件(ordinary file),分为: (1) 文本文件 (2) 二进制文件 2 目录文件(directory) 3 特殊文件(special file),分为: (1) 块设备文件 (2)字符设备文件 4 符号链接文件(symbolic links) 普通文件用于存放程序、数据等,我们绝大部分处理的文件就是这种文件。UNIX把所有普通文件处理成字节流,没有规定文件的具体结构。文件的具体类型由程序的开发者定义,总体上来说一般将普通文件分为文本文件和二进制文件。文本文件是可以用vi等编辑器能够编辑并可通过显示命令显示的文件;不是文本文件的文件统称为二进制文件。 目录文件用来存放文件的目录。 特殊文件也称设备文件,代表着某种设备,一般放在/dev目录下,如/dev/cd0表示光驱。特殊文件分为块设备文件和字符设备文件,块设备文件以区块为输入输出单元,如磁盘;字符设备文件是以字符作为输入输出单元,如串口。 符号连接文件包含一指针,这指针会指向文件的所在。 supplies and get to use, the registration of company assets, record maintenance, maintenance of effective management; 2.6 cost management: preparation of the annual administrative budget, control administrative costs, determine the scope of cost-sharing, sharing the office expenses by month; 2.7 information management: responsible for documents, materials, information and publicity, communication links, and ensure promptly, ranking officers reporting; responsible for the collation and analysis of information, provide the basis for corporate decisions; corporate culture construction, planning, editing, internal publications; 2.8 vehicle management: responsible for the management, repairs and maintenance of vehicles; 2.9 legal disputes: the company responsible for the handling of disputes; 2.10 other: maintaining normal working order, and security. General Manager General Manager job description 1, 1.1 develop strategies and plans: according to company strategic planning, establish the annual management plan, reported to the Board of Directors for approval; 1.2 decomposition measures: according to the Board of Directors issued the annual management plan, annual index of decomposition, through the Organization of coordination mandate in charge of the Department Organization and implementation, ensuring comprehensive implementation of annual indicators; 1.3 inspection: convenes the General Manager Office, through 文件类型标识 在用”ls -l”命令显示文件目录时的用下列符号表示不同的文件类型: - 普通文件 d 目录文件 b 块设备文件 c 字符设备文件 l 符号链接文件 举例: $ ls –l -rwxr-xr-- 2 wjm newservice 321 Oct 17 09:33 file1 drwxr-xr-x 2 wjm newservice 96 Oct 17 09:40 dir1 其中,第一列的“-”表示file1是普通文件,“d”表示dir1为目录文件。 3.3 UNIX树型目录结构 UNIX操作系统采用树型带勾连的目录结构,如下图所示。在这种结构中,一个文件的名字是由根目录到该文件的路径上的所有节点名按顺序构成的,相互之间用“/”分开。如文件prog的全路径名为:/usr/smith/prog,根目录用“/”表示。 根文件系统常用目录 根文件系统的常用目录举例如下表: / bin lib usr dev etc smith sybase prog d install 根目录,这是所有目录和文件的起点 / 大部分可执行的UNIX命令和共用程序 /bin 设备文件,如/dev/cd0 /dev 系统管理命令和数据文件 /etc C程序库 /lib 存放用户的家目录和用户共用程序或文件 /usr 临时工作目录,存放一些临时文件 /tmp supplies and get to use, the registration of company assets, record maintenance, maintenance of effective management; 2.6 cost management: preparation of the annual administrative budget, control administrative costs, determine the scope of cost-sharing, sharing the office expenses by month; 2.7 information management: responsible for documents, materials, information and publicity, communication links, and ensure promptly, ranking officers reporting; responsible for the collation and analysis of information, provide the basis for corporate decisions; corporate culture construction, planning, editing, internal publications; 2.8 vehicle management: responsible for the management, repairs and maintenance of vehicles; 2.9 legal disputes: the company responsible for the handling of disputes; 2.10 other: maintaining normal working order, and security. General Manager General Manager job description 1, 1.1 develop strategies and plans: according to company strategic planning, establish the annual management plan, reported to the Board of Directors for approval; 1.2 decomposition measures: according to the Board of Directors issued the annual management plan, annual index of decomposition, through the Organization of coordination mandate in charge of the Department Organization and implementation, ensuring comprehensive implementation of annual indicators; 1.3 inspection: convenes the General Manager Office, through11 UNIX的目录结构与DOS有些相似,但文件路径的书写方式不同。任何文件的路径全称都是以“/”开头,名字间用“/”隔开,如/tmp/data/fox;而DOS的文件路径全称以盘符开头,名字间用“\”隔开,如:c:\tmp\data\fox。 家目录 UNIX在创建用户名时,一般会创建一个目录专门供该用户使用,这个目录称为该用户的家目录(Home Directory)。缺省家目录一般放在/usr目录下,目录名与用户名称相同,如/usr/smith。 家目录中有一个文件比较特殊:“.profile”(或“.login”)文件。当以该家目录的用户名登录UNIX时,会自动执行“.profile”文件。它有点类似于DOS的AUTOEXEC.BAT文件。“.profile”是B/K shell的启动文件,而“.login”是C shell的启动文件。“.profile”文件中常有一行: PATH=$HOME:$HOME/bin 其中,PATH类似DOS的PATH,而$HOME表示家目录。 3.4 UNIX文件名称 UNIX文件名称 最大长度为255字节; 大小写敏感(file1和File1表示两个不同的文件); 无专用扩展名(UNIX文件名可出现多个小数点,并无特殊含义)。 UNIX特殊文件名 表示根目录 / 表示当前目录 . 表示当前目录的父目录 .. .字符串 表示隐含文件,如”.profile”文件 文件名通配符 , 任一个字符,如”abc?”表示此字符串有4个字符,前三个字 符为abc 任何字符,如”ab*10”表示以ab开头和以10结尾的名字。 * 注:与DOS文件通配符*有区别。 3.5 UNIX文件存取权限 一、文件的存取权限 UNIX文件的存取有三种权限: 权限 普通文件的存取权限 目录的存取权限 具有读取文件的权利 能读取文件名称 r 具有写入文件的权利 能建立和删除文件,可以改变文件名 w 具有执行文件的权利 能使用该目录下的文件(如cd命令)搜索文件等 x 二、能够存取文件的用户类型 有三种类型的用户可以存取文件: supplies and get to use, the registration of company assets, record maintenance, maintenance of effective management; 2.6 cost management: preparation of the annual administrative budget, control administrative costs, determine the scope of cost-sharing, sharing the office expenses by month; 2.7 information management: responsible for documents, materials, information and publicity, communication links, and ensure promptly, ranking officers reporting; responsible for the collation and analysis of information, provide the basis for corporate decisions; corporate culture construction, planning, editing, internal publications; 2.8 vehicle management: responsible for the management, repairs and maintenance of vehicles; 2.9 legal disputes: the company responsible for the handling of disputes; 2.10 other: maintaining normal working order, and security. General Manager General Manager job description 1, 1.1 develop strategies and plans: according to company strategic planning, establish the annual management plan, reported to the Board of Directors for approval; 1.2 decomposition measures: according to the Board of Directors issued the annual management plan, annual index of decomposition, through the Organization of coordination mandate in charge of the Department Organization and implementation, ensuring comprehensive implementation of annual indicators; 1.3 inspection: convenes the General Manager Office, through 用户类型 说明 文件的属主(拥有者) owner 用户组内成员 group 其他用户(非owner和非group) other 每种类型的用户都有三种文件存取权限:r、w、x。 三、文件存取权限的显示 可以通过”ls -l”命令显示,如: $ ls -l file1 显示如下: -rwxr-xr-- 2 wjm newservice 321 Oct 17 09:33 file1 上行中: 第2-4字符”rwx”表示此文件属主wjm对文件file1的权利为”可读、可写、可执行”; 第5-7字符”r-x” 表示此用户组newservice内的用户对文件file1的权利为: ”可读、不可写、可执行”; 第8-10字符”r--” 表示其他用户对文件file1的权利为”可读、不可写、不可执行” 四、文件存取权限的修改 用chmod命令修改文件的存取权限,chmod命令的格式如下: 格式1: chmod symbolic_mode file… 格式2: chmod absolute_mode file… (一)格式1:符号模式(symbolic_mode), 符号模式的命令格式如下: chmod [who] op permision file… who项表示用户类型,它的内容为以下一项或多项: 文件属主(user --- owner) u 用户组(group) g 其他人(other) o 所有人(all) a op项表示动作: 表示要加上permission指定的权利 + 表示要取消permission指定的权利 - supplies and get to use, the registration of company assets, record maintenance, maintenance of effective management; 2.6 cost management: preparation of the annual administrative budget, control administrative costs, determine the scope of cost-sharing, sharing the office expenses by month; 2.7 information management: responsible for documents, materials, information and publicity, communication links, and ensure promptly, ranking officers reporting; responsible for the collation and analysis of information, provide the basis for corporate decisions; corporate culture construction, planning, editing, internal publications; 2.8 vehicle management: responsible for the management, repairs and maintenance of vehicles; 2.9 legal disputes: the company responsible for the handling of disputes; 2.10 other: maintaining normal working order, and security. General Manager General Manager job description 1, 1.1 develop strategies and plans: according to company strategic planning, establish the annual management plan, reported to the Board of Directors for approval; 1.2 decomposition measures: according to the Board of Directors issued the annual management plan, annual index of decomposition, through the Organization of coordination mandate in charge of the Department Organization and implementation, ensuring comprehensive implementation of annual indicators; 1.3 inspection: convenes the General Manager Office, through13 permission项为存取权限,它的内容为以下一项或多项: 表示可读 r 表示可写 w 表示可执行 x 举例: chmod u+w test report 属主对test和report文件“可写” chmod u-x abc.c 属主对abc.c文件不可执行 chmod u+rwx myfile1 属主对myfile1“可读、可写、可执行” chmod ugo+rwx myfile2 任何人都对myfile1“可读、可写、可执行” (二)格式2:绝对模式(absolute_mode), 符号模式的命令格式如下: chmod xyz file… x、y、z分别是0-7的数字,分别表示属主、用户组、其他人对该文件的存取权限。x、y、z的取值 公式 小学单位换算公式大全免费下载公式下载行测公式大全下载excel公式下载逻辑回归公式下载 均为: a*4 + b*2 + c 其中, a=1分别表示可读,a=0表示不可读; =1分别表示可写,b=0表示不可写; b c=1分别表示可执行,c=0表示不可执行; 举例: chmod 751 ncp 属主对ncp拥有“可读、可写、可执行”的全部权利; 组内成员对ncp只有“可读、可执行”的权利; 其他用户对ncp只有“可执行”的权利。 五、改变文件属主及文件所在组 改变文件属主的格式如下: chown 属主名 文件名 必须对文件具有write权利才可改变文件的属主。 改变文件所在组的格式如下: chgrp 组名 文件名 必须是文件的属主或supervisor才能改变文件组别的归属。 举例: 将文件test1的属主改为wjm chown wjm test1 supplies and get to use, the registration of company assets, record maintenance, maintenance of effective management; 2.6 cost management: preparation of the annual administrative budget, control administrative costs, determine the scope of cost-sharing, sharing the office expenses by month; 2.7 information management: responsible for documents, materials, information and publicity, communication links, and ensure promptly, ranking officers reporting; responsible for the collation and analysis of information, provide the basis for corporate decisions; corporate culture construction, planning, editing, internal publications; 2.8 vehicle management: responsible for the management, repairs and maintenance of vehicles; 2.9 legal disputes: the company responsible for the handling of disputes; 2.10 other: maintaining normal working order, and security. General Manager General Manager job description 1, 1.1 develop strategies and plans: according to company strategic planning, establish the annual management plan, reported to the Board of Directors for approval; 1.2 decomposition measures: according to the Board of Directors issued the annual management plan, annual index of decomposition, through the Organization of coordination mandate in charge of the Department Organization and implementation, ensuring comprehensive implementation of annual indicators; 1.3 inspection: convenes the General Manager Office, through 将文件test1的用户组改为newservice chgrp newservice test1 3.6 UNIX重定向与管道 UNIX重定向 将文件的标准输出重新定向输出到文件,或将数据文件作为另一程序的标准输入内容。重定向符号如下: < 重定向输入 > 重定向输出 >> 重定向输出并追加到尾部 例如: ls -l > file1 将ls -l命令显示的内容存到file1中, ls >> file1 将ls 命令显示的内容附加存到file1的尾部 grep abc < file1 将file1的内容作为grep abc命令的输入 其中,">"和">>"为输出重定向符,">"将输出内容存到重定向文件中,若文件存在,则先删除原有内容;">>"将输出内容存到重定向文件的尾部。 UNIX管道 将一文件的输出作为另一文件的输入。管道符号如下: | 将左边命令的输出,作为右边命令的输入 例如: ls|more 将ls的输出作为more命令的输入 ps -ef|grep smith ps -ef的输出作为grep smith命令的输入 3.7 UNIX文件系统常用命令 UNIX命令举例 类似DOS命令 UNIX 命令 显示当前目录 pwd cd pwd 改变目录 cd /usr cd c:\usr cd 进入家目录 cd cd 创建目录 mkdir abc md abc mkdir 删除空目录 rmdir abc rd abc rmdir 删除目录及其内容 rm -r abc deltree abc rm -r 显示目录内容 ls abc dir abc ls ls -l abc(文件长列表) ls -a abc(所有类型文件) ls -d * (不进子目录) 显示文本文件内容 cat file1.c type file1.c cat 一次一屏显示文本 more file1.c more 文件内容 拷贝文件 cp file1 file2 copy file1 file2 cp 移动(重命名)文件 mv call.test call.list move call.tst call.lst mv ren call.test bbb supplies and get to use, the registration of company assets, record maintenance, maintenance of effective management; 2.6 cost management: preparation of the annual administrative budget, control administrative costs, determine the scope of cost-sharing, sharing the office expenses by month; 2.7 information management: responsible for documents, materials, information and publicity, communication links, and ensure promptly, ranking officers reporting; responsible for the collation and analysis of information, provide the basis for corporate decisions; corporate culture construction, planning, editing, internal publications; 2.8 vehicle management: responsible for the management, repairs and maintenance of vehicles; 2.9 legal disputes: the company responsible for the handling of disputes; 2.10 other: maintaining normal working order, and security. General Manager General Manager job description 1, 1.1 develop strategies and plans: according to company strategic planning, establish the annual management plan, reported to the Board of Directors for approval; 1.2 decomposition measures: according to the Board of Directors issued the annual management plan, annual index of decomposition, through the Organization of coordination mandate in charge of the Department Organization and implementation, ensuring comprehensive implementation of annual indicators; 1.3 inspection: convenes the General Manager Office, through15 删除文件 rm call.list del call.lst rm 一、pwd命令 pwd命令用来显示当前目录路径,命令如下: pwd 二、cd命令 cd命令用于改变当前的目录,如: 命令举例 说明 cd /usr/smith 改变到/usr/smith目录 cd ../wjm 改变到父目录下的wjm子目录 cd exam1 改变到当前目录下的exam1子目录 cd 改变到家目录 不带参数的cd命令表示进入家目录,这点与DOS有本质区别。 三、rm命令 rm命令可以删除文件及目录,举例如下: 命令举例 说明 rm file2 删除当前目录下的文件file2 rm file* 删除当前目录下以file开头的文件 rm -r /usr/wjm/exam2 删除目录/usr/wjm/exam2及其内容 四、ls命令 ls命令可以显示目录内容,命令格式如下: ls -选项 文件名 其中的常用选项说明如下: -l 长列表显示目录内容 -a 显示所有类型文件,包括隐含文件 -d 如果显示内容包含目录名,则只显示目录名字不显示目录内容 命令举例如下: 命令举例 说明 ls 显示当前目录内容 ls file* 显示除当前目录下以file开头的文件 ls -l /usr/wjm/exam2 长列表显示目录/usr/wjm/exam2内容 ls -adl 显示当前目录内容(同时带-l、-d、-a参数) [注] ”ls -l”命令显示格式如下: drwxrwxr-x 2 smith group 48 Jan 05 1998 john -rwxr-xr-- 1 wjm newservice 321 Oct 17 09:33 file2 上面每行中: 第一列: 第1个字符表示文件的类型(d表示目录,-表示普通文件); 第2-4字符表示文件属主对此文件的访问权限(如:“rwx”和“rwx”); 第5-7字符表示用户组对此文件的访问权限(如:“rwx”和“r-x”); 第8-10字符表示其他用户对此文件的访问权限(如:“r-x”和“r--”); 其中,访问权限用三个字符表示,顺序是“rwx”,“r”表示可读、“w”表示 可写、“x”表示可执行。若某项禁止访问则为“-”,如:“r-x”表示可读、 supplies and get to use, the registration of company assets, record maintenance, maintenance of effective management; 2.6 cost management: preparation of the annual administrative budget, control administrative costs, determine the scope of cost-sharing, sharing the office expenses by month; 2.7 information management: responsible for documents, materials, information and publicity, communication links, and ensure promptly, ranking officers reporting; responsible for the collation and analysis of information, provide the basis for corporate decisions; corporate culture construction, planning, editing, internal publications; 2.8 vehicle management: responsible for the management, repairs and maintenance of vehicles; 2.9 legal disputes: the company responsible for the handling of disputes; 2.10 other: maintaining normal working order, and security. General Manager General Manager job description 1, 1.1 develop strategies and plans: according to company strategic planning, establish the annual management plan, reported to the Board of Directors for approval; 1.2 decomposition measures: according to the Board of Directors issued the annual management plan, annual index of decomposition, through the Organization of coordination mandate in charge of the Department Organization and implementation, ensuring comprehensive implementation of annual indicators; 1.3 inspection: convenes the General Manager Office, through 不可写、可执行; 第二列:此文件的链接数(如:2和1); 第三列:此文件的属主名(如:smith和wjm); 第四列:用户组名(如:group和newservice); 第五列:文件所占字节数(如:48和321); 第六至八列:最后修改的日期和时间(如:“Jan 05 1998”和“Oct 17 09:33”); 第九列:文件名(如:john和file2)。 五、mkdir、rmdir、cat、more、cp、mv命令 这些命令和DOS的相应命令功能和用法基本一致,它们和DOS命令的对应关系如下: UNIX命令 DOS命令 mkdir mkdir或md rmdir rmdir或rd cat type more more cp copy mv move或ren 第四章 UNIX文件系统 常用工具和实用程序 4.1 vi编辑器的最基本用法 vi编辑器是UNIX的强有力的文本文件编辑工具,利用它可以建立、修改文本文件。 vi编辑器常用的两种状态方式 1) 文本输入方式 用于文本的输入 2) 命令方式 用于输入控制命令 vi编辑器的进入 vi 文件名 自动进入命令方式。 文本输入方式的进入 将在光标所在位置之后插入文本(append) a 将在光标所在行末插入文本 A 将在光标所在位置之前插入文本(insert) i 将在光标所在行的第一个非空字符前插入文本 I 将在光标所在行的下一行开始插入文本(open) o 将在光标所在行的上一行开始插入文本 O supplies and get to use, the registration of company assets, record maintenance, maintenance of effective management; 2.6 cost management: preparation of the annual administrative budget, control administrative costs, determine the scope of cost-sharing, sharing the office expenses by month; 2.7 information management: responsible for documents, materials, information and publicity, communication links, and ensure promptly, ranking officers reporting; responsible for the collation and analysis of information, provide the basis for corporate decisions; corporate culture construction, planning, editing, internal publications; 2.8 vehicle management: responsible for the management, repairs and maintenance of vehicles; 2.9 legal disputes: the company responsible for the handling of disputes; 2.10 other: maintaining normal working order, and security. General Manager General Manager job description 1, 1.1 develop strategies and plans: according to company strategic planning, establish the annual management plan, reported to the Board of Directors for approval; 1.2 decomposition measures: according to the Board of Directors issued the annual management plan, annual index of decomposition, through the Organization of coordination mandate in charge of the Department Organization and implementation, ensuring comprehensive implementation of annual indicators; 1.3 inspection: convenes the General Manager Office, through17 光标位置移动 左移 h 下移 j 上移 k 右移 l 行号G 光标移到某行(如1G表示光标移到第一行) 光标移到文件结尾 G 文本输入方式的退出 按ESC键进入命令方式 ESC 删除更改操作 在命令方式下运行。 删除光标所在字符 x 删除光标所在行 dd 退出vi编辑器 在命令方式下运行。不管在什么状态,最好在运行下面命令前,先按以下ESC键,以 防出错。 存盘退出 :wq 不存盘退出 :q 不存盘强制退出 :q! 只存盘不退出 :w 4.2 利用find命令查找文件 find命令会在指定目录及其子目录下查找符合条件的特定文件。此命令的最大用处是当 忘了文件的正确所在,而想找到该文件。 命令格式 find 目录名 条件 目录名 --- 欲开始寻找的目录所在。find会寻找此目录及其子目录。可以有多个目录 名称,只要目录与目录之间用空格分开即可。 条件 --- 欲搜索文件的条件,可包含文件名称、属主、最后修改时间等等。 条件列表说明 -name name 指定要被寻找的文件或目录名称, 可用通配符,如, -name „*.c? 将符合条件的路径打印出来 -print supplies and get to use, the registration of company assets, record maintenance, maintenance of effective management; 2.6 cost management: preparation of the annual administrative budget, control administrative costs, determine the scope of cost-sharing, sharing the office expenses by month; 2.7 information management: responsible for documents, materials, information and publicity, communication links, and ensure promptly, ranking officers reporting; responsible for the collation and analysis of information, provide the basis for corporate decisions; corporate culture construction, planning, editing, internal publications; 2.8 vehicle management: responsible for the management, repairs and maintenance of vehicles; 2.9 legal disputes: the company responsible for the handling of disputes; 2.10 other: maintaining normal working order, and security. General Manager General Manager job description 1, 1.1 develop strategies and plans: according to company strategic planning, establish the annual management plan, reported to the Board of Directors for approval; 1.2 decomposition measures: according to the Board of Directors issued the annual management plan, annual index of decomposition, through the Organization of coordination mandate in charge of the Department Organization and implementation, ensuring comprehensive implementation of annual indicators; 1.3 inspection: convenes the General Manager Office, through -size n 寻找占用n个block的文件 -type x 以文件类型作为寻找条件。文件类型x如下: d --- 目录(directory), f --- 文件(file), b --- 块(block), c -- 字符(character), p --- 管道(pipe) -user user 寻找属于user所拥有的文件, user可为用户名或uid号 -group group 寻找用户组为group的所有文件, group可为组名称或gid号 -links n 寻找链接数等于n的所有文件 -atim n 寻找n天之前曾被存取的文件 -mtime n 寻找n天之前曾被修改的文件 -exec command {}\; 用寻找到的文件作为执行command的对象, {}内存欲执行command时所需的参数 条件的逻辑运算符: 逻辑运逻辑举例 说明 算符 意义 ~ 非 ~-name “*.c” 所有不以.c为扩展名的文件 或 -size +10 -o -links 3 所有大于10block或链接数为3的文件 -o 与 -size +10 -links 3 大于10block且链接数为3的文件 注:上表中的“+10”表示大于10,“-10”表示小于10。 基本用法举例 find /temp -name “abc*” -print 在/temp目录下查找文件名以abc开始的 文件 find . -name test -print 在当前目录下查找文件名为test的文件 4.3 grep命令基本用法 grep在整个文本文件中寻找特定字符串,并将所有出现该字符串的行打印。 命令格式 grep 字符串 文件名 举例 grep abcd temp 在temp中查找abcd字符串 grep "This is a book" temp 在temp中查找”This is a book”字符 串,由于字符串中含有空格,故要 用引号括起来 supplies and get to use, the registration of company assets, record maintenance, maintenance of effective management; 2.6 cost management: preparation of the annual administrative budget, control administrative costs, determine the scope of cost-sharing, sharing the office expenses by month; 2.7 information management: responsible for documents, materials, information and publicity, communication links, and ensure promptly, ranking officers reporting; responsible for the collation and analysis of information, provide the basis for corporate decisions; corporate culture construction, planning, editing, internal publications; 2.8 vehicle management: responsible for the management, repairs and maintenance of vehicles; 2.9 legal disputes: the company responsible for the handling of disputes; 2.10 other: maintaining normal working order, and security. General Manager General Manager job description 1, 1.1 develop strategies and plans: according to company strategic planning, establish the annual management plan, reported to the Board of Directors for approval; 1.2 decomposition measures: according to the Board of Directors issued the annual management plan, annual index of decomposition, through the Organization of coordination mandate in charge of the Department Organization and implementation, ensuring comprehensive implementation of annual indicators; 1.3 inspection: convenes the General Manager Office, through19 4.4 利用cmp命令比较文件 cmp可比较两个文件,这两个文件可以是文本文件也可以是非文本文件。cmp命令会显示两个文件第一次数据不同的位置。若两个文件内容相同,则不显示任何信息。 命令格式 cmp [-ls] 文件名1 文件名2 参数说明 显示每个不同之处不同字节的内容 -l 只显示cmp命令的返回值(相同为0,不相同为1) -s 举例 比较temp1和temp2两个文件的内容 cmp temp1 temp2 4.5 文件的备份和恢复实用程序 一、tar命令 使用tar 命令,可将多个文件合并成一个文件库(archival)的方式存放于磁带或磁盘上。当需要时,可由文件库获取所需的文件。tar 的指令格式: $ tar [function-option[modifier]] [files] tar 命令选项分为两部分:功能选项和修改选项。功能选项用来设定tar的动作(如读取,写入等),而修改选项则用来修改tar的动作。tar命令选项前没有“-”。 功能选项(function-option): r 将所指的文件附加在文件库后 x 读取文件库内的文件,如文件名为目录,则连子目录也会被读取 (常用) c 建立一个新文件库 (常用) g 将文件由文件库的最前头开始建立,而不是写在最后一个文件后 修改选项(modifier): v 启动显示模式,tar 会显示所处理的文件名 (常用) w 启动确认模式,tar处理每个文件之前,要求用户先加以确认 f 表示文件库为file,省略此项,以预设的磁带或磁盘为对象 (常用) (一)利用tar 命令备份 [例1] supplies and get to use, the registration of company assets, record maintenance, maintenance of effective management; 2.6 cost management: preparation of the annual administrative budget, control administrative costs, determine the scope of cost-sharing, sharing the office expenses by month; 2.7 information management: responsible for documents, materials, information and publicity, communication links, and ensure promptly, ranking officers reporting; responsible for the collation and analysis of information, provide the basis for corporate decisions; corporate culture construction, planning, editing, internal publications; 2.8 vehicle management: responsible for the management, repairs and maintenance of vehicles; 2.9 legal disputes: the company responsible for the handling of disputes; 2.10 other: maintaining normal working order, and security. General Manager General Manager job description 1, 1.1 develop strategies and plans: according to company strategic planning, establish the annual management plan, reported to the Board of Directors for approval; 1.2 decomposition measures: according to the Board of Directors issued the annual management plan, annual index of decomposition, through the Organization of coordination mandate in charge of the Department Organization and implementation, ensuring comprehensive implementation of annual indicators; 1.3 inspection: convenes the General Manager Office, through $ tar cv work 在当前目录下,对work 目录中的所有文件及子目录作备份,备份到缺省设备,且在备份时显示文件信息。 [例2] $ tar cvf /dev/rfd0135ds18 work f 选项表示不使用缺省设备,而使用提供的设备。 注:在不同的UNIX 系统中,软盘和磁带设备的名称不通用。请使用时注意查正。 (二)利用tar 命令复原: [例3] $tar xv x 表示将缺省设备中的文件复原到硬盘,v 表示复原时显示文件提示。 [例4] $tar xv /work/aaro1d /work/all.bak /work/state.wp 复原更具有选择性,这里列出三个文件。注意,必须输入备份文档的全名。 [例5] $tar xvf /dev/rfd0135ds18 从给定的设备中复原文件。 二、cpio命令 利用cpio 可将文件或目录从文件库获取出来或将数据拷贝到文件库。cpio 的指令格式: cpio –i[bcdmrtuv] [patterns] cpio –o [abcv] cpio –p [adlmuv][directory] 说明:cpio 共有三种基本模式,-o即copy-out 模式,将一组文件copy到一个文件库,-i 即copy-in 模式,读取文件库,并将其展开在当前目录。-p 能从某个目录读取所有文件(包括子目录到另一个目录),且不以archive(归档)的方式存放。 cpio 常配合shell使用。-o常用标准输入设备读取要copy 的文件名称,并将copy成的archive file 通过标准输出设备输出。一般利用输入/输出重定向或管道的原理,达到真正复制的功能。 (一)利用cpio备份: [例1] $ find work –print | cpio –ocdv > /dev/rfd0135ds18 将work目录下的文件备份到软盘上。-o表示输出模式,-c生成一个带有头信息的文件。 -d表示按需要生成目录,-v表示命令执行时不断显示信息。用“>”把结果定向到软盘。 [例2] $ ls |cpio –o >/usr/linfs/old1 将当前目录下的所有文件复制成old1 archive file [例3] $ ls *.c | cpio –o>oldc 复制工作目录中的所有的c程序. supplies and get to use, the registration of company assets, record maintenance, maintenance of effective management; 2.6 cost management: preparation of the annual administrative budget, control administrative costs, determine the scope of cost-sharing, sharing the office expenses by month; 2.7 information management: responsible for documents, materials, information and publicity, communication links, and ensure promptly, ranking officers reporting; responsible for the collation and analysis of information, provide the basis for corporate decisions; corporate culture construction, planning, editing, internal publications; 2.8 vehicle management: responsible for the management, repairs and maintenance of vehicles; 2.9 legal disputes: the company responsible for the handling of disputes; 2.10 other: maintaining normal working order, and security. General Manager General Manager job description 1, 1.1 develop strategies and plans: according to company strategic planning, establish the annual management plan, reported to the Board of Directors for approval; 1.2 decomposition measures: according to the Board of Directors issued the annual management plan, annual index of decomposition, through the Organization of coordination mandate in charge of the Department Organization and implementation, ensuring comprehensive implementation of annual indicators; 1.3 inspection: convenes the General Manager Office, through21 [例4] $ ls| cpio –p /usr/linfs/tempdir 复制当前工作目录下的文件到/usr/linfs/tempdir 目录,不生成archive file (二)利用cpio 复原: [例5] $ cpio –icdv < /dev/rfd0135ds18 将软盘中的文件复原。-i告诉cpio把文件作为它的输入,-d按需要生成目录,-v显示执行时的所有信息,-c具有头文件格式。 [例6] $ cpio –icdv "*stat.wp" < /dev/rfd0135ds18 仅复原*stat.wp的文件 [例7] $ cpio –i 以后就可以在此提示符下输入ftp命令。 [注意事项] 在运行ftp之前必须保证本地计算机和远程主机间的TCP/IP协议已经连通。 (三)ftp常用命令 ftp的常用命令和解释列表如下: ftp命令 解释 ,或help [command] 命令帮助 binary 设定以二进制方式传送文件 ascii 设定以ASCII方式传送文件(缺省值) cd [directory] 改变远程目录 pwd 列出当前远端主机目录 dir [r-dir] [l-file] 显示远程目录内容,r-dir表示远程目录,supplies and get to use, the registration of company assets, record maintenance, maintenance of effective management; 2.6 cost management: preparation of the annual administrative budget, control administrative costs, determine the scope of cost-sharing, sharing the office expenses by month; 2.7 information management: responsible for documents, materials, information and publicity, communication links, and ensure promptly, ranking officers reporting; responsible for the collation and analysis of information, provide the basis for corporate decisions; corporate culture construction, planning, editing, internal publications; 2.8 vehicle management: responsible for the management, repairs and maintenance of vehicles; 2.9 legal disputes: the company responsible for the handling of disputes; 2.10 other: maintaining normal working order, and security. General Manager General Manager job description 1, 1.1 develop strategies and plans: according to company strategic planning, establish the annual management plan, reported to the Board of Directors for approval; 1.2 decomposition measures: according to the Board of Directors issued the annual management plan, annual index of decomposition, through the Organization of coordination mandate in charge of the Department Organization and implementation, ensuring comprehensive implementation of annual indicators; 1.3 inspection: convenes the General Manager Office, through l-file表示本地文件。如果有本地文件,就 将结果写至本地文件 ls [r-dir] [l-file] 同dir,只是显示格式不同 lcd [directory] 改变本地目录 put file1 [file2] 将本地file1文件拷贝到远程file2 get file1 [fine2] 将远程file1文件拷贝到本地file2 mput files 将本地多个文件files拷贝到远程 mget files 将远程多个文件files拷贝到本地 status 显示当前FTP状态 !command 执行本地命令,并立即返回FTP open IP地址或域名 重新建立新的连接 close 关闭远程连接 quit或bye 退出ftp (四)ftp实例 假设远程主机的IP地址为129.6.114.201,操作系统为SCO UNIX,本地计算机为PC机,操作系统为DOS,且ftp客户端程序放在C:\FTP目录下。 [例1] ftp的运行 c: \ftp cd ftp 129.6.114.201 (输入UNIX用户名和口令,会出现提示符:) ftp> [例2] 将本地计算机C:\DOS目录下的help.hlp拷贝到远程主机的/usr/xyw/tmp目录下。 命令如下: ftp> binary ftp> lcd c:\dos ftp> cd /usr/xyw/tmp ftp> put help.hlp [例3] 将本地计算机C:\TEMP\TO目录下的所有文件拷贝到远程主机的/usr/xyw/tmp目录下。命令如下: ftp> binary ftp> lcd c:\temp\to ftp> cd /usr/xyw/tmp ftp> mput *.* [例4] 将远程主机的/usr/xyw/bin/dispdate文本文件拷贝到本地计算机C:\TEMP\FROM目录下。命令如下: ftp> ascii ftp> lcd c:\temp\from ftp> cd /usr/xyw/bin supplies and get to use, the registration of company assets, record maintenance, maintenance of effective management; 2.6 cost management: preparation of the annual administrative budget, control administrative costs, determine the scope of cost-sharing, sharing the office expenses by month; 2.7 information management: responsible for documents, materials, information and publicity, communication links, and ensure promptly, ranking officers reporting; responsible for the collation and analysis of information, provide the basis for corporate decisions; corporate culture construction, planning, editing, internal publications; 2.8 vehicle management: responsible for the management, repairs and maintenance of vehicles; 2.9 legal disputes: the company responsible for the handling of disputes; 2.10 other: maintaining normal working order, and security. General Manager General Manager job description 1, 1.1 develop strategies and plans: according to company strategic planning, establish the annual management plan, reported to the Board of Directors for approval; 1.2 decomposition measures: according to the Board of Directors issued the annual management plan, annual index of decomposition, through the Organization of coordination mandate in charge of the Department Organization and implementation, ensuring comprehensive implementation of annual indicators; 1.3 inspection: convenes the General Manager Office, through29 ftp> get dispmesg [例5] 将远程主机的/usr/xyw/doc目录下的所有文件按文本文件格式拷贝到本地计算机 C:\TEMP\FROM目录下。命令如下: ftp> ascii ftp> lcd c:\temp\from ftp> cd /usr/xyw/doc ftp> mget * [例6] ftp的退出 ftp> close ftp> quit 基础篇小结 第一章主要介绍了UNIX的特点、组成和几个基本概念,同时介绍了UNIX常见的三种 Shell: B Shell、K Shell 和 C Shell。 第二章本章介绍了UNIX的常见命令和操作方法。 , 在使用UNIX操作系统之前必须先登录,使用完成后要注销。 , UNIX简单命令格式和几个常用命令。 , 几个常用UNIX命令和命令操作中常用的特殊按键。 , 用户通讯命令:write、talk、mesg和wall。 第三章主要介绍了文件系统的基本概念和基本命令: , UNIX文件系统分为根文件系统和附加文件系统。 , UNIX的文件类型可分为:一般文件、目录文件、特殊文件和符号链接文件。 , UNIX采用树型目录结构。每个用户拥有自己的家目录。 , UNIX支持长文件名。UNIX的文件名对大小写敏感。 , UNIX文件的存取权限分为:r、w 、x。 , UNIX支持重定向和管道。 , 最后介绍了UNIX文件系统常用命令。 第四章介绍了UNIX文件系统几个常用工具软件: , 利用vi可以对文本文件进行编辑。 , 利用find可以在目录中查找文件名。 , 利用grep可以在文本文件中查找指定字符串。 , 利用cmp可以比较两个文件的内容是否相同。 , tar和cpio是文件备份和恢复两个实用程序。 , 文件的压缩和解压程序很多,本章简要介绍了compress、pack、pkzip、和gzip。 第五章主要介绍了UNIX的简单维护操作:UNIX的开关机、修改系统时间、进程管理、 查看磁盘空间和掉电故障处理。 第六章主要介绍了几个与网络有关命令的功能和使用: , 用finger命令来显示正在使用UNIX系统的用户信息。 , UNIX可以用mail命令收发电子邮件。 supplies and get to use, the registration of company assets, record maintenance, maintenance of effective management; 2.6 cost management: preparation of the annual administrative budget, control administrative costs, determine the scope of cost-sharing, sharing the office expenses by month; 2.7 information management: responsible for documents, materials, information and publicity, communication links, and ensure promptly, ranking officers reporting; responsible for the collation and analysis of information, provide the basis for corporate decisions; corporate culture construction, planning, editing, internal publications; 2.8 vehicle management: responsible for the management, repairs and maintenance of vehicles; 2.9 legal disputes: the company responsible for the handling of disputes; 2.10 other: maintaining normal working order, and security. General Manager General Manager job description 1, 1.1 develop strategies and plans: according to company strategic planning, establish the annual management plan, reported to the Board of Directors for approval; 1.2 decomposition measures: according to the Board of Directors issued the annual management plan, annual index of decomposition, through the Organization of coordination mandate in charge of the Department Organization and implementation, ensuring comprehensive implementation of annual indicators; 1.3 inspection: convenes the General Manager Office, through , telnet和ftp用于远程登录和文件拷贝。 基础篇习题 1、什么是UNIX shell? UNIX有哪几种shell? 它们各自的启动命令是什么, 2、解释进程、设备。 3、UNIX有哪几种常用文件类型,分别用什么符号表示, 4、UNIX文件名通配符“abc*th”,和“abc?”分别表示什么含义, 5、UNIX的文件存取权限有哪些,分别表示什么含义, 6、举例说明UNIX文件系统中常用目录的作用, 7、在后台运行find命令,在/usr/abc目录及其子目录查找以a开头的文件,并将结果存到ddd.dat文件中。 8、为什么UNIX在关机前要先shutdown, 9、如何停止失控的进程, 10、将本地计算机C:\FILE1\目录下的文本文件TTT.SQL拷贝到远程UNIX主机(ip地址129.6.114.201)的/usr/abc/ttt文件中去,请写出ftp命令。 supplies and get to use, the registration of company assets, record maintenance, maintenance of effective management; 2.6 cost management: preparation of the annual administrative budget, control administrative costs, determine the scope of cost-sharing, sharing the office expenses by month; 2.7 information management: responsible for documents, materials, information and publicity, communication links, and ensure promptly, ranking officers reporting; responsible for the collation and analysis of information, provide the basis for corporate decisions; corporate culture construction, planning, editing, internal publications; 2.8 vehicle management: responsible for the management, repairs and maintenance of vehicles; 2.9 legal disputes: the company responsible for the handling of disputes; 2.10 other: maintaining normal working order, and security. General Manager General Manager job description 1, 1.1 develop strategies and plans: according to company strategic planning, establish the annual management plan, reported to the Board of Directors for approval; 1.2 decomposition measures: according to the Board of Directors issued the annual management plan, annual index of decomposition, through the Organization of coordination mandate in charge of the Department Organization and implementation, ensuring comprehensive implementation of annual indicators; 1.3 inspection: convenes the General Manager Office, through31 第二篇 深入篇 第一章 UNIX启动和定时管理 1.1 UNIX启动过程 UNIX系统的启动过程如下: , 用户打开计算机电源。 , 计算机自动执行ROM引导程序。 , 将第一块硬盘的boot区调入内存并执行。硬盘的boot区存有硬盘的分区信息和驱 动程序。 , 将硬盘的活动分区上的bootstrap程序调入内存并执行。bootstrap程序位于该活动 分区上的第0号块中。 , 将UNIX的启动程序/boot调入内存并执行。 , 将UNIX的内核程序/unix调入内存并执行。 , 检测并配置内存和硬件设备。 , 启动/etc/init进程。init将/etc/inittab调入内存,并根据启动层次的不同,选择/etc/inittab 内不同的程序来执行。对于多用户来说,init会执行/sbin/bcheckrc和/sbin/brc进程, 最后由/sbin/rc2进程将系统带入多用户使用环境,并为每个终端启动/etc/getty一个 进程等待接收用户的登录。 1.2 UNIX用户的登录过程 UNIX用户的登录过程如下: , 用户打开终端电源(或运行telnet)。 , getty进程将登录提示信息送到用户终端显示,并等待用户输入用户名。 , 用户输入用户名。 , getty进程接收到用户名后,启动login进程。 , login进程要求用户输入口令。 , 用户输入口令。 , login进程对username和password进行检查。 , login启动shell进程。 , shell进程根据/etc/password中的shell类型,启动相应的shell。并启动/etc/profile文 件和$HOME/.profile文件(或$HOME/.login文件)。最后出现UNIX提示符,等待 用户输入命令。 以上过程简述如下(以B Shell为例): 打开终端 -> getty -> login -> sh -> /etc/profile -> $HOME/.profile -> 出现提示符$ supplies and get to use, the registration of company assets, record maintenance, maintenance of effective management; 2.6 cost management: preparation of the annual administrative budget, control administrative costs, determine the scope of cost-sharing, sharing the office expenses by month; 2.7 information management: responsible for documents, materials, information and publicity, communication links, and ensure promptly, ranking officers reporting; responsible for the collation and analysis of information, provide the basis for corporate decisions; corporate culture construction, planning, editing, internal publications; 2.8 vehicle management: responsible for the management, repairs and maintenance of vehicles; 2.9 legal disputes: the company responsible for the handling of disputes; 2.10 other: maintaining normal working order, and security. General Manager General Manager job description 1, 1.1 develop strategies and plans: according to company strategic planning, establish the annual management plan, reported to the Board of Directors for approval; 1.2 decomposition measures: according to the Board of Directors issued the annual management plan, annual index of decomposition, through the Organization of coordination mandate in charge of the Department Organization and implementation, ensuring comprehensive implementation of annual indicators; 1.3 inspection: convenes the General Manager Office, through init /etc/inittab /etc/rc getty getty /etc/gettydefs /etc/passwd login /tcb/files/auth/u/user_id /etc/wtmp和/etc/utmp shell /etc/profile $HOME/.profile 1.3 daemon进程 在UNIX系统中,有许多关键的功能都是由一些好象是自动运行的进程来实现的,这些 进程称为daemon进程,它们在后台自动运行并负责对系统的管理。 在系统启动时这些进程就应该启动,此后它们会按照自己的调度方式运行自己。可以用 手动方式启动daemon进程,也可以把它放在初始化文件中来进行。例如,名叫update的 daemon进程每30秒便自动地更新盘上的内容。该命令可用下列命令来启动: # /etc/update & 但是更好的办法是把这条命令放在系统的/etc/rc文件中,以便每次引导系统时都会执行它。 1.4 UNIX系统的定时器 UNIX允许在指定的时刻执行指定的程序,这一功能是靠cron进程来实现的。cron是一 个daemon进程,在UNIX的多用户模式下执行,它使某程序在一特定的时间被执行。cron 会按照crontabs文件所指定的时间执行命令,crontabs文件内容举例如下: #min hour day month day_of_week command #0-59 0-23 1-31 1-12 0-6(Sunday=0) #----------------------------------------------------------- 30 0 * * * /usr/abc/rj 0 7 * 1,3,6,8 1-5 /usr/abc/makfile crontabs文件由若干行组成,每行表示一个事件。每行由若干字段组成,字段间用空格分开。 每行中字段名依次为:分、时、日、月、星期、要执行的命令。每个字段取值举例: 各字段取值举例 说明 * 表示任何时间 supplies and get to use, the registration of company assets, record maintenance, maintenance of effective management; 2.6 cost management: preparation of the annual administrative budget, control administrative costs, determine the scope of cost-sharing, sharing the office expenses by month; 2.7 information management: responsible for documents, materials, information and publicity, communication links, and ensure promptly, ranking officers reporting; responsible for the collation and analysis of information, provide the basis for corporate decisions; corporate culture construction, planning, editing, internal publications; 2.8 vehicle management: responsible for the management, repairs and maintenance of vehicles; 2.9 legal disputes: the company responsible for the handling of disputes; 2.10 other: maintaining normal working order, and security. General Manager General Manager job description 1, 1.1 develop strategies and plans: according to company strategic planning, establish the annual management plan, reported to the Board of Directors for approval; 1.2 decomposition measures: according to the Board of Directors issued the annual management plan, annual index of decomposition, through the Organization of coordination mandate in charge of the Department Organization and implementation, ensuring comprehensive implementation of annual indicators; 1.3 inspection: convenes the General Manager Office, through33 1,3,4 表示离散数字 1-5 表示从1到5 上例crontabs文件中的: 30 0 * * * /usr/abc/rj 一行,表示在每天的午夜0:30启动/usr/abc/rj文件运行,而如下一行: 5 /usr/abc/makfile 0 7 * 1,3,6,8 1- 表示每当1、3、6和8月的周1到周五,启动/usr/abc/makfile文件运行。 crontabs文件是不能直接通过编辑命令修改的。要对crontabs文件进行操作可使用crontab命令。crontab命令的几种格式举例如下: crontab命令举例 说明 crontab 删除crontabs原内容,并通过键盘输入新内容 crontab myfile 将myfile的内容取代crontabs原内容 crontab -r 删除现有的crontabs文件 crontab -l 显示现有的crontabs文件内容 [例1] 在原crontabs内容的基础上增加如下事件:每月1日凌晨3时启动/usr/abc/stat文件运行。 做法如下: (1) 运行 crontab -l > tmp (2) 对tmp文件进行编辑,追加下面一行: 0 3 1 * * /usr/abc/stat (3) 运行 crontab tmp 第二章 UNIX用户管理 本章简单介绍的用户和用户组的管理,主要说明了增加和删除用户的过程。UNIX用户管理常见命令如下: useradd 增加用户 userdel 删除用户 usermod 修改用户 userls 显示用户和系统登录信息 passwd 修改用户口令 groupadd 增加用户组 groupdel 删除用户组 groupmod 修改用户组 groupls 显示用户组的属性 只有root用户和授权用户才能对用户和用户组进行增加、修改、删除操作。 supplies and get to use, the registration of company assets, record maintenance, maintenance of effective management; 2.6 cost management: preparation of the annual administrative budget, control administrative costs, determine the scope of cost-sharing, sharing the office expenses by month; 2.7 information management: responsible for documents, materials, information and publicity, communication links, and ensure promptly, ranking officers reporting; responsible for the collation and analysis of information, provide the basis for corporate decisions; corporate culture construction, planning, editing, internal publications; 2.8 vehicle management: responsible for the management, repairs and maintenance of vehicles; 2.9 legal disputes: the company responsible for the handling of disputes; 2.10 other: maintaining normal working order, and security. General Manager General Manager job description 1, 1.1 develop strategies and plans: according to company strategic planning, establish the annual management plan, reported to the Board of Directors for approval; 1.2 decomposition measures: according to the Board of Directors issued the annual management plan, annual index of decomposition, through the Organization of coordination mandate in charge of the Department Organization and implementation, ensuring comprehensive implementation of annual indicators; 1.3 inspection: convenes the General Manager Office, through 2.1用户管理 一、增加新用户 步骤1 创建用户 要在UNIX系统中增加新用户,可采用useradd命令,常用命令格式如下: /etc/useradd [-c comment] [-d directory]] [-g group] [-m] [-s shell] username 其中, -c comment 表示注释 -d directory 表示家目录 -g group 表示属于哪个用户组 -m 表示若家目录不存在,则自动创建 -s shell 表示该用户使用的shell username 用户名 例1:要创建一个名为devos的用户,其它默认,创建命令如下: useradd -m devos 若directory不出现,则自动创建缺省家目录,如/usr/ devos,缺省shell为B Shell。 例2:要创建一个名为ncp的用户,shell为ksh,其它默认,创建命令如下: useradd -m -s /bin/ksh ncp 例3:下面的命令: useradd -c "Test User" -m -d /test/test02 -g xyw -s /bin/ksh test02 表示要创建一个名为test02的用户,属于xyw用户组,家目录为/test/test02(自动创建)。“Test User”表示注释。 步骤2 设密码 对用户devos建立密码的命令为: passwd devos 二、删除用户 删除用户的命令常用格式为: /etc/userdel username 有的UNIX系统可能不允许彻底删除该用户,userdel只能回收该用户的使用权(retire).2.2用户组管理 一、增加新用户组 要在UNIX系统中增加新用户组xyw,命令如下: /etc/groupadd xyw 命令执行完后就增加了一个名为xyw的用户组。 supplies and get to use, the registration of company assets, record maintenance, maintenance of effective management; 2.6 cost management: preparation of the annual administrative budget, control administrative costs, determine the scope of cost-sharing, sharing the office expenses by month; 2.7 information management: responsible for documents, materials, information and publicity, communication links, and ensure promptly, ranking officers reporting; responsible for the collation and analysis of information, provide the basis for corporate decisions; corporate culture construction, planning, editing, internal publications; 2.8 vehicle management: responsible for the management, repairs and maintenance of vehicles; 2.9 legal disputes: the company responsible for the handling of disputes; 2.10 other: maintaining normal working order, and security. General Manager General Manager job description 1, 1.1 develop strategies and plans: according to company strategic planning, establish the annual management plan, reported to the Board of Directors for approval; 1.2 decomposition measures: according to the Board of Directors issued the annual management plan, annual index of decomposition, through the Organization of coordination mandate in charge of the Department Organization and implementation, ensuring comprehensive implementation of annual indicators; 1.3 inspection: convenes the General Manager Office, through35 二、删除用户组 要将在UNIX系统中用户组gp11删除,命令如下: /etc/groupdel gp11 命令执行完后就将gp11用户组删除了。 2.2 采用另外一种方法增加和删除用户 下面介绍另外一种方法增加和删除用户,只有在特殊情况下使用,一般不推荐使用这种方法。 一、增加用户 要在UNIX系统中增加新用户需要下列步骤: (1)在/etc/passwd文件中新增一行数据,表示给该用户的信息; (2)为该用户选择用户组,将该用户标识符加在/etc/group文件内适当位置; (3)为该用户创建一个家目录(home directory),将其家目录的属主改为该用户所有,组别也改为该用户的组别; (4)为该用户设置密码。 (一)/etc/passwd文件 /etc/passwd是一文本文件,用来存放用户信息,每行表示一个用户。/etc/passwd每行的格式如下: user_name:password:uid:gid:comment:home:shell 每行有很多项组成,项与项之间用":"隔开。每项的说明如下: user_name 用户名 password 登录密码,初始设置时为空 uid 用户识别号(User ID),是一数值,每个用户的识别号不同 gid 用户组识别号,参见/etc/group文件 comment 注释,可以任意字符,一般用来说明用户的身份特征 home 家目录名 shell 该用户缺省shell,一般取值为:/bin/sh、/bin/ksh、/bin/csh /etc/passwd的内容举例如下: cfl:x:201:50:Cao Feilong:/usr/cfl:/bin/sh abc:x:206:50:abc:/usr/abc:/bin/sh 要增加一新用户,用户名devos,需要在/etc/passwd文件末尾增加如下一行: devos::207:50:Dick Devos:/usr/devos:/bin/sh supplies and get to use, the registration of company assets, record maintenance, maintenance of effective management; 2.6 cost management: preparation of the annual administrative budget, control administrative costs, determine the scope of cost-sharing, sharing the office expenses by month; 2.7 information management: responsible for documents, materials, information and publicity, communication links, and ensure promptly, ranking officers reporting; responsible for the collation and analysis of information, provide the basis for corporate decisions; corporate culture construction, planning, editing, internal publications; 2.8 vehicle management: responsible for the management, repairs and maintenance of vehicles; 2.9 legal disputes: the company responsible for the handling of disputes; 2.10 other: maintaining normal working order, and security. General Manager General Manager job description 1, 1.1 develop strategies and plans: according to company strategic planning, establish the annual management plan, reported to the Board of Directors for approval; 1.2 decomposition measures: according to the Board of Directors issued the annual management plan, annual index of decomposition, through the Organization of coordination mandate in charge of the Department Organization and implementation, ensuring comprehensive implementation of annual indicators; 1.3 inspection: convenes the General Manager Office, through (二)/etc/group文件 /etc/group是一文本文件,用来存放用户组信息,每行表示一个组。/etc/group每行的格式如下: group_name:password:gid:members_list 每行有四项组成,项与项之间用":"隔开。 group_name 用户组名 password 用户组密码,一般为空 gid 用户组识别号(Group ID),是一数值,每个组的识别号不同 members_list 该组成员列表,由一个或多个用户名组成,用户名之间用逗号 隔开 /etc/group的内容举例如下: other::1:root,daemon group::50:ingres,sybase,cfl,abc 值得说明的是,一个用户可以是多个组的成员。 若要使devos用户属于group组,还需要在/etc/group文件中group组所在行末加上devos: group::50:ingres,sybase,cfl,abc,devos (三)创建家目录 # mkdir /usr/devos 在/usr目录下创建与用户名同名的目录devos # chown devos /usr/devos 设置/usr/devos的属主为devos # chgrp group /usr/devos 设置/usr/devos的用户组为group # chmod 755 /usr/devos 设置存取权限,一般为755 (四)设密码 对用户devos建立密码的命令为: # passwd devos 早期的UNIX版本,用户密码经加密后存放在/etc/passwd中的password字段。而在SVR3以后的版本则借用/etc/shadow存放用户密码。 二、删除用户 删除用户的步骤如下: (1)删除/etc/passwd内该用户的信息行 (2)删除/etc/group内有关该用户的项。 (3)将该用户的家目录删除 supplies and get to use, the registration of company assets, record maintenance, maintenance of effective management; 2.6 cost management: preparation of the annual administrative budget, control administrative costs, determine the scope of cost-sharing, sharing the office expenses by month; 2.7 information management: responsible for documents, materials, information and publicity, communication links, and ensure promptly, ranking officers reporting; responsible for the collation and analysis of information, provide the basis for corporate decisions; corporate culture construction, planning, editing, internal publications; 2.8 vehicle management: responsible for the management, repairs and maintenance of vehicles; 2.9 legal disputes: the company responsible for the handling of disputes; 2.10 other: maintaining normal working order, and security. General Manager General Manager job description 1, 1.1 develop strategies and plans: according to company strategic planning, establish the annual management plan, reported to the Board of Directors for approval; 1.2 decomposition measures: according to the Board of Directors issued the annual management plan, annual index of decomposition, through the Organization of coordination mandate in charge of the Department Organization and implementation, ensuring comprehensive implementation of annual indicators; 1.3 inspection: convenes the General Manager Office, through37 第三章 存储设备的使用 本章主要介绍UNIX中常用存储设备的使用。本章涉及的存储设备有:软盘、硬盘、CD-ROM。 3.1创建设备 设备必须创建后,才有可能工作。创建设备的UNIX命令为: /etc/mkdev 设备类型 [参数列表] 其中常见设备类型如下表所示 设备类型 说明 fd 软盘 hd 硬盘 cdrom CD-ROM tape 磁带机 serial 串口 parallel 并口 mouse 鼠标 lp 打印机 设备创建好后,系统会在/dev目录下生成设备文件。下表列出了SCO UNIX下的几个设备: 设备文件举例 说明 /dev/fd0 boot的软盘驱动器 /dev/fd0135ds18 135磁道、双密度软盘,每磁道18个扇区 /dev/cd0 第1个光盘驱动器 /dev/hd00 第1个物理硬盘 本章只涉及存储设备。 3.2 mount和umount命令 在使用某设备上的文件系统之前,必须将该设备上的文件系统挂接(mount)到根文件系统的某个目录上,此目录称为挂接点(mount point)。此时该设备上的文件系统相当于该目录的延伸,对该目录的操作就等于对该设备文件系统的操作。使用完该设备的文件系统后,还要将它卸出(umount)。 一、mount命令 mount的过程(步骤)如下: 第1步:创建一目录 supplies and get to use, the registration of company assets, record maintenance, maintenance of effective management; 2.6 cost management: preparation of the annual administrative budget, control administrative costs, determine the scope of cost-sharing, sharing the office expenses by month; 2.7 information management: responsible for documents, materials, information and publicity, communication links, and ensure promptly, ranking officers reporting; responsible for the collation and analysis of information, provide the basis for corporate decisions; corporate culture construction, planning, editing, internal publications; 2.8 vehicle management: responsible for the management, repairs and maintenance of vehicles; 2.9 legal disputes: the company responsible for the handling of disputes; 2.10 other: maintaining normal working order, and security. General Manager General Manager job description 1, 1.1 develop strategies and plans: according to company strategic planning, establish the annual management plan, reported to the Board of Directors for approval; 1.2 decomposition measures: according to the Board of Directors issued the annual management plan, annual index of decomposition, through the Organization of coordination mandate in charge of the Department Organization and implementation, ensuring comprehensive implementation of annual indicators; 1.3 inspection: convenes the General Manager Office, through 第2步:对目录权限进行修改 第3步:执行mount命令,将设备挂接到该目录上 块设备的mount命令格式如下: /etc/mount [-v] [-r] [-f ] fstypspecialdirectory /etc/mount 其中,不带参数的mount只是显示mount列表。带参数的mount真正执行挂接操作,参数说明如下: mount参数 说明 -r 只读 -v 在挂接的同时,显示挂接信息 -f 文件系统类型开关 ftype 文件系统类型 special 块设备文件 directory 挂接目录,在挂接前必须预先创建好 注意:必须将设备准备好后,再进行挂接,否则挂接会失败。例如,要挂接软盘,必须将相应软盘插入驱动器后,再进行挂接。 二、umount命令 umount命令将设备从文件系统中卸出。umount命令格式如下: umount 设备文件 或 umount 挂接目录 [例1] 卸出CD-ROM的命令如下: umount /dev/cd0 执行完umount命令后,再将CD-ROM从驱动器中取出。 3.3 软盘的使用 一、软盘设备的创建 UNIX在安装时,已经创建了fd设备。下面列出了SCO UNIX的磁盘驱动器设备文件名: 第一个软盘驱动器 说明 设备文件 (相当于DOS的A盘) /dev/fd0 boot的软盘驱动器 /dev/fd0135ds18 135磁道,双面,每磁道18个扇区(1.44M) supplies and get to use, the registration of company assets, record maintenance, maintenance of effective management; 2.6 cost management: preparation of the annual administrative budget, control administrative costs, determine the scope of cost-sharing, sharing the office expenses by month; 2.7 information management: responsible for documents, materials, information and publicity, communication links, and ensure promptly, ranking officers reporting; responsible for the collation and analysis of information, provide the basis for corporate decisions; corporate culture construction, planning, editing, internal publications; 2.8 vehicle management: responsible for the management, repairs and maintenance of vehicles; 2.9 legal disputes: the company responsible for the handling of disputes; 2.10 other: maintaining normal working order, and security. General Manager General Manager job description 1, 1.1 develop strategies and plans: according to company strategic planning, establish the annual management plan, reported to the Board of Directors for approval; 1.2 decomposition measures: according to the Board of Directors issued the annual management plan, annual index of decomposition, through the Organization of coordination mandate in charge of the Department Organization and implementation, ensuring comprehensive implementation of annual indicators; 1.3 inspection: convenes the General Manager Office, through39 /dev/fd0135ds9 135磁道,双面,每磁道9个扇区 /dev/fd048 48磁道的软盘驱动器 /dev/fd048ds8 48磁道,双面,每磁道8个扇区 /dev/fd048ds9 48磁道,双面,每磁道9个扇区 /dev/fd048ss8 48磁道,单面,每磁道8个扇区 /dev/fd048ss9 48磁道,单面,每磁道9个扇区 /dev/fd096 96磁道的软盘驱动器 /dev/fd096ds15 96磁道,双面,每磁道15个扇区 /dev/fd096ds18 96磁道,双面,每磁道18个扇区 /dev/fd096ds9 96磁道,双面,每磁道9个扇区 若将上面的/dev/fd0换成/dev/fd1,其余不变,则认为是第二个软盘驱动器(相当于DOS的B盘)。 二、软盘的格式化 软盘的格式化命令如下: format 软盘原始设备文件名 例如,要格式化135磁道、双面、每磁道18个扇区的软盘(即1.44M),format命令如下: format /dev/rfd0135ds18 三、安装文件系统 用下面命令安装文件系统: /etc/mkfs 软盘原始设备文件名 如,要在上面格式化过的软盘上安装文件系统,运行下面命令: /etc/mkfs /dev/fd0135ds18 四、软盘的挂接 软盘的挂接命令举例如下: # mkdir /diska 创建一目录 # chmod 777 /diska 改变该目录权限 # mount /dev/fd0135ds18 /diska 将/dev/fd0135ds18挂接到/diska目录 3.4 硬盘的使用 大多数服务器都采用SCSI总线硬盘,本节主要介绍SCSI硬盘。 supplies and get to use, the registration of company assets, record maintenance, maintenance of effective management; 2.6 cost management: preparation of the annual administrative budget, control administrative costs, determine the scope of cost-sharing, sharing the office expenses by month; 2.7 information management: responsible for documents, materials, information and publicity, communication links, and ensure promptly, ranking officers reporting; responsible for the collation and analysis of information, provide the basis for corporate decisions; corporate culture construction, planning, editing, internal publications; 2.8 vehicle management: responsible for the management, repairs and maintenance of vehicles; 2.9 legal disputes: the company responsible for the handling of disputes; 2.10 other: maintaining normal working order, and security. General Manager General Manager job description 1, 1.1 develop strategies and plans: according to company strategic planning, establish the annual management plan, reported to the Board of Directors for approval; 1.2 decomposition measures: according to the Board of Directors issued the annual management plan, annual index of decomposition, through the Organization of coordination mandate in charge of the Department Organization and implementation, ensuring comprehensive implementation of annual indicators; 1.3 inspection: convenes the General Manager Office, through 一、SCSI接口卡 SCSI接口卡(SCSI Host Adapter)插在计算机总线插槽内,硬盘、CD-ROM或其它设备通过SCSI总线与SCSI接口卡相连。在进行软硬件设置时常用到以下参数。 (一) SCSI主接口卡卡号:ha 一台计算机最多可插多块主接口卡,每块卡有一个编号,称为SCSI主接口卡卡号(ha --- Host Adaptor Number)。卡号的取值范围为:0 – 1 。 (二) SCSI主接口卡类型:hatype SCSI主接口卡由不同厂家制造,没有统一的软件驱动程序。在使用之前,应先选择相应的软件驱动程序。一般用驱动程序名字作为该卡的类型(hatype - Host Adapter Type)。常见的驱动程序如下: ad Adapter 154x、154x emlation、164x ciha 386/486 CBUS SCSI dpt DPT PM2012 eiad Adaptec 174x esc Olivetti ESC-1 fdha Future Domain TMC-1660、TMC-1680、MCS-700 (三)控制器地址:id 一个主接口卡由八个控制器组成,每个控制器有一个编号,称为id号(ID Number),取值为:0 – 7。 (四)逻辑单元号:lun 一个控制器可最多带8个设备,逻辑单元号(lun --- Logical Unit Number)就是设备地址,取值为0 - 7。但对于大多数硬盘或光盘来说,只有一个lun,即0。 二、SCSI硬盘设备的创建 UNIX在安装时,至少已经创建了第一张硬盘设备。下面列出了SCO UNIX的硬盘驱动器设备文件名: 第一个硬盘驱动器 说明 设备文件 (相当于DOS的C盘) /dev/hd00 驱动器0的整个硬盘 /dev/hd01 驱动器0的第1个磁盘分区 若将上面的/dev/hd0换成/dev/hd1,其余不变,则认为是第二个硬盘驱动器。 在使用之前可先查看该文件是否存在,若不存在,可以创建硬盘设备。SCSI硬盘硬盘设备的创建命令如下: /etc/mkdev hd id ha lun hatype supplies and get to use, the registration of company assets, record maintenance, maintenance of effective management; 2.6 cost management: preparation of the annual administrative budget, control administrative costs, determine the scope of cost-sharing, sharing the office expenses by month; 2.7 information management: responsible for documents, materials, information and publicity, communication links, and ensure promptly, ranking officers reporting; responsible for the collation and analysis of information, provide the basis for corporate decisions; corporate culture construction, planning, editing, internal publications; 2.8 vehicle management: responsible for the management, repairs and maintenance of vehicles; 2.9 legal disputes: the company responsible for the handling of disputes; 2.10 other: maintaining normal working order, and security. General Manager General Manager job description 1, 1.1 develop strategies and plans: according to company strategic planning, establish the annual management plan, reported to the Board of Directors for approval; 1.2 decomposition measures: according to the Board of Directors issued the annual management plan, annual index of decomposition, through the Organization of coordination mandate in charge of the Department Organization and implementation, ensuring comprehensive implementation of annual indicators; 1.3 inspection: convenes the General Manager Office, through41 其中,id是主接口卡控制器地址;ha是主接口卡卡号;lun是逻辑单元号;hatype是主接口卡类型(参见本节第一部分SCSI接口卡)。 例如,在Compaq服务器的第一块SCSI适配器上增加第二块硬盘,并设硬盘的ID号为2,SCO UNIX的运行如下命令: # mkdev hd 2 0 0 cha # reboot # mkdev hd 2 0 0 cha 创建硬盘也可以直接运行: mkdev hd 会出现菜单,以后按菜单操作即可。 三、硬盘的分区 硬盘设备创建好后,还应对硬盘进行分区。SCO UNIX的分区命令格式是: divvy [硬盘设备名] 如: divvy /dev/hd10 是对/dev/hd10硬盘进行分区。 在分区时还要选择分区名以及要安装的操作系统类型,分区结束后自动安装操作系统。 四、硬盘的挂接 硬盘的挂接命令举例如下: # mkdir /hd1_dir 创建一目录 # chmod 777 /hd1_dir 改变该目录权限 # mount /dev/linda /hd1_dir 将/dev/linda挂接到/hd1_dir目录 其中/dev/linda是分区设备名。 3.5 CD-ROM的使用 一、CD-ROM设备的创建 绝大多数UNIX在安装时,已经创建了CD-ROM设备。CD-ROM的设备文件名为: /dev/cd0 第1个CD-ROM驱动器 /dev/cd1 第2个CD-ROM驱动器 在使用之前可先查看该文件是否存在,若都不存在,再创建CD-ROM设备。CD-ROM设备的创建命令如下: mkdev cdrom supplies and get to use, the registration of company assets, record maintenance, maintenance of effective management; 2.6 cost management: preparation of the annual administrative budget, control administrative costs, determine the scope of cost-sharing, sharing the office expenses by month; 2.7 information management: responsible for documents, materials, information and publicity, communication links, and ensure promptly, ranking officers reporting; responsible for the collation and analysis of information, provide the basis for corporate decisions; corporate culture construction, planning, editing, internal publications; 2.8 vehicle management: responsible for the management, repairs and maintenance of vehicles; 2.9 legal disputes: the company responsible for the handling of disputes; 2.10 other: maintaining normal working order, and security. General Manager General Manager job description 1, 1.1 develop strategies and plans: according to company strategic planning, establish the annual management plan, reported to the Board of Directors for approval; 1.2 decomposition measures: according to the Board of Directors issued the annual management plan, annual index of decomposition, through the Organization of coordination mandate in charge of the Department Organization and implementation, ensuring comprehensive implementation of annual indicators; 1.3 inspection: convenes the General Manager Office, through 会出现菜单,以后按菜单操作即可。 二、CD-ROM的挂接 CD-ROM的挂接命令如下: # mkdir /cdrom 创建一目录 # chmod 555 /cdrom 改变该目录权限 # mount -r /dev/cd0 /cdrom 将/dev/cd0挂接到/cdrom目录, "-r"表示只读 第四章 网络、主机和路由参数设置 本节介绍了UNIX上的网络、主机和路由参数设置。在进行网络(主机)地址设置时一般用到/etc目录下三个文本文件:networks、hosts、gateways,分别存放网络、主机、路由列表。 4.1 /etc/networks文件 /etc/networks文件存放网络列表,一般把所用到的网络号都放到此表。此文件每行表示一个网络,由以下三个域构成: name number aliases 这里, name 表示网络的正式名称 number 表示网络号,把IP地址中的主机地址去掉就是网络号 aliases 表示网络别名,若有多个别名,用空格分开 # 表示注释 /etc/networks内容举例: loopback 127 huawei 129.9 #Huawei Tech. Co. Ltd. training 129.6 peixun qqsj #Training Center 其中,第一行,loopback是网络名,它的网络号是127(A类地址);第二行,huawei是网络名,它的网络号是“129.9”(B类地址), “#Huawei Tech. Co. Ltd.”是注释;第三行,training是网络名,它的网络号是“129.6”,它的别名有两个:peixun和qqsj,“#Training Center”是注释。 4.2 /etc/hosts文件 /etc/hosts文件存放主机列表,一般把所用到的主机号都放到此表,该主机可以不在同一个网络上。此表每行表示一个主机,由以下三个域构成: address name aliases 这里, address 表示主机IP地址 name 表示主机的正式名称 supplies and get to use, the registration of company assets, record maintenance, maintenance of effective management; 2.6 cost management: preparation of the annual administrative budget, control administrative costs, determine the scope of cost-sharing, sharing the office expenses by month; 2.7 information management: responsible for documents, materials, information and publicity, communication links, and ensure promptly, ranking officers reporting; responsible for the collation and analysis of information, provide the basis for corporate decisions; corporate culture construction, planning, editing, internal publications; 2.8 vehicle management: responsible for the management, repairs and maintenance of vehicles; 2.9 legal disputes: the company responsible for the handling of disputes; 2.10 other: maintaining normal working order, and security. General Manager General Manager job description 1, 1.1 develop strategies and plans: according to company strategic planning, establish the annual management plan, reported to the Board of Directors for approval; 1.2 decomposition measures: according to the Board of Directors issued the annual management plan, annual index of decomposition, through the Organization of coordination mandate in charge of the Department Organization and implementation, ensuring comprehensive implementation of annual indicators; 1.3 inspection: convenes the General Manager Office, through43 aliases 表示主机别名,若有多个别名,用空格分开 # 表示注释 建议将hostname和node name(参见UNIX的hostname和uname命令)作为主机名或别名。 /etc/hosts内容举例: 127.0.0.1 localhost 129.6.114.201 xyw01.huawei.com.cn xyw01 intess114 129.6.114.202 xyw02.huawei.com.cn xyw02 intess112 129.6.0.1 px_hw_r #Router to huawei 129.7.10.21 lihong #Li Hong 129.9.6.218 www.huawei.com.cn 其中,第一列,“127.0.0.1”、“129.6.114.201”等是IP地址; 第二列,“localhost”、“xyw01.huawei.com.cn”、“xyw02.huawei.com.cn”等是主机名称; 其它,“xyw01”、“intess114”、“xyw02”、“intess114”是别名, “#Router”是注释。 4.3 /etc/gateways文件 /etc/gateways文件存放网关列表,每行表示一个网关参数,由以下域构成: name1 gateway name2 metric value 这里, net,host 表示路由指向网络还是指向某一特定主机,net和host为关键字 name1 目的网络名或主机名(或IP地址) gateway 关键字 name2 网关名或网关IP地址 metric 关键字 value 表示表示到目的网络或主机的hop计数值 passive 关键字,表示被动方式,路由器不交换路由信息 active 关键字,表示主动方式,路由器交换路由信息 external 关键字,表示外部方式,其它进程已安装了路由 # 表示注释 表示只能选net和host两个关键字中的其中一个, 表示只能选其中一个关键字。 /etc/gateways内容举例: net huawei gateway px_hw_r metric 1 passive host lihong gateway px_xx_r metric 1 passive 其中,huawei是目的网络名(在/etc/networks中定义),px_hw_r是路由器名,lihong是目的主机名(在/etc/hosts中定义),px_xx_r是路由器名。当然,以上所有名称均可用网络号或IP地址代替: net 129.9 gateway 129.6.0.1 metric 1 passive host 129.7.10.21 gateway 129.6.0.2 metric 1 passive supplies and get to use, the registration of company assets, record maintenance, maintenance of effective management; 2.6 cost management: preparation of the annual administrative budget, control administrative costs, determine the scope of cost-sharing, sharing the office expenses by month; 2.7 information management: responsible for documents, materials, information and publicity, communication links, and ensure promptly, ranking officers reporting; responsible for the collation and analysis of information, provide the basis for corporate decisions; corporate culture construction, planning, editing, internal publications; 2.8 vehicle management: responsible for the management, repairs and maintenance of vehicles; 2.9 legal disputes: the company responsible for the handling of disputes; 2.10 other: maintaining normal working order, and security. General Manager General Manager job description 1, 1.1 develop strategies and plans: according to company strategic planning, establish the annual management plan, reported to the Board of Directors for approval; 1.2 decomposition measures: according to the Board of Directors issued the annual management plan, annual index of decomposition, through the Organization of coordination mandate in charge of the Department Organization and implementation, ensuring comprehensive implementation of annual indicators; 1.3 inspection: convenes the General Manager Office, through 4.4 设置步骤 (1) 以root用户登录UNIX (2) 查看/etc目录下hosts、networks和gateways文件是否存在,若不存在创建之 (3) 修改三文件内容,确保参数正确,注意三文件参数之间的关系 (4) 对内核进行重新连接(对于SCO UNIX可运行sysadmsh选system->kernal->relink) (5) 运行reboot重新启动UNIX 4.5 测试 假设本服务器的IP地址为129.6.114.201, /etc目录下的hosts、networks和gateways文件的内容为以上1、2和3中的实例参数。这里用UNIX的ping命令进行测试。 (一) 同一网络内测试 ping 129.6.114.201 自身测试,查看IP协议是否已经驱动 ping intess114 自身测试,查看hosts设置是否正确 ping xyw02 本网络是否通 ping px_hw_r 路由器是否连上 (二)网间测试 ping 129.9.6.218 测试/etc/networks和/etc/gateways,以及路由器 ping www.huawei.com.cn 测试三文件 深入篇小结 第一章介绍了UNIX的启动和登录过程、daemon进程。重点介绍了UNIX的定时执行文件的功能。 第二章介绍了增加用户和删除用户的过程。推荐使用命令方式,一般不要使用直接对文件进行修改的方式。 第三章主要介绍了软盘、硬盘和CD-ROM的使用前的配置和使用过程。 第四章介绍了的网络和路由参数设置:介绍了/etc/目录下的networks、hosts、gateways三文件的格式和设置。 深入篇习题 1、让UNIX在每天的凌晨1点,执行/usr/abc/stat程序。 2、/etc/passwd文件内容每行由哪几部分组成,/etc/group文件内容每行由哪几部分组成, 3、请写出挂接(mount)软盘的过程。 4、/etc目录下的networks、hosts、gateways三文件内容的存放格式分别是什么, supplies and get to use, the registration of company assets, record maintenance, maintenance of effective management; 2.6 cost management: preparation of the annual administrative budget, control administrative costs, determine the scope of cost-sharing, sharing the office expenses by month; 2.7 information management: responsible for documents, materials, information and publicity, communication links, and ensure promptly, ranking officers reporting; responsible for the collation and analysis of information, provide the basis for corporate decisions; corporate culture construction, planning, editing, internal publications; 2.8 vehicle management: responsible for the management, repairs and maintenance of vehicles; 2.9 legal disputes: the company responsible for the handling of disputes; 2.10 other: maintaining normal working order, and security. General Manager General Manager job description 1, 1.1 develop strategies and plans: according to company strategic planning, establish the annual management plan, reported to the Board of Directors for approval; 1.2 decomposition measures: according to the Board of Directors issued the annual management plan, annual index of decomposition, through the Organization of coordination mandate in charge of the Department Organization and implementation, ensuring comprehensive implementation of annual indicators; 1.3 inspection: convenes the General Manager Office, through45 第三篇 UNIX上机指导 第一部分 上机环境 1.1 UNIX主机环境 UNIX主机信息 1、操作系统:SCO UNIX 2、IP地址129.6.114.201 3、用户名:xyw UNIX文件 假设已经存在下列目录及文件: /usr/xyw xyw用户的家目录 /usr/xyw/.profile 批处理文件 /usr/xyw/pwdhlp 文本文件 /usr/xyw/doc/readme.doc 文本文件 /usr/xyw/doc/who.txt 文本文件 /usr/xyw/bin/calendar 二进制文件 /usr/xyw/bin/dispmesg 文本文件 /usr/xyw/bin/calling 二进制文件 /usr/xyw/tmp 目录 1.2 工作站环境 工作站硬件配置 1、计算机:Pentium PC机 2、网卡 工作站软件配置 1、操作系统为DOS 6.22 2、中文Windows 3.2 3、NetWare上网软件(for DOS) 4、TCP/IP协议驱动软件(for DOS and Windows 3.x) 5、NetTerm软件(for Windows) 6、FTP软件(for DOS) 并假设已经存在下列目录 f:\apps\netterm.ins NetTerm安装盘(目录) f:\apps\ftp ftp软件(目录) c:\dos\help.hlp 二进制文件 supplies and get to use, the registration of company assets, record maintenance, maintenance of effective management; 2.6 cost management: preparation of the annual administrative budget, control administrative costs, determine the scope of cost-sharing, sharing the office expenses by month; 2.7 information management: responsible for documents, materials, information and publicity, communication links, and ensure promptly, ranking officers reporting; responsible for the collation and analysis of information, provide the basis for corporate decisions; corporate culture construction, planning, editing, internal publications; 2.8 vehicle management: responsible for the management, repairs and maintenance of vehicles; 2.9 legal disputes: the company responsible for the handling of disputes; 2.10 other: maintaining normal working order, and security. General Manager General Manager job description 1, 1.1 develop strategies and plans: according to company strategic planning, establish the annual management plan, reported to the Board of Directors for approval; 1.2 decomposition measures: according to the Board of Directors issued the annual management plan, annual index of decomposition, through the Organization of coordination mandate in charge of the Department Organization and implementation, ensuring comprehensive implementation of annual indicators; 1.3 inspection: convenes the General Manager Office, through c:\temp\to\auto.bat 文本文件 c:\temp\to\print.exe 二进制文件 c:\temp\from 目录 第二部分 在工作站上登录UNIX 2.1 NetTerm的安装 NetTerm软件是telnet的变种,除了具有telnet的基本功能外,还可以远程拨号连接。NetTerm是在Windows环境下运行的软件,假设已经安装好第一部分所述工作站软件配置的第1、2、3、4项,本节介绍第5项NetTerm软件的安装。现在介绍从网络上安装NetTerm的步骤,在安装前假设安装程序放在f:\apps\netterm.ins目录中。 安装步骤 1、在Windows 3.2下运行f:\apps\netterm.ins\nt16323.exe,具体操作步骤如下: f: cd \apps\netterm.ins win nt16323.exe [注]要在Windows 95下安装NetTerm,请运行nt32425.exe或nt32400.exe。 2、当出现“WinZip Self-Extractor”运行框时,用鼠标点击“Setup”按扭。 3、当出现“NetTerm Installation”运行框时,用鼠标点击“Continue”按扭。 4、当出现一运行框,提示输入安装路经“C:\netterm”时,用鼠标点击 “Continue”按扭。以后开始安装。 5、若以前曾安装过netterm,会出现是否覆盖以前内容的提问信息,这时要 点击“Yes”按扭。 6、当出现“NetTerm 3.2.3 Setup is complete!”时用鼠标点击“确定”按扭。 2.2 NetTerm的使用 设置 1、在Windows下双击NetTerm组下的NetTerm图标,会出现NetTerm画面。 2、选择“File -> Phone Directory”。 3、在Phone Directory下,输入参数: Connection: TCPIP Keys: Default Emulation: VT100 Telnet Port: 23 Host Name: 任意输入一名字,作为标识,假设是xyw01 Host/IP: UNIX服务器的IP地址,如129.6.114.201 用鼠标点击“Add”按扭,将以上设置保存到Phone Directory的列表中。 4、在以上画面下,用鼠标点击“Connect”按扭,就会出现信息,要求输入UNIX 用户名,这表示与UNIX已经连通。 supplies and get to use, the registration of company assets, record maintenance, maintenance of effective management; 2.6 cost management: preparation of the annual administrative budget, control administrative costs, determine the scope of cost-sharing, sharing the office expenses by month; 2.7 information management: responsible for documents, materials, information and publicity, communication links, and ensure promptly, ranking officers reporting; responsible for the collation and analysis of information, provide the basis for corporate decisions; corporate culture construction, planning, editing, internal publications; 2.8 vehicle management: responsible for the management, repairs and maintenance of vehicles; 2.9 legal disputes: the company responsible for the handling of disputes; 2.10 other: maintaining normal working order, and security. General Manager General Manager job description 1, 1.1 develop strategies and plans: according to company strategic planning, establish the annual management plan, reported to the Board of Directors for approval; 1.2 decomposition measures: according to the Board of Directors issued the annual management plan, annual index of decomposition, through the Organization of coordination mandate in charge of the Department Organization and implementation, ensuring comprehensive implementation of annual indicators; 1.3 inspection: convenes the General Manager Office, through47 登录UNIX 1、在Windows下双击NetTerm组下的NetTerm图标,会出现NetTerm画面。 2、选择“File -> Phone Directory”。 3、在Phone Directory的列表中,选择xyw01项,用鼠标点击“Conenct”按扭, 就会出现信息,要求输入UNIX用户名,对于SCO UNIX来说,信息如下: SCO OpenServer (TM) Release 5 login: 这表示本台计算机已经在当作UNIX主机的仿真终端使用了。在login下, 输入UNIX的用户名,再输入口令。对于SCO UNIX,接着会出现下列信息: TERM = (ansi) 要求输入终端类型(括号中的内容为缺省),在此输入vt100并回车,就会 出现UNIX的提示符: $ 以后按照UNIX的要求操作即可。 断开与UNIX连接、退出NetTerm 1、点击断开连接按扭(或选择“File -> Disconnect”)。 2、选择“File -> Exit”,以后点击“确定”。 3、退出Windows。 第三部分 UNIX常用命令的使用 3.1 常用命令之一 查看用户及登录情况 找出此系统中已经登录的用户: who 查看自己的注册名、使用终端和登录日期: who am i 用finger命令查看已经登录的用户信息: finger 用finger命令查看root用户信息: finger root 用finger命令查看129.6.114.201主机上root用户信息: finger root@129.6.114.201 简单命令 查看finger命令的帮助信息: man finger (按键:换页、退出) 查看日期和时间: date 显示1999年日历: cal 1999 将“HUAWEI"用大字显示: supplies and get to use, the registration of company assets, record maintenance, maintenance of effective management; 2.6 cost management: preparation of the annual administrative budget, control administrative costs, determine the scope of cost-sharing, sharing the office expenses by month; 2.7 information management: responsible for documents, materials, information and publicity, communication links, and ensure promptly, ranking officers reporting; responsible for the collation and analysis of information, provide the basis for corporate decisions; corporate culture construction, planning, editing, internal publications; 2.8 vehicle management: responsible for the management, repairs and maintenance of vehicles; 2.9 legal disputes: the company responsible for the handling of disputes; 2.10 other: maintaining normal working order, and security. General Manager General Manager job description 1, 1.1 develop strategies and plans: according to company strategic planning, establish the annual management plan, reported to the Board of Directors for approval; 1.2 decomposition measures: according to the Board of Directors issued the annual management plan, annual index of decomposition, through the Organization of coordination mandate in charge of the Department Organization and implementation, ensuring comprehensive implementation of annual indicators; 1.3 inspection: convenes the General Manager Office, through banner "HUAWEI" 计算1234/6=,: bc 1234/6 (按组合键退出bc) 清除屏幕: clear pwd和cd操作 查看当前工作目录: pwd 进入根目录: cd / pwd 进入/usr/bin目录 cd /usr/bin pwd 进入家目录下的doc目录 cd $HOME/doc pwd 进入家目录 cd pwd 显示目录 显示家目录内容: cd ls ls -l ls -a ls -al ls * ls -d * ls -dl * 显示根目录 cd / ls ls | more (按键:换行、空格翻页、退出) ls -l | more ls d* | more ls -d d* 将显示内容保存到家目录的文件rootls中: ls -l > /usr/xyw/rootls cd ls rootls 显示文件内容 用cat命令显示/usr/xyw/pwdhlp文件内容: supplies and get to use, the registration of company assets, record maintenance, maintenance of effective management; 2.6 cost management: preparation of the annual administrative budget, control administrative costs, determine the scope of cost-sharing, sharing the office expenses by month; 2.7 information management: responsible for documents, materials, information and publicity, communication links, and ensure promptly, ranking officers reporting; responsible for the collation and analysis of information, provide the basis for corporate decisions; corporate culture construction, planning, editing, internal publications; 2.8 vehicle management: responsible for the management, repairs and maintenance of vehicles; 2.9 legal disputes: the company responsible for the handling of disputes; 2.10 other: maintaining normal working order, and security. General Manager General Manager job description 1, 1.1 develop strategies and plans: according to company strategic planning, establish the annual management plan, reported to the Board of Directors for approval; 1.2 decomposition measures: according to the Board of Directors issued the annual management plan, annual index of decomposition, through the Organization of coordination mandate in charge of the Department Organization and implementation, ensuring comprehensive implementation of annual indicators; 1.3 inspection: convenes the General Manager Office, through49 cd cat pwdhlp 用more命令显示以上内容: more pwdhlp (按键:换行、空格翻页、退出) 另外一种显示方法: cat pwdhlp | more 创建目录 在家目录下创建子目录animal、plus1和plus2: cd mkdir animal mkdir plus1 mkdir plus2 显示并记录其权限: ls -l vi的使用 用vi编辑器建立文件/usr/xyw/animal/tiger: cd animal vi tiger (文件内容如下:) It was a hot, blustery day. Most folks stayed indoos. Not me. A tiger came ambling down the street. 显示tiger文件名,记录其权限: ls -l tiger 显示tiger文件内容,确认内容是否正确: cat tiger 拷贝文件 将tiger文件拷贝到它的父目录中, 并查看内容: cp tiger .. cd .. ls cat tiger 将/etc/passwd文件拷贝成当前目录下的passwd.bak文件, 并查看passwd.bak内容: cp /etc/passwd passwd.bak more passwd.bak 移动文件 将passwd.bak移动到plus1目录,并查看是否移动: ls passwd.bak mv passwd.bak plus1 ls passwd.bak cd plus1 ls passwd.bak 删除操作 删除passwd.bak文件: rm passwd.bak supplies and get to use, the registration of company assets, record maintenance, maintenance of effective management; 2.6 cost management: preparation of the annual administrative budget, control administrative costs, determine the scope of cost-sharing, sharing the office expenses by month; 2.7 information management: responsible for documents, materials, information and publicity, communication links, and ensure promptly, ranking officers reporting; responsible for the collation and analysis of information, provide the basis for corporate decisions; corporate culture construction, planning, editing, internal publications; 2.8 vehicle management: responsible for the management, repairs and maintenance of vehicles; 2.9 legal disputes: the company responsible for the handling of disputes; 2.10 other: maintaining normal working order, and security. General Manager General Manager job description 1, 1.1 develop strategies and plans: according to company strategic planning, establish the annual management plan, reported to the Board of Directors for approval; 1.2 decomposition measures: according to the Board of Directors issued the annual management plan, annual index of decomposition, through the Organization of coordination mandate in charge of the Department Organization and implementation, ensuring comprehensive implementation of annual indicators; 1.3 inspection: convenes the General Manager Office, through 删除子目录plus2: cd rmdir plus2 删除子目录plus1及其内容: rm -r plus1 查看是否删除plus1和plus2 ls -l 文件的存取权限 查看文件tiger的存取权限: ls -l tiger 更改tiger的存取权限为777: chmod 777 tiger 更改tiger的属主为root: chown root tiger 更改tiger的属组为group:(选做) chgrp group tiger find命令的使用 在家目录极其子目录中查找tig开头的文件名: cd find . -name "tig*" -print grep命令的使用 在文件/usr/xyw/pwdhlp中查找“/etc/passwd”: cd cat pwdhlp | grep "/etc/passwd" 或 grep "/etc/passwd" < pwdhlp cpio命令的使用 将animal目录下的内容备份到/usr/xyw/anmlbak一个文件中: cd find animal -print | cpio -ocdv > anmlbak 将以上备份内容恢复到/usr/xyw/tmp目录中: cd tmp cpio -icdv < ../anmlbak compress命令的使用 将文件/usr/xyw/bin/calling文件压缩: cd /usr/xyw/bin compress calling 查看: ls calling* 将以上压缩文件解压缩: uncompress calling.Z 综合思考练习题 练习题1: (1)在/usr/xyw目录下编辑一个程序,要求运行时显示: supplies and get to use, the registration of company assets, record maintenance, maintenance of effective management; 2.6 cost management: preparation of the annual administrative budget, control administrative costs, determine the scope of cost-sharing, sharing the office expenses by month; 2.7 information management: responsible for documents, materials, information and publicity, communication links, and ensure promptly, ranking officers reporting; responsible for the collation and analysis of information, provide the basis for corporate decisions; corporate culture construction, planning, editing, internal publications; 2.8 vehicle management: responsible for the management, repairs and maintenance of vehicles; 2.9 legal disputes: the company responsible for the handling of disputes; 2.10 other: maintaining normal working order, and security. General Manager General Manager job description 1, 1.1 develop strategies and plans: according to company strategic planning, establish the annual management plan, reported to the Board of Directors for approval; 1.2 decomposition measures: according to the Board of Directors issued the annual management plan, annual index of decomposition, through the Organization of coordination mandate in charge of the Department Organization and implementation, ensuring comprehensive implementation of annual indicators; 1.3 inspection: convenes the General Manager Office, through51 Welcome to use UNIX 当前时间 提示:用vi编辑文件、修改文件存取权限 (2) 运行该程序 提示:运行文件时,给出文件路径,如./运行文件名 (3) 当以xyw登录UNIX后,自动执行以上程序 提示:修改/usr/xyw/.profile文件 练习题2:怎样才能在当前目录下直接执行程序,而不需指定路径。 提示:修改.profile中的PATH环境变量中追加"."。 3.2 常用命令之二(选做) 收发邮件 发邮件(假设收方用户名是xyw) mail xyw (输入主题和内容,按键退出) 查看邮件 mail (输入序号或回车显示邮件内容,按q键退出) 登录双方传递消息: 假设双方的登录名都是xyw,使用终端分别是ttyp0和ttyp1。 在双方登录者的机器上都运行: mesg y (允许接收对方消息) 发送消息给另一登录者: (发送方:) write xyw ttyp0 (接着输入消息,按键结束) (接收方:屏幕自动显示对方用write送来信息) 双方交互式传送信息: (主叫方:) talk xyw ttyp0 (被叫方:) talk xyw (任意一方按键结束对话) 3.3 常用命令之三 以下有些命令必须具有相应权限才能操作。 修改口令 修改自己的口令: passwd 修改xyw用户口令: passwd xyw supplies and get to use, the registration of company assets, record maintenance, maintenance of effective management; 2.6 cost management: preparation of the annual administrative budget, control administrative costs, determine the scope of cost-sharing, sharing the office expenses by month; 2.7 information management: responsible for documents, materials, information and publicity, communication links, and ensure promptly, ranking officers reporting; responsible for the collation and analysis of information, provide the basis for corporate decisions; corporate culture construction, planning, editing, internal publications; 2.8 vehicle management: responsible for the management, repairs and maintenance of vehicles; 2.9 legal disputes: the company responsible for the handling of disputes; 2.10 other: maintaining normal working order, and security. General Manager General Manager job description 1, 1.1 develop strategies and plans: according to company strategic planning, establish the annual management plan, reported to the Board of Directors for approval; 1.2 decomposition measures: according to the Board of Directors issued the annual management plan, annual index of decomposition, through the Organization of coordination mandate in charge of the Department Organization and implementation, ensuring comprehensive implementation of annual indicators; 1.3 inspection: convenes the General Manager Office, through 修改时间: (假设当前时间是1998年8月12日16时26分) date -t 199808121626 查看磁盘使用情况: 查看磁盘自由空间: df -v 查看磁盘使用情况: du /usr/xyw 进程管理 显示进程信息: ps ps -u xyw ps -e ps -f ps -ef | more 杀掉有关xyw用户的进程: ps -ef | grep xyw kill 1200 (假设进程号是1200) 用户管理(选做) 增加用户组cmm: groupadd cmm 增加新用户linda: useradd -m linda passwd linda cdrom的使用(选做) 挂接cdrom: mkdir /cdrom chmod 555 /cdrom mount -r /dev/cd0 /cdrom 查看cdron内容: cd /cdrom ls 解挂cdrom: cd / umount /dev/cd0 第四部分 ftp的使用 4.1 ftp的安装 现在介绍的ftp是在DOS下运行的,假设已经安装好了第一部分所述工作站软件配置的 第1、3、4项,本节介绍第6项ftp的安装。现在介绍从网络上安装ftp的步骤,在安装前假 supplies and get to use, the registration of company assets, record maintenance, maintenance of effective management; 2.6 cost management: preparation of the annual administrative budget, control administrative costs, determine the scope of cost-sharing, sharing the office expenses by month; 2.7 information management: responsible for documents, materials, information and publicity, communication links, and ensure promptly, ranking officers reporting; responsible for the collation and analysis of information, provide the basis for corporate decisions; corporate culture construction, planning, editing, internal publications; 2.8 vehicle management: responsible for the management, repairs and maintenance of vehicles; 2.9 legal disputes: the company responsible for the handling of disputes; 2.10 other: maintaining normal working order, and security. General Manager General Manager job description 1, 1.1 develop strategies and plans: according to company strategic planning, establish the annual management plan, reported to the Board of Directors for approval; 1.2 decomposition measures: according to the Board of Directors issued the annual management plan, annual index of decomposition, through the Organization of coordination mandate in charge of the Department Organization and implementation, ensuring comprehensive implementation of annual indicators; 1.3 inspection: convenes the General Manager Office, through53 设安装程序放在f:\apps\ftp目录中。 安装步骤: xcopy f:\apps\ftp\*.* c:\ftp\*.*/s 4.2 使用ftp拷贝文件 一、ftp的运行 c: cd \ftp ftp 129.6.114.201 (假设129.6.114.201是服务器ip地址) (输入UNIX用户名xyw和口令,会出现提示符:) ftp> 二、将本地计算机C:\DOS目录下的help.hlp拷贝到远程主机的/usr/xyw/tmp目录下。 命令如下: ftp> binary ftp> lcd c:\dos ftp> cd /usr/xyw/tmp ftp> put help.hlp 三、将本地计算机C:\TEMP\TO目录下的所有文件拷贝到远程主机的/usr/xyw/tmp目录下。 命令如下: ftp> binary temp\to ftp> lcd c:\ ftp> cd /usr/xyw/tmp ftp> mput *.* 四、将远程主机的/usr/xyw/bin/dispdate文本文件拷贝到本地计算机C:\TEMP\FROM目录下。 命令如下: ftp> ascii ftp> lcd c:\temp\from ftp> cd /usr/xyw/bin ftp> get dispmesg 五、将远程主机的/usr/xyw/doc目录下的所有文件按文本文件格式拷贝到本地计算机C:\TEMP\FROM目录下。命令如下: ftp> ascii ftp> lcd c:\temp\from ftp> cd /usr/xyw/doc ftp> mget * 六、ftp的退出 ftp> close supplies and get to use, the registration of company assets, record maintenance, maintenance of effective management; 2.6 cost management: preparation of the annual administrative budget, control administrative costs, determine the scope of cost-sharing, sharing the office expenses by month; 2.7 information management: responsible for documents, materials, information and publicity, communication links, and ensure promptly, ranking officers reporting; responsible for the collation and analysis of information, provide the basis for corporate decisions; corporate culture construction, planning, editing, internal publications; 2.8 vehicle management: responsible for the management, repairs and maintenance of vehicles; 2.9 legal disputes: the company responsible for the handling of disputes; 2.10 other: maintaining normal working order, and security. General Manager General Manager job description 1, 1.1 develop strategies and plans: according to company strategic planning, establish the annual management plan, reported to the Board of Directors for approval; 1.2 decomposition measures: according to the Board of Directors issued the annual management plan, annual index of decomposition, through the Organization of coordination mandate in charge of the Department Organization and implementation, ensuring comprehensive implementation of annual indicators; 1.3 inspection: convenes the General Manager Office, through ftp> quit 附录 附录A UNIX命令速查表 命令 简单解释(在本书中页码) banner 显示大写大字(p7) bc 计算器(p7) cal 显示日历(p7) cat 显示或连接文件(p15,16) cd 改变当前目录(p15,16) chgrp 改变文件用户组(p14) chmod 改变文件访问权限(p13) chown 改变文件属主(p14) clear 清除屏幕(p7,8) cmp 比较文件内容(p19) ) compress 文件压缩程序(p22cp 拷贝文件(p15,16) cpio 备份文件(p21) crontab 定时器(p34) csh 使用C Shell(p3) date 显示、修改日期和时间(p7,23) dc 启动台式计算器 ) df 查看磁盘自由空间(p23divvy 硬盘分区(p42) du 查看磁盘使用情况(p23) exit 退出(登录等)(p10) find 查找文件(p18) finger 查看网上信息程序(p7,8,25) format 格式话软盘(p40) fsck 检查文件系统程序(p23) ftp 文件传输协议(程序)(p28) grep 在文件中查找字符串(p19) groupadd 增加用户组(p35) groupdel 删除用户组(p36) groupls 显示用户组属性 groupmod 修改用户组 gunzip 文件解压缩程序(p22) gzip 文件压缩程序(p22) kill 删除进程(p23) ksh 使用K Shell(p3) supplies and get to use, the registration of company assets, record maintenance, maintenance of effective management; 2.6 cost management: preparation of the annual administrative budget, control administrative costs, determine the scope of cost-sharing, sharing the office expenses by month; 2.7 information management: responsible for documents, materials, information and publicity, communication links, and ensure promptly, ranking officers reporting; responsible for the collation and analysis of information, provide the basis for corporate decisions; corporate culture construction, planning, editing, internal publications; 2.8 vehicle management: responsible for the management, repairs and maintenance of vehicles; 2.9 legal disputes: the company responsible for the handling of disputes; 2.10 other: maintaining normal working order, and security. General Manager General Manager job description 1, 1.1 develop strategies and plans: according to company strategic planning, establish the annual management plan, reported to the Board of Directors for approval; 1.2 decomposition measures: according to the Board of Directors issued the annual management plan, annual index of decomposition, through the Organization of coordination mandate in charge of the Department Organization and implementation, ensuring comprehensive implementation of annual indicators; 1.3 inspection: convenes the General Manager Office, through55 logout 退出登录(p10) ls 显示目录(p15,16) mail 发送和接收电子邮件(p25) mailx 发送和接收电子邮件 man 查看帮助信息(p7) mesg 允许接收消息(p9) mkdev 创建设备(p38) mkdir 创建目录(p15,16) mkfs 安装文件系统(p40) more 分页显示程序(p15,16) mount 挂接文件系统(p38) mv 移动文件(p15,16) pack 文件压缩程序(p22) passwd 修改登录口令(p7,8,35) ping IP协议测试(p45) pkzip 文件压缩程序(p23) pkunzip 文件解压缩程序(p23) ps 显示进程(p23) pwd 显示当前目录(p15,16) readnews 查找USENET公告牌 reboot 重起UNIX系统(p45) rm 删除文件及目录(p15,16) rmdir 删除空目录(p15,16) sh 使用B Shell(p3) shutdown 关闭UNIX程序(p23) sort 排序 su 改变登录名 talk 对话程序(p9) tar 备份程序(p20) tee 改向输出且送至标准输出 telnet 网上远程登录程序(p26) umount 解挂文件系统(p39) useradd 增加用户(p35) userdel 删除用户(p35) userls 显示用户属性 usermod 修改用户 uncompress 文件解压缩程序(p22) unpack 文件解压缩程序(p22) uucp UNIX至UNIX拷贝 uux UNIX至UNIX执行 vi 全屏幕编辑文本文件(p17) wall 系统广播程序(p9) who 查看登录信息(p7,8) who am i 查看自己的登录信息(p7,8) supplies and get to use, the registration of company assets, record maintenance, maintenance of effective management; 2.6 cost management: preparation of the annual administrative budget, control administrative costs, determine the scope of cost-sharing, sharing the office expenses by month; 2.7 information management: responsible for documents, materials, information and publicity, communication links, and ensure promptly, ranking officers reporting; responsible for the collation and analysis of information, provide the basis for corporate decisions; corporate culture construction, planning, editing, internal publications; 2.8 vehicle management: responsible for the management, repairs and maintenance of vehicles; 2.9 legal disputes: the company responsible for the handling of disputes; 2.10 other: maintaining normal working order, and security. General Manager General Manager job description 1, 1.1 develop strategies and plans: according to company strategic planning, establish the annual management plan, reported to the Board of Directors for approval; 1.2 decomposition measures: according to the Board of Directors issued the annual management plan, annual index of decomposition, through the Organization of coordination mandate in charge of the Department Organization and implementation, ensuring comprehensive implementation of annual indicators; 1.3 inspection: convenes the General Manager Office, through write 发送消息到终端(p8) 附录B 习题参考答案 基础篇习题参考答案 1、UNIX Shell是一个UNIX的特殊程序,是UNIX内核和用户的接口,是UNIX的命令解释器、也是一种解释性高级语言。目前常见的Shell有三种:B Shell、K Shell和C Shell,各自的启动命令分别是:sh、ksh和csh。 2、进程是正在执行的程序。UNIX允许多个进程同时存在,每个进程都有唯一代号称为进程标识符(pid --- process id)。设备称为设备文件,代表某个硬件,如磁盘、软盘、串口。UNIX对硬件的存取操作都是通过设备文件来完成的。设备文件放在/dev目录下,如/dev/hd0表示第一个软盘驱动器。 3、UNIX常用文件类型及其表示符号如下: 普通文件“-”; 目录文件“d”; 块设备文件“b”; 字符设备文件“c”。 4、“abc*th”表示以abc开头和以th结尾的名字,“abc?”表示此字符串有4个字符,前三个字符为abc 5、UNIX的文件存取权限有“rwx”,分别表示“可读、可写、可执行”。 6、UNIX常用目录如下: 根目录,这是所有目录和文件的起点 / 大部分可执行的UNIX命令和共用程序 /bin 设备文件,如/dev/cd0 /dev 系统管理命令和数据文件 /etc C程序库 /lib 存放用户的家目录和用户共用程序或文件 /usr 临时工作目录,存放一些临时文件 /tmp 7、命令如下: find /usr/abc -name "a*" -print > ddd.dat & 8、因为正常shutdown可以保证UNIX系统文件系统的完整性,若没有shutdown而关机,有一部分内存数据没有及时写回硬盘,可能会对文件系统造成损坏。 supplies and get to use, the registration of company assets, record maintenance, maintenance of effective management; 2.6 cost management: preparation of the annual administrative budget, control administrative costs, determine the scope of cost-sharing, sharing the office expenses by month; 2.7 information management: responsible for documents, materials, information and publicity, communication links, and ensure promptly, ranking officers reporting; responsible for the collation and analysis of information, provide the basis for corporate decisions; corporate culture construction, planning, editing, internal publications; 2.8 vehicle management: responsible for the management, repairs and maintenance of vehicles; 2.9 legal disputes: the company responsible for the handling of disputes; 2.10 other: maintaining normal working order, and security. General Manager General Manager job description 1, 1.1 develop strategies and plans: according to company strategic planning, establish the annual management plan, reported to the Board of Directors for approval; 1.2 decomposition measures: according to the Board of Directors issued the annual management plan, annual index of decomposition, through the Organization of coordination mandate in charge of the Department Organization and implementation, ensuring comprehensive implementation of annual indicators; 1.3 inspection: convenes the General Manager Office, through57 9、停止失控进程步骤: (1) 在未锁死的终端以root登录 (2) 用”ps -ef”和"grep 关键字"命令找到失控进程pid号 (3) kill ,若杀不掉,再运行”kill -9 ” pid号pid号 (4) 若还杀不掉,则shutdown系统 10、命令如下: ftp 129.6.114.201 (输入UNIX用户名和口令,会出现提示符:) ftp> ascii ftp> lcd c:\file1 ftp> cd /usr/abc ftp> put ttt.sql ttt ftp> close ftp> quit 深入篇习题参考答案 1、做法如下: (1) 运行 crontab -l > tmp (2) 对tmp文件进行编辑,追加下面一行: 0 1 * * * /usr/abc/stat (3) 运行 crontab tmp 2、/etc/passwd文件每行由以下部分组成: user_name : password : uid : gid : comment : home : shell /etc/group文件每行由以下部分组成: group_name : password : gid : members_list 3、挂接软盘的过程举例如下: # mkdir /diska 创建一目录 # chmod 777 /diska 改变该目录权限 # mount /dev/fd0135ds18 /diska 将/dev/fd0135ds18挂接到/diska目录 4、/etc/networks文件存放网络列表,每行表示一个网络,由以下三个域构成: name number aliases /etc/hosts文件存放主机列表,每行表示一个主机,由以下三个域构成: address name aliases /etc/gateways文件存放网关列表,每行表示一个网关参数,由以下域构成: name1 gateway name2 metric value supplies and get to use, the registration of company assets, record maintenance, maintenance of effective management; 2.6 cost management: preparation of the annual administrative budget, control administrative costs, determine the scope of cost-sharing, sharing the office expenses by month; 2.7 information management: responsible for documents, materials, information and publicity, communication links, and ensure promptly, ranking officers reporting; responsible for the collation and analysis of information, provide the basis for corporate decisions; corporate culture construction, planning, editing, internal publications; 2.8 vehicle management: responsible for the management, repairs and maintenance of vehicles; 2.9 legal disputes: the company responsible for the handling of disputes; 2.10 other: maintaining normal working order, and security. General Manager General Manager job description 1, 1.1 develop strategies and plans: according to company strategic planning, establish the annual management plan, reported to the Board of Directors for approval; 1.2 decomposition measures: according to the Board of Directors issued the annual management plan, annual index of decomposition, through the Organization of coordination mandate in charge of the Department Organization and implementation, ensuring comprehensive implementation of annual indicators; 1.3 inspection: convenes the General Manager Office, through supplies and get to use, the registration of company assets, record maintenance, maintenance of effective management; 2.6 cost management: preparation of the annual administrative budget, control administrative costs, determine the scope of cost-sharing, sharing the office expenses by month; 2.7 information management: responsible for documents, materials, information and publicity, communication links, and ensure promptly, ranking officers reporting; responsible for the collation and analysis of information, provide the basis for corporate decisions; corporate culture construction, planning, editing, internal publications; 2.8 vehicle management: responsible for the management, repairs and maintenance of vehicles; 2.9 legal disputes: the company responsible for the handling of disputes; 2.10 other: maintaining normal working order, and security. General Manager General Manager job description 1, 1.1 develop strategies and plans: according to company strategic planning, establish the annual management plan, reported to the Board of Directors for approval; 1.2 decomposition measures: according to the Board of Directors issued the annual management plan, annual index of decomposition, through the Organization of coordination mandate in charge of the Department Organization and implementation, ensuring comprehensive implementation of annual indicators; 1.3 inspection: convenes the General Manager Office, through59
本文档为【UNIX操作系统教程&#40;华为培训&#41;】,请使用软件OFFICE或WPS软件打开。作品中的文字与图均可以修改和编辑, 图片更改请在作品中右键图片并更换,文字修改请直接点击文字进行修改,也可以新增和删除文档中的内容。
该文档来自用户分享,如有侵权行为请发邮件ishare@vip.sina.com联系网站客服,我们会及时删除。
[版权声明] 本站所有资料为用户分享产生,若发现您的权利被侵害,请联系客服邮件isharekefu@iask.cn,我们尽快处理。
本作品所展示的图片、画像、字体、音乐的版权可能需版权方额外授权,请谨慎使用。
网站提供的党政主题相关内容(国旗、国徽、党徽..)目的在于配合国家政策宣传,仅限个人学习分享使用,禁止用于任何广告和商用目的。
下载需要: 免费 已有0 人下载
最新资料
资料动态
专题动态
is_105949
暂无简介~
格式:doc
大小:366KB
软件:Word
页数:0
分类:生活休闲
上传时间:2017-10-24
浏览量:8