《aix系统应用基础》
《aix系统应用基础》04 files and d

Absolute or Full Path Name (start from the / directory): $ vi /home/team01/doc/mon_report $ /usr/bin/ls –l /home/team01
Unit 4 Files and Directories
.
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
5.0
4.1
Unit Objectives
.
2
A File
● A file is:
– A collection of data – A stream of characters or a "byte stream" – No structure is imposed on a file by the operating system
.
3
File Types
Relative Path Name (start from current directory):
$ cd /home/team01 $ vi doc/mon_report $ cd /usr/bin $ ./ls –l /home/team01
.
8
Where Am I?
The print working directory command can be used to find out what your current directory is:
aix培训教材

易初电子技术有限公司AIX操作系统培训教材编制:日期:批准:日期:前言 (1)第1章概述 (2)AIX的来源背景 (2)AIX的特点 (2)第二章 RS/6000产品概述 (6)第三章 AIX系统的安装及环境配置 (8)AIX基本系统安装 (8)基本概念 (8)安装介质与方式 (9)安装步骤 (9)准备工作 (9)BOS(Base Operating System)安装 (10)OPP(Optional Program Product)扩展子系统安装 (12)安装的相关说明 (12)安装C及C++语言 (13)安装前准备 (13)C语言安装步骤及License配置 (14)系统的启动和关闭 (18)系统启动过程 (18)系统关机 (19)第4章系统日常管理和维护 (20)用户登录和注销 (20)CDE的启动 (20)用户登录 (20)设备管理和配置 (20)aix的管理思路 (20)对象数据库 (20)Vital Product Data( VPD ) Database (21)Smit Database (21)Predefined Devices Database (22)Customized Devices Database (22)设备管理命令 (22)磁盘和文件系统 (22)储设备的相关术语 (23)存储磁盘管理 (25)PV的管理 (25)VG的管理 (27)LV的管理 (28)文件系统 (29)系统目录 (29)文件系统类型 (30)fsck (30)文件系统的管理 (31)管理进程 (32)进程的属性 (32)系统资源管理器SRC (33)系统的备份与恢复 (35)备份的类型 (35)常用命令 (37)打印管理配置 (40)打印管理中常用的术语: (40)创建一个打印队列 (42)打印配置文件 (43)打印队列的控制 (44)启动和停止一个打印队列 (45)设置TCP/IP (47)IP地址和子网掩码 (48)TCP/IP通讯后台进程 (48)以太网的配置 (50)网络测试 (50)主机文件 (51)相关命令 (51)第五章 AIX常用命令 (54)逻辑卷管理命令总结 (54)物理卷命令 (54)卷组命令 (54)逻辑卷命令 (55)文件系统命令 (55)交换空间管理 (55)用户管理 (56)其他 (56)第六章安全控制 (57)用户的规划 (57)主机服务的控制。
AIX基础教程

AIX操作系统概述2、两个或多个命令可以在同一行输入,中间以分号;隔开。
3、命令作业放在后台执行,在命令最后加上符号&。
7、创建命令别名时用alias Name=String,例如$alias dir="/usr/bin/ls -alF"。
使用AIX系统6、目录换名mv SourceDirectory TargetDirectory7、目录拷贝cp SourceDirectory TargetDirectory五、文件管理1、文件拷贝cp SourceFile TargetFilecp SourceFile TargetDirectory2、文件删除rm File3、文件链接ln SourceFile TargetFile4、文件移动/换名mv SourceFile TargetFile or TargetDirectory5、显示文件内容morepgcatheadtail6、文件查找find / -name .profile -printfind . -perm 0600 -printfind . -ctime 1 -printfind . -inum 2145 -printfind . -user abc -print六、改变文件/目录属性每一个文件或目录都有一个属主、一个组名和一组存取权限、访问时间等等。
1、改变文件或目录的最近访问时间touch2、改变文件或目录的属主chown3、改变文件或目录的属组chgrp4、改变文件或目录的存取权chmodchmod g+w Filechmod u+r Filechmod u=rwx Filechmod 755 File八、进程控制1、查询进程状态psps -aps -efps -lps -u uid2、终止进程的执行kill 19160kill -9 191603、对进程的控制nohupnicesleepwait4、在指定的时间运行程序atbatchcron /usr/bin/crontabcrontab和/var/spool/cron/crontabs/ 九、退出系统和关机exitCtr + dlogoutshutdown [ -option ] [ +time message ]当shutdown不带任何参数时,机器会向连在其上的所有终端发出一条关机信息,接着在一分钟后关闭所有终端,杀掉所有在系统上运行的进程,卸除所有文件系统,最后关闭系统。
《aix系统应用基础》08 shell ba

test1.2 test1.3 myfile
$ cat ?[!y]*[2-5]
ne
test1.2 test1.3
net
new
nest
few
ppt课件
6
The Standard Files
standard in (0)
cmd
standard out (1)
standard error (2)
ppt课件
Default standard input
$ mail team01 Subject: Letter This is a letter. <ctrl-d> Cc: $
Redirect input from a file: <
$ mail team01 < letter $
ppt课件
9
Output Redirection
7
File Descriptors
● Three descriptors are assigned by the shell when the program starts:
Standard in:
<
0
Standard out:
>
1
Standard error:
2>
2
ppt课件
8
Input Redirection
Examples: *?![][-]
ppt课件
4
File Name Substitution (1 of 2)
Wildcards:
*
?
One character compare:
/
$ ls ne? net new
aix基础

删除目录
删除目录的命令
$rmdir dir_name
两个前提
要删除的目录必须是空的 要删除的目录不能是当前目录
列出目录
列目录的命令
$ls dir_name
几个选项 -l 文件特权、链接数目、所有者、组、大小 (按字节)和每个文件最近一次修改时间 -a 列出目录中所有项,包括以 .(点)开始的 项 -t 按照最近一次修改时间(最近的最先)而不 是名称排序。
/usr/bin
常用的系统目录
/var
主要存放各种用途的日志文件 同时也存放临时生成的缓冲池文件 包含系统和应用程序的配置文件
/etc
/home
用户的文件及目录
路径名
路径名是什么
路径名是指通过/分离的文件名队列.
路径的两种类型
绝对路径
从/(根目录)开始的路径 /home/team01/doc/mon_report 从当前目录开始的路径 ./team03/pagms/suba
smit是系统管理界面工具的缩写 通过smit可以实现绝大部分的系统管理功能 SMITTY不仅提供了直截了当的、简化的系统管 理环境,还通过两个日志文件(smit.log和 smit.script)记载了用户所做的所有smit 操作。这就给了我们一条命令和脚本的生成捷 径--利用SMITTY脚本文件生成我们自己的脚 本文件--这何其方便!
多特点。
AIX 的发展历程
我们使用的是
AIX 5.3 版本
AIX 的主要组成
内核 (Kernel) 文件系统 (File system) 外壳 (Shell) 通信/网络(Communication/Network) 文本处理(Text processing) 编程语言 (Programming Languages) 系统管理 (System Management) 在线帮助文档(On-line document) 窗口环境 (AIX Windows Environment) 其他功能 (other utilities) 其他应用软件
aix系统应用基础-02 using the system 共21页

© Copyright IBM Corporation 2019
Activity: Questions and Answers
1. What's wrong with the following commands?
$ du -s k _______________________________
2. What command would you use to send mail items?
3. What are other commands that can be used to communicate with other users?
4. What output would you expect from the following command: cal 8?
5.0
4.1
Unit Objectives
After completing this unit, you should be able to: ● Log in and out of the system ● State the structure of AIX commands ● Execute basic AIX commands ● Use AIX commands to communicate with other users
Cc: <Enter>
$
$ mail team20sys2 Subject: Don't Forget! Don't forget about the meeting today! <Ctrl-d> Cc: <Enter> $
© Copyright IBM Corporation 2019
AIX操作系统培训(共130PPT)

显示逻辑卷信息
● 依卷组显示逻辑卷 #lsvg -l rootvg
第二十五页,共一百三十页。
SMIT逻辑卷管理器菜单
# lvm
第二十六页,共一百三十页。
SMIT卷组菜单
# smit vg
第二十七页,共一百三十页。
显示卷组信息(1)
●显示全部卷组或活动卷组
●显示卷组状态
第二十八页,共一百三十页。
第五十页,共一百三十页。
Paging Space的概念
为了给有限的内存提供更大的空间,系统将正在工作的 程序调入内存,而将处于inactive状态的应用放入磁盘。 这块磁盘空间叫做系统的Paging Space。
并非内存的替代品
第五十一页,共一百三十页。
Paging Space的图释
RAM=16MB
第四页,共一百三十页。
传统UNIX磁盘存储
分区1
分区2
空余空间 问题:
分区位置不可变 扩展分区大小困难
文件和文件系统大小受限制 要求分配给分区的空间连续
预先方案难度
第五页,共一百三十页。
LVM概念
LVM:Logical Volume Manager 包括一系列的命令、lib库、其他工
具 分为逻辑存储和物理存储
启动逻辑卷〔Boot Logical Volume,blv,例如 /dev/hd5〕
无结构〔裸设备〕
第十六页,共一百三十页。
文件系统
文件系统是: -是存储数据的一种方法 -具有层次目录结构 AIX文件系统有3种类型: -日志文件系统〔jfs〕 -CD-ROM文件系统〔cdrfs〕 -网络文件系统〔nfs〕
不同的文件系统以目录结构连接起来
第十七页,共一百三十页。
《aix系统应用基础》05 using files

$ ls –li 63 -rw-r--r--
2 team01 staff
$ ln –s man_files manuals
$ ls -li 63 -rw-r--r-66 lrwxrwxrwx
1 team01 staff 1 team01 staff
1910 Nov 21 14:19 man_files
© Copyright IBM Corporation 2008
Printing Files
qprt - queue files to the printer qchk – display the current status of a print queue qcan – cancel a print job (specify job number)
© Copyright IBM Corporation 2008
Linking Files (cont.)
ln –s source_file target_file
• Creates an indirect reference to a file (symbolic link) • Name references the original file’s name and path • Can be used with directories and span file systems
programa programa
test1
.profile manuals test1
$ cd /home/team01/doc $ cp trio_ltr ../c
home team01
home team01
c doc trio_ltr
c
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
ksh
script commands
.
(1) (2) (3)
Subshell
(1) (2) (3)
10
Invoking Shell Scripts (2 of 3)
$ cat hello
echo "Hello, John. Today is: $(date)" pwd ls $ chmod +x hello
.
2
What Is a Process?
Each program runs in a process: The Process Environment
Program
User and group ID
Data Open files Current directory
Process ID (PID) Parent Process ID (PPID) Program variables
.
11
Invoking Shell Scripts (3 of 3)
$ cat set_dir
dir1=/tmp dir2=/usr
$ . set_dir
$ echo $dir1 /tmp $ echo $dir2 /usr
. (dot): Execution in the current shell
$ cat hello
echo "Hello, John. Today is: $(date)" pwd ls
$ ksh hello
Hello, John: Today is: Wed Sep 13 19:34 /home/john books letter1 text2sarah
$_
-ksh $ ksh hello
login:
AIX System PID=202 -ksh
login: john John's Password: xxxxxx
$_
Environment
program uid gid files PID
/usr/bin/ksh john staff /dev/tty1 202
.
4
Process Environment
.
5
Parents and Children
$ echo $$ 202
$ ksh
$ echo $$ 206
(Create a subshell)
Subshell
$ date (Run a command)
Tue Jan 4 11:18:26 GMT 2000
$ <ctrl-d>
(Exit the subshell)
$ echo $$ 202
PID PPID
-ksh
202 1
ksh
206 202
date
208 206
.
6
Variables and Processes
Variables are part of the process environment. Processes cannot access or change variables from another
?
What is the value of dir1 and dir2, if set_dir is called without the dot?
.
12
Exit Codes from Commands
A command returns an exit value to the parent process:
process.
$ x=4 $ ksh $ echo $x
Subshell
$ x=1 $ <ctrl-d> $ echo $x 4
.
7
Activity: Exporting Variables
varl
export variable=value
.
8
What Is a Shell Script?
$ hello
Hello, John: Today is: Wed Sep 13 19:34 /home/john books letter1 text2sarah $_
(1) (2) (3)
Subshell
(1) (2) (3)
The shell uses the PATH variable to find executable programs.
0
=
1 - 255 =
Success Other than successful
The environment variable $? contains the exit value of the last command:
A shell script is a collection of commands stored in a text file
$ vi hello
echo "Hello, John. Today is: $(date)" pwd ls
~ ~ ~ :wq
$
.
9
Invoking Shell Scripts (1 of 3)
$ cat kfile
AIX System
PID=202 -ksh PID=310 cat
Environment during execution
program uid gid files
parent PID PPID
/usr/bin/cat john staff /dev/tty1 kfile -ksh 310 202
Unit 10 Processes
.
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
5.0
4.1
Unit Objectives
After completing this unit, you should be able to: ● Define an AIX process ● Describe the relationship between parent and child processes ● Create and invoke shell scripts
The variable $$ shows the process ID of the current shell:
$ echo $$ 4712
The ps command shows the running processes:
$ ps -u team01
.
3
Login Process Environment