IBM--AIX命令

合集下载

IBM_AIX小机命令手册

IBM_AIX小机命令手册

?EXCLUDE files:如果选择yes,将使得文件/etc/exclude.rootvg文件中列出的文件和目录不被备份。
?Make BOOTABLE backup:是否生成可启动备份,一般取默认值——yes。
?EXPAND /tmp if needed:是否在需要时自动扩展/tmp文件系统。强烈建议选yes。
内存大小: lsattr –El mem0
? 磁盘 lspv
? 交换分区 lsps –a
? 软件 lslpp –l 文件包名字
? 用户 who
关机命令:
–shutdown
一分钟后关机
–shutdown +2
二分钟后关机
–shutdown –Fr
关机重启(-r)
–或者创建一个CD-ROM文件系统并进行加载
?smit cdrfs
?mount /cdrom
?卸载cdrom
– unmount /cdrom
二、备份与恢复
rootvg备份 — mksysb
●只备份rootvg
●只备份已挂接的文件系统
●以备份格式创建可启动磁带
●保存rootvg中的换页空间设备定义
●tar (tape archive)
◇适用范围广
◇非常适合在不同UNIX平台间传送文件
◇可恢复空目录(-d选项)
◇不支持AIX访问控制列表(ACL,属于扩展inode内容)
●cpio(copy input to output)
◇适用范围广
◇符号链接较多时可能不能正常工作
?ls 显示目录中的内容(文件名)
#ls –a 列出当前目录中的所有文件

IBM-AIX-操作系统常用命令-V1.0-20060223-B

IBM-AIX-操作系统常用命令-V1.0-20060223-B

IBM AIX操作系统常用命令V1.0华为技术有限公司版权所有侵权必究修订记录目录第一章IBM小型机硬件配置信息查询命令 (5)1.小型机机型查询命令 (5)2.小型机CPU信息查询 (5)3.小型机内存信息查询 (5)4.小型机硬盘信息查询 (5)5.小型机网卡信息查询 (6)6.小型机SCSI卡信息查询 (6)7.小型机光纤卡信息查询 (7)8.小型机SSA卡信息查询 (7)9.小型机磁带机信息查询 (7)10.小型机软驱信息查询 (7)11.小型机RS232 卡端口 (7)12.小型机光驱信息查询 (8)13.小型机硬件平台是否是64位 (8)第二章IBM小型机系统信息查询命令 (9)1.主机名称查询 (9)2.操作系统版本、补丁信息查询 (9)3.系统安装软件信息查询 (9)4.系统物理硬盘信息查询 (10)5.逻辑卷查询命令 (11)6.卷组查询命令 (11)7.文件系统查询命令 (12)8.交换区信息查询命令 (12)9.主机IP地址查询 (13)10.当前进程查询 (13)11.用户信息查询 (14)12.显示HACMP状态 (14)12. 系统运行级查询 (14)13.查看系统已经运行时间 (14)14.显示登陆用户信息 (14)15.显示启动设备信息 (14)16.关闭系统命令 (15)17.查看系统启动log信息 (15)18.查看crontab 配置信息 (15)19.查询系统路由信息 (15)20.查看用户历史命令列表 (15)21.查看系统时间 (16)22.查看tcpip参数 (16)23.查看系统license情况 (16)24.查看系统错误日志 (16)25.清除日志记录 (16)26.系统dump设备查询 (16)27.性能监控 (17)28.系统I/O设备性能监控 (17)29.系统内存监控 (17)30.系统软件和硬件信息查询 (17)31.测试网络的连通性 (17)第三章配置主机常用命令 (18)1.更改主机名称 (18)2.增加、删除用户命令 (18)3.增加、删除组命令 (18)4.删除硬盘设备 (18)5.增加、删除文件系统 (19)6.增加、删除、扩大逻辑卷 (19)7.创建、删除卷组 (20)8.卷组操作命令 (20)9.文件系统管理命令 (20)10.Paging space 管理命令 (21)11.SRC操作命令 (22)12.系统设备配置命令 (22)13.查找文件命令 (22)14.更改文件或目录的访问权限 (22)15.更改文件或目录的owner及group (22)16.系统调试工具 (23)17.操作系统备份命令 (23)18.HACMP操作命令 (23)19.改变用户口令 (23)20.配置IP地址 (24)21.NFS操作命令 (24)22. 安装软件 (24)23.删除软件 (25)第一章IBM小型机硬件配置信息查询命令1.小型机机型查询命令# prtconf |grep ModelSystem Model: IBM,7038-6M22.小型机CPU信息查询# lsdev -Cc processorproc0 Available 00-00 Processorproc1 Available 00-01 Processorproc2 Available 00-02 Processorproc3 Available 00-03 Processor显示处理器的状态、数量、设备逻辑名称# lsattr -El proc0state enable Processor state Falsetype PowerPC_POWER4 Processor type Falsefrequency 1452000000 Processor Speed False3.小型机内存信息查询# lsdev -Cc memorymem0 Available 00-00 MemoryL2cache0 Available 00-00 L2 Cache# lsattr -El mem0size 4096 Total amount of physical memory in Mbytes Falsegoodsize 4096 Amount of usable physical memory in Mbytes False 4.小型机硬盘信息查询# lsdev -Cc diskhdisk0 Available 1Z-08-00-8,0 16 Bit LVD SCSI Disk Drivehdisk1 Available 1Z-08-00-9,0 16 Bit LVD SCSI Disk Drivehdisk2 Available 14-08-L SSA Logical Disk Drivehdisk3 Available 14-08-L SSA Logical Disk Drive# lsattr -El hdisk0pvid 0058e08d80035d6e0000000000000000 Physical volume identifier False queue_depth 3 Queue DEPTH Falsesize_in_mb 36400 Size in Megabytes False5.小型机网卡信息查询# lsdev -Cc adapter|grep entent0 Available 1c-08 10/100 Mbps Ethernet PCI Adapter II (1410ff01)ent1 Available 1j-08 10/100 Mbps Ethernet PCI Adapter II (1410ff01)ent2 Available 1n-08 10/100 Mbps Ethernet PCI Adapter II (1410ff01)ent3 Available 11-08 10/100 Mbps Ethernet PCI Adapter II (1410ff01)ent4 Available 1A-08 10/100 Mbps Ethernet PCI Adapter II (1410ff01)ent5 Available 1D-08 10/100 Mbps Ethernet PCI Adapter II (1410ff01)# lsattr -El ent0busmem 0xe4030000 Bus memory address False rom_mem 0xe4000000 ROM memory address False busintr 101 Bus interrupt level False intr_priority 3 Interrupt priority False txdesc_que_sz 512 TX Descriptor Queue Size True rxdesc_que_sz 512 RX Descriptor Queue Size True tx_que_sz 8192 Software TX Queue Size True rxbuf_pool_sz 1024 Receive Buffer Pool Size True media_speed Auto_Negotiation Media Speed True use_alt_addr no Enable Alternate Ethernet Address True alt_addr 0x000000000000 Alternate Ethernet Address True tx_preload 1520 TX Preload Value True ipsec_offload no IPsec Offload True chksum_offload yes Enable hardware transmit and receive checksum True large_send no Enable TCP Large Send Offload True slih_hog 10 Interrupt Events per Interrupt True rx_hog 1000 RX Descriptors per RX Interrupt True poll_link no Enable Link Polling True poll_link_timer 500 Time interval for Link Polling True6.小型机SCSI卡信息查询# lsdev -Cc adapter | grep scsiscsi0 Available 1Z-08 Wide/Ultra-3 SCSI I/O Controllerscsi1 Available 1Z-09 Wide/Ultra-3 SCSI I/O Controller7.小型机光纤卡信息查询# lsdev -Cc adapter | grep fcp8.小型机SSA卡信息查询# lsdev -Cc adapter | grep ssassa0 Available 14-08 IBM SSA 160 SerialRAID Adapter (14109100) # lsattr -El ssa0ucode 14109100.05.c4 Name of adapter code download file False bus_io_addr 0x1ec00 Bus I/O address Falsebus_mem_start 0xe8000000 Bus memory address False bus_mem_start2 0xe8928000 Bus memory address False bus_mem_start3 0xe8900000 Bus memory address False bus_mem_start4 0xe8800000 Bus memory address False bus_intr_level 117 Bus interrupt level Falseintr_priority 3 Interrupt priority Falsedaemon true Enable the SSA adapter daemon Truehost_address Host Address for Adapter Truescat_gat_pages 8 Pages allocated for scatter/gather True poll_threshold 0x100 IO Polling threshold Truedma_mem 0x400000 DMA bus memory length True 9.小型机磁带机信息查询# lsdev -Cc tapermt0 Available 1Z-08-00-0,0 Differential SCSI 4mm Tape Drive10.小型机软驱信息查询# lsdev -Cc diskettefd0 Available 01-D1-00-00 Diskette Drive11.小型机RS232 卡端口# lsdev -Cc ttytty0 Available 01-S1-00-00 Asynchronous Terminal12.小型机光驱信息查询# lsdev -Cc cdromcd0 Available 1Z-08-00-1,0 16 Bit LVD SCSI DVD-ROM Drive 13.小型机硬件平台是否是64位# bootinfo -y64第二章IBM小型机系统信息查询命令1.主机名称查询# hostnamep650a2.操作系统版本、补丁信息查询# oslevel -r5100-09# instfix -i|grep MLAll filesets for 5.1.0.0_AIX_ML were found.All filesets for 5100-01_AIX_ML were found.All filesets for 5100-02_AIX_ML were found.All filesets for 5100-03_AIX_ML were found.All filesets for 5100-04_AIX_ML were found.All filesets for 5100-05_AIX_ML were found.All filesets for 5100-06_AIX_ML were found.All filesets for 5100-07_AIX_ML were found.All filesets for 5100-08_AIX_ML were found.All filesets for 5100-09_AIX_ML were found.3.系统安装软件信息查询# lslpp –lFileset Level State Description---------------------------------------------------------------------------- Path: /usr/lib/objreposIMNSearch.bld.DBCS 2.3.1.15 COMMITTED NetQuestion DBCS BuildtimeModulesIMNSearch.bld.SBCS 2.3.1.15 COMMITTED NetQuestion SBCS BuildtimeModulesIMNSearch.msg.en_2.3.1.0 COMMITTED Text Search Messages - U.S.English。

Linux及IBM_AIX命令2015.11.18

Linux及IBM_AIX命令2015.11.18

L inux1、常用命令2、常用命令举例aliascd ~vi .bashrc…alias dd=”ls -l”<wq!>source ~/.bashrctailtail file //查看file文件最后十行tail –f file //查看file文件最后十行,随文件增长变化tail –n +2 file //从第二行位置读取file文件tail –n -2 file //从倒数第二行位置读取file文件tail –r –n -10 file //读取file文件最后十行并逆序显示headhead file //查看file文件前十行head –n 14 file //查看file文件前十四行head file file1 //查看file、file1文件前十行psps –a //一个终端的所有进程ps –A //显示所有进程,相当于-eps –f //列出全部信息ps –u //以用户区分进程ps –x //显示所有程序ps –aux | grep tetradps –ef | grep tetrad[root@localhost ~]# ps –ef | grep tetrad用户进程id 父进程id CPU占用率开始时间终端运行时间执行命令UID PID PPID C STIME TTY TIME CMDroot 2673 1 1 Oct08 ? 01:34:02 ./tetrad ……root 7728 5709 0 10:38 pts/1 00:00:00 grep tetrad [root@localhost ~]#3、常见问题I BM_AIX1、常用命令2、常用命令举例aliascd /etcvi profile…alias dd=”ls -l”<wq!>source etc/profile3、常见问题Tooltalk message server could not be started主机ip地址和域名不一致hostname <IBM_aix_10.8.59.173>more /etc/hosts <10.8.59.173 localhost> 修改hostname和hosts文件主机名一致即可工具。

IBM_AIX5L学习笔记

IBM_AIX5L学习笔记

1、shutdown 命令-d 关闭系统并从分布模式(distributed mode)转入多用户模式(multiuser mode)。

-F 进行快速关机,旁路掉给其他用户发消息的过程,并尽可能快地将系统关闭。

-h 彻底停止操作系统;其作用与-v 标记相同。

-i 指定采用交互模式(interactive mode)。

显示交互信息来指导用户关机。

-k 避免关闭系统。

-m 关闭系统并转入维护(单用户)模式。

-r 在用reboot 命令关机后重启系统。

-v 彻底停止操作系统。

#shutdown -Fr 快速关闭并重启系统2、列出硬件设备(lsdev、lspv、lsattr)#lsdev -P -H 显示预定义设备对象中的所有设备,并显示列标题#lsdev -C -H 列出定制的设备对象类中的所有设备#lsdev -Cc adapter 显示系统中的网络适配器#lsdev -C -c tape 显示系统中的磁带#lsdev -C -c disk 显示系统中的硬盘#lspv 显示系统中的物理卷#lspv hdisk0 显示物理卷hdisk0的状态和特性#lsattr 显示系统中设备的属性特征和可能的属性值#lsattr -l tty0 -a login -R 列出tty 设备tty0 的登录属性的可能值3、cfgmgr 配置系统设备4、oslevel(-l、-g、-q)#oslevel -o5、installp 用于安装和更新软件6、SMIT和SMITTY7、lslpp 显示被安装的文件集或文件集更新的有关信息lslpp (-l、-f、-h、-a)8、磁盘镜像(Disk mirroring)#smitty mirrorvg#mklv 命令允许你为每个逻辑卷选择一个或两个附加拷贝#mklvcopy 命令为一个已经存在的逻辑卷增加镜像#mirrorvg 命令对一个给定卷组的所有逻辑卷作镜像,缺省时试图将逻辑卷镜像到一个卷组的所有磁盘例:对workvg卷组作三重镜像#mirrorvg -c 3 workvg对rootvg提供缺省镜像#mirrorvg rootvg --rootvg卷组现在就有了两份数据拷贝例:为了从一个镜像的卷组中替换掉一个失效(hdisk7)的磁盘驱动器,运行下面的命令:#unmirrorvg workvg hdisk7#reducevg workvg hdisk7#rmdev -l hdisk7 -d例:用一块新磁盘替换失效的磁盘,将其命名为hdisk7,执行下面的命令:#extendvg workvg hdisk7#mirrorvg workvg- 下面的命令将同步新创建的镜像:#mirrorvg -S -c 3 workvg-c 标记指定在mirrorvg 命令执行完成后每个逻辑卷必须具有的最小的拷贝个数。

AIX基本知识

AIX基本知识

AIX操作系统概述一、AIX的性能和特点:1、短小强干的内核和丰富的核外系统程序;AIX对系统的内核进行了精心设计,使之既简短又强干,可常驻内存。

把凡是能从内核中分离出来的部分都从中分离出来,被分离出来的部分均按核外系统程序对待。

2、良好的用户界面;AIX向用户提供的界面功能齐备,使用方便。

其中包括:命令是用户通过键盘和显示终端与系统进行交互会话的界面。

系统调用命令是供用户在编写应用程序时使用的界面。

X-WINDOWS是系统与用户之间的图形界面环境。

3、可装卸文件卷的文件系统AIX的整个文件系统由一个基本文件系统和若干个可装卸的子文件系统构成,它允许用户根据需要把自己的文件卷装入并与基本文件系统连接起来,不需要时可以拆卸下来。

AIX的这种特点既便于扩大文件存储空间,又有利于安全和保密。

4、文件、目录和各种I/O设备均作为文件统一处理为了方便用户使用,AIX将普通数据文件、目录文件和I/O设备均以文件论之,三者使用相同的保护机制,在用户面前它们具有相同的语法和语义。

5、性能良好的网络环境AIX为用户提供了良好的网络环境,主要包括:一组网络通信协议,例如TCP/IP。

一组网络通信工具,例如mail,talk等。

一组网络编程接口,例如TLI(Transport Layer Interface)和Socket等。

6、完善的安全机制AIX具有完善的多级安全/保密机制,其中用户级机制的基本内容包括:AIX将其用户分为普通用户和特权(超级)用户,它们各自享有不同的权限。

AIX为每一个用户都建立一个户头,称之为用户帐户。

系统通过用户帐户来组织和记录各用户在系统中的活动,并将其限制在一定的活动范围之内。

AIX要求每一个用户必须用合法的用户名、正确的口令进行注册,并将每一个用户都归划到某一个特定的用户组中。

AIX要求每一个用户必须按照自己拥有的权限对文件/目录进行访问,不符合权限规定的访问不被系统所接受。

7、AIX用C语言编写,非常便于移植。

IBM AIX命令手册:IBM MQ管理、安装和卸载说明书

IBM AIX命令手册:IBM MQ管理、安装和卸载说明书

Summary of AIX commands to administrate MQhttps:///support/pages/node/6407842Date last updated: 17-Jun-2021Angel Rivera –*************.comIBM MQ Support+++ Objective +++T o provide the most common AIX commands to administrate, install and uninstall MQ.The organization of the sections is based on what will be the commands to start the installation of MQ from scratch:- ensuring that you have a supported version of AIX: uname, oslevel- create the group “mqm” (mkgroup) and the user “mqm” (mkuser),- unpack the .Z or tar.gz file downloaded from IBM Passport Advantage or IBM Fix Central: gunzip, uncompress, zcat, tar- install/uninstall via installp- querying filesets via lslpp- create (mkusil), list (lsusil), remove (rmusil) a USIL, and- specifying USILs (-R ALL or -R /usr/mqm92) with installp and lslpp++ Update from 17-Jun-2021The AIX command “install -r” that is discussed in this chapter will REJECT all the fix packs installed in the server. If you have only 1 fix pack or if you want to delete at the same time all the fix packs, then the procedure in this chapter is fine.But if you have multiples fix packs and you want to uninstall ONL Y the LATEST one, then you need to use another procedure, which is documented in the article:https:///support/pages/node/6464857Uninstalling only the latest fix pack for MQ in AIX and leaving behind other previous fix packs+++ Related tutorials +++https:///support/pages/node/6405792Customization of an AIX server for using MQ+ Customization of Putty for using Function Key F3 with smitty+ Creating groups and userids+ Downloading, customizing and using the sample scripts+ Customization of bash login for root+ Customization of set-mq-xxx scripts in /usr/local/bin to reflect MQ installations+ Customize the bash login for user "mqm" or the normal user "fulanohttps:///support/pages/node/6407850Installing in AIX - MQ 9.0.0.1 LTS, applying Fix Pack 9.0.0.11, Uninstalling MQChapter 1: How to get the installation imagesChapter 2: Create userid "mqm" and group "mqmChapter 3: Installation of MQ 9.0.0.1 (Installation1 in /usr/mqm)Chapter 4: Setting the environment for MQChapter 5: Creating a test queue manager, quick verification testChapter 6: Installation of the Fix Pack 9.0.0.11Chapter 7: Uninstallation of the Fix Pack 9.0.0.11Chapter 8: Uninstallation of the base 9.0.0.1Chapter 9: Appendices showing full output from installp for the scenarioshttps:///support/pages/node/6415777Upgrading in AIX from MQ 9.0.0.1 to MQ 9.1.0.0 LTSChapter 1: How to get the installation imagesChapter 2: T ake a backup of the queue manager data and recovery logsChapter 3: Uninstalling MQ 9.0Chapter 4: Installing MQ 9.1.0.0 LTSChapter 5: Running setmqenv to use MQ 9.1 commandsChapter 6: Creating a queue manager under 9.1Chapter 7: Upgrading an existing queue manager to MQ 9.1https:///support/pages/node/6415921Installing in AIX - MQ 9.2 LTS to coexist with MQ 9.1 LTS, including applying Fix Packs 9.1.0.7 and 9.2.0.1 Chapter 1: How to get the installation imagesChapter 2: Creating USIL and installing MQ 9.2 side-by-side to MQ 9.1Chapter 3: Need to run setmqenv to use MQ 9.1 or MQ 9.2 commandsChapter 4: Creating a queue manager under MQ 9.2Chapter 5: Migrating an MQ 9.1 queue manager to MQ 9.2Chapter 6: Installing Fix Pack 9.1.0.7 in Installation1 (default location)Chapter 7: Installing Fix Pack 9.2.0.1 in Installation2 (USIL /usr/mqm92)Chapter 8: Uninstallation of MQ 9.2Chapter 9: Deleting the USIL /opt/mqm92https:///support/pages/node/6429607Life cycle for a USIL in AIX for non-default installations of MQ++ Displaying version of operating systemDisplaying the platform and hostname+ROOT+ aglet: /downloads# uname -aAIX aglet 2 7 00F944604C00Displaying the version (high lievel)# oslevel7.2.0.0Displaying the detailed version# oslevel -s7200-05-01-2038+++ Creating group ‘mqm’ and user ‘mqm’The following steps show how to create:- a group “mqm” (gid 202),- a user “mqm” (userid 205),- under /home/mqmLogin as user: rootCreate a group called “mqm” with groupid of 202:mkgroup -'A' id='202' mqmCreate a user also called “mqm” with userid of 205 and who belongs to group “mqm”: mkuser id='205' pgrp='mqm' home='/home/mqm' mqmYou can assign the password:passwd mqmYou can use the command “id” to find out the ids and the group membership:$ id mqmuid=205(mqm) gid=202(mqm) groups=1(staff)+++ How to unpack tar.Z and tar.gz filesWhen you download MQ files from IBM Passport Advantage or IBM Fix Central, there are 2 possible suffixes for the file names:tar.Ztar.gzThe tar options are:-x T o extract members from the archive into the file system.-v T o be verbose about the operation being performed.-f FileArchive T o use the specified file archive as the tar archive.The rest of this section provides more details on how to unpack the files.a) Suffix: tar.ZThe most common ways to unpack this type of files are:a.1) One (1) long compound command (it preserves the file tar.Z)zcat MQ_V9.0_F_AIX_EIMAGE.tar.Z | tar -xvf -The output of zcat is sent to the standard output file (i.e., stdout).This allows the user to decompress the compressed tar file (leaving the compressed file unchanged), and then to expand the tar file to the current directory.The "f -" tar command line option tells the tar command to read its input from the standard input file (i.e., stdin).a.2) T wo (2) simpler commands (the tar.Z is uncompressed, leaving a .tar file) Decompress the file tar.Z by issuing:uncompress MQ_V9.0_F_AIX_EIMAGE.tarThen unpack the file:tar -xvf MQ_V9.0_F_AIX_EIMAGE.tarb) Suffix: tar.gzb.1) One (1) long compound command (it preserves the file tar.gz)gunzip -c IBM_MQ_9.1_AIX.tar.gz | tar -xvf -A common convention is to use the "-c" command line option on the gunzip command so that instead of replacing the tar.gz, the output of the command is sent to the standard output file (i.e., stdout). This allows the user to decompress the compressed tar file (leaving the compressed file unchanged), and expand the tar file to the current directory. The "f -" tar command line option tells the tar command to read its input from the standard input file (i.e., stdin).b.2) T wo (2) simpler commands (the tar.gz is uncompressed, leaving a .tar file) Decompress the file tar.gz by issuing:gunzip IBM_MQ_9.1_AIX.tar.gzThen unpack the file:tar -xvf IBM_MQ_9.1_AIX.tar+++ Creating a USIL to install in a non-default location, such as /usr/mqm92+ Create a dedicated installation directory and designate it as a USILLogin as userid root to create the USIL- Create directory for the USIL.This directory will be designated to be a USIL in a step mentioned later on.# mkdir /usr/mqm92- List the subdirectories that will have the MQ code.Note that /usr/mqm is the default location for Installation1 (in this case,it already has MQ 9.1)# ls -dl /usr/mq*dr-xr-xr-x 20 mqm mqm 4096 Jan 27 07:34 /usr/mqmdrwxr-xr-x 2 root system 256 Jan 27 09:17 /usr/mqm92- So far, we do not have any USI Ls. Let’s verify by issuing the following command:# lsusil(empty)- Make the newly created directory a USIL.Note that the directory will be known as: INSTALL_ROOT_PATH# mkusil -R /usr/mqm92 -c 'MQ 9.2' -Xmkusil: Return Status = SUCCESSWhere:-R /usr/mqm92 => usil location-c comment-X Expands the space needed automatically.- List the USILs and note the new one:# lsusilINSTALL PATH = /usr/mqm92COMMENTS = MQ 9.2- Proceed to use the USIL with installp and lslpp.- If you uninstall MQ from the USIL and if you decide to not use the USIL anymore, then delete it.Please keep in mind that rmusil does not delete the directory structure for the USIL! # rmusil -R /usr/mqm92rmusil: Return Status = SUCCESS- List the USILs (it should show no USILs)# lsusil(empty)- Remove the directory structure that was associated with the USIL:# rm -fr /usr/mqm92+++ Using installp to install and uninstallAfter using “tar -xvf” to unpack the base code to install, you need to go to the newly created directory “MQServer”# cd MQServer++ Install the base code:T o install the base code in the default location /usr/mqm:# installp -acgXYd . all- T o install the base code in a non-default location such as /usr/mqm92# installp -R /usr/mqm92 -acgXYd . allWhere “-R usil” is the path of the User Specified Installation Location (USIL) specified when the product was installed.++ Install the fix pack code on top of an existing installation:T o install the fix pack code in the default location /usr/mqm:# installp -agXYd . all- T o install the fix pack code in a non-default location# installp -R /usr/mqm92 -agXYd . allWhere “-R usil” is the path of the User Specified Installation Location (USIL) specified when the product was installed.++ Reject ALL the Updates (uninstall all the Fix Packs)From the default location:# installp -r "mqm*"From a USIL:# installp -R /usr/mqm92 -r "mqm*"++ Update from 17-Jun-2021The AIX command “install -r” that is discussed in this chapter will REJECT all th e fix packs installed in the server. If you have only 1 fix pack or if you want to delete at the same time all the fix packs, then the procedure in this chapter is fine.But if you have multiples fix packs and you want to uninstall ONL Y the LATEST one, then you need to use another procedure, which is documented in the article:https:///support/pages/node/6464857Uninstalling only the latest fix pack for MQ in AIX and leaving behind other previous fix packs++ Uninstalling the base code:T o uninstall or modify IBM MQ by using installp, enter one of the following commands:- T o uninstall an installation in the default location /usr/mqm:installp -u mqm- T o uninstall an installation in a non-default location:installp -R /usr/mqm92 -u mqmWhere “-R usil” is the path of the User Specified Installation Location (USIL) specified when the product was installed.+++ Using lslpp to list the MQ filesetsa) This is the most comprehensive command to list all the installed MQ filesets ACROSS the different USILs and including the normal location of /usr/mqm.The following shows the output when MQ is not installed at all and there are no USILs. Note that ALL is in UPPERCASE!# lslpp -R ALL -la "mqm.*"+-----------------------------------------------------------------------------+INSTALL ROOT PATH = /+-----------------------------------------------------------------------------+lslpp: 0504-132 Fileset mqm.* not installed.If there are no USILs, then this is the command.In this case, no MQ filesets are installed.# lslpp -la "mqm.*"lslpp: 0504-132 Fileset mqm.* not installed.b) Listing the file sets from the default location /usr/mqm# lslpp -la "mqm*"Fileset Level State Description----------------------------------------------------------------------------Path: /usr/lib/objreposmqm.amqp.rte 9.0.0.1 COMMITTED IBM MQ AMQP Service9.0.0.11 APPLIED IBM MQ AMQP Servicemqm.ams.rte 9.0.0.1 COMMITTED IBM MQ Advanced MessageSecurity9.0.0.11 APPLIED IBM MQ Advanced MessageSecurityc) Listing the file sets for the USIL# lslpp -R /usr/mqm92 -la "mqm*"Fileset Level State Description----------------------------------------------------------------------------Path: /usr/mqm92/usr/lib/objreposmqm.amqp.rte 9.2.0.0 COMMITTED IBM MQ AMQP Servicemqm.ams.rte 9.2.0.0 COMMITTED IBM MQ Advanced - AdvancedMessage Securitymqm.base.runtime 9.2.0.0 COMMITTED IBM MQ Runtime for Client andServerServer+++ References+++ AIX 7.1 documentationhttps:///support/knowledgecenter/en/ssw_aix_71/m_commands/mkusil.htmlAIX 7.1 / Commands / m /mkusil Command.Creates or attaches a new user-specified installation location (USIL) instance.Syntaxmkusil -R RelocatePath -c Comments [-XFa]DescriptionThe mkusil command creates or attaches a new USIL instance.A user-specified installation location (USIL) is a tracked, relocated installation path that is created by the administrator. The location is tracked by the system and can be used as an alternate installation path for packages that use relocation of file sets or software. Multiple instances or versions of the same software package can be installed on a single system by delegating each installation to a separate USIL.An existing USIL instance can be attached or detached from any given system.Each USIL instance maintains its own set of Software Vital Product Data (SWVPD) in three installp parts:InstallRoot/etc/objreposInstallRoot/usr/lib/objreposInstallRoot/usr/share/lib/objrepos++ Information about the flags for the AIX command: installpThe flags for installp mentioned in the online manual for MQ indicate to apply, commit, expand file system, agree with license, using the .toc (table of contents) file and filesets in the current directory:installp -acgXYd . allhttps:///support/knowledgecenter/en/ssw_aix_72/i_commands/installp.htm lAIX 7.2 / Commands / i /installp CommandPurposeInstalls available software products in a compatible installation package.Flags:-R path Indicates a user-specified installation location.-a Applies one or more software products or updates. This is the default action. This flag can be used with the -c flag to apply and commit a software product update when installed.-c Commits all specified updates that are currently applied but not committed. When an update is committed all other software products it is dependent on must also be committed (unless they are already in the committed state). The specified software product is dependent on any software product that is a prerequisite or corequisite of the specified product. If the requisite software products are not in the committed state, the commit fails and error messages are displayed. The -g flag can be used to automatically commit requisite software product updates.-g When used to install or commit, this flag automatically installs or commits, respectively, any software products or updates that are requisites of the specified software product. When used to remove or reject software, this flag automatically removes or rejects dependents of the specified software.-X Attempts to expand any file systems where there is insufficient space to do the installation. This option expands file systems based on current available space and size estimates that are provided by the software product package. Note that it is possible to exhaust available disk space during an installation even if the -X flag is specified, especially if other files are being created or expanded in the same file systems during an installation. Also note that any remote file systems cannot be expanded.-Y Agrees to required software license agreements for software to be installed. This flag is only valid with the -a flag.-d Device Specifies where the installation media can be found.Notice that "d ." means: current directory-r Rejects all specified software updates that are currently applied but not committed. When a software update is rejected any other software product that is dependent on it (that is, those software products that have the specified software product as a requisite) must also be rejected. The -g flag can be used to reject automatically dependent software updates.-u Removes the specified software product and any of its installed updates from the system. The product can be in either the committed or broken state.https:///support/knowledgecenter/ssw_aix_72/l_commands/lslpp.htmlAIX 7.2 /lslpp Command-R { path | ALL } Indicates a user-specified installation location.-a Displays all the information about filesets specified when combined with other flags. This flag shows all updates when combined with the -l flag and all history when combined with the -h flag.-l (lowercase L) Displays the name, most recent level, state, and description of the specified fileset.++ MQ Documentationhttps:///support/knowledgecenter/SSFKSJ_9.2.0/com.ibm.mq.ins.doc/q008600_.htm IBM MQ 9.2.x / Installing and uninstalling IBM MQ / Installing and uninstalling IBM MQ on AIX /Installing IBM MQ server on AIX.You must install the second version of the product in a location that is not the default. To create the non-default installation location you must use the mkusil command, which is available only from the command line..Install the whole product in a non-default location using the -R flag:installp -R USIL_Directory -acgXYd . allhttps:///support/knowledgecenter/SSFKSJ_9.2.0/com.ibm.mq.mig.doc/q008 010_.htmlIBM MQ 9.2.x / IBM MQ / Maintaining and migrating / Applying maintenance to IBM MQ / Applying and removing maintenance on UNIX and Linux /Applying maintenance level updates on AIX (Installation of Fix Packs)*** Note: The components will be either COMMITTED or APPLIED depending on the options chosen when applying the fix pack.https:///support/knowledgecenter/SSFKSJ_9.2.0/com.ibm.mq.mig.doc/q008 020_.htmlIBM MQ 9.2.x / IBM MQ / Maintaining and migrating / Applying maintenance to IBM MQ / Applying and removing maintenance on AIX and Linux /Reverting to the previous maintenance level on AIXT o back out ALL maintenance updates, as the user root, issue the command:installp [ -R usil ] -r "mqm*"https:///support/knowledgecenter/SSFKSJ_9.2.0/com.ibm.mq.ins.doc/q0094 20_.htmlIBM MQ 9.2.x / IBM MQ / Installing and uninstalling / Installing and uninstalling IBM MQ on AIX /Uninstalling or modifying IBM MQ on AIXT o uninstall an installation in the default location /usr/mqm:installp -u mqm+++ end。

IBM-AIX命令详解

IBM-AIX命令详解

IBM-AIX命令详解AIX常用命令AIX系统的设备有四种状态:Undefined(未定义):表示系统无法识别该设备,也就是系统找不到该设备。

Defined(定义):表示系统可以识别设备,但是系统不能使用它。

Available(可用):表示该设备在系统中可以使用,用户也可以使用。

Stopped(停用):表示设备不能被使用,但操作系统通过驱动程序可以识别它。

-------------------------------------------------------------------------------一、查看错误记录1、显示错误:errpt2、显示详细的错误信息:errpt -a 或errpt -a|more3、清空错误记录信息:errclear 0二、查看文件系统df -g 【以G为单位检查】或df -k 【以K为单位检查】三、查看系统中的设备及其特征lsdev -C显示的设备都已经安装在系统中。

lsdev -P显示系统预定义设备数据库中的所有设备,即系统能支持的设备。

【举例】1、查看硬盘: lsdev –Cc disk2、看磁带机: lsdev –Cc tape3、查看适配卡: lsdev –Cc adapter4、处理器个数:lsdev –C|grep proc【grep:强大的文本搜索工具,并把匹配的行打印出来(类似于find)】5、查看预定义设备对象类中的所有设备,并具有列头:lsdev -P -H6、要列出预定义设备对象类中的受支持的设备类,输入:lsdev -P -r class7、要列出其名称以字母‘hdi’开头的所有设备:lsdev -l hdi*8、要列出所有子pci0 总线,请输入:lsdev -p pci09、要列出其名称包含在文件/tmp/f 中的设备,输入:cat /tmp/f | lsdev -l -四、显示系统的配置信息、诊断信息和重要产品数据(VPD)信息lscfg -vp获取所有已配置硬件设备的详细信息【举例】1、查看硬盘信息: lscfg –vl hdiskx x表示数字2、查看网卡信息: lscfg –vl entx x表示数字3、查看磁带机: lscfg –vl rmtx x表示数字4、要在每一行显示带有设备描述的系统配置:lscfg -s5、要显示由逻辑名ent0 指定的特定设备的VPD:lscfg -v -l ent06、要显示不带有VPD 的逻辑名hdisk(或proc)所指定设备的名称、位置和描述:lscfg -l hdisk(或proc)\*7、要将开放固件设备树中相应节点的VPD 显示到ent0 设备中:lscfg -vp -l ent0五、查看硬件属性lsattr:用于读取指定设备的配置属性,部分属性可更改lsattr –El获取已配置设备的属性信息。

IBM-AIX系统常用命令

IBM-AIX系统常用命令

IBM-AIX系统常用命令原文引自:/luckyrobbie/archive/2006/03/27/37543.htmlAix的系统备份命令是mksysb, make system backup ,有点类似ghost.Aix5.3支持微分区技术,所谓微分区就是1台机器上装多个OS(操作系统),把这台机器上的cpu资源进行划分,然后分配给每一个os使用,最小粒度是0.1个cpu.有点类似vmware软件.让一个机器跑多个操作系统.这项技术早在ibm的大机上就已经实现了.只不过最近才在小机和pc机器上发布.TIVOLI是系统管理软件.关闭aix的命令:shutdown ->正常关机,关闭所有服务. halt -> 相当于直接关闭电源.重启aix:shutdown -Fr查看出错信息:errpt errpt -a | more -> 分页显示errpt -a > /tmp/err01 输出到文件.清除错误信息:errclear 0smit 用鼠标操作 smitty 用键盘来操作,一般用smitty为好.ping -f 全速ping ,利用所有的服务器资源来ping,如果是多个服务器ping一个ip,可以把机器ping死.几个关于磁盘的名词:lv: logical volume 逻辑卷pv: physical volume 物理卷vg: volume group 卷组pp: physical partition 物理分区lp: logical partition 逻辑分区pv对应的是物理硬盘或者是磁盘阵列上划分的lun,一个vg最多可以有1016个pp.pv的上面是vg,一个vg可以包含多个pv.vg的上面是lv,lv如果不作任何处理就是裸设备,也可以作成文件系统.lv被分为多个lp,默认情况下,lp与pp是一一对应的,也可以做成一对多的.这样就相当于用多个pp来作raid0备份.lsdev -C | grep disk 可以查看物理磁盘的硬件信息lspv 查看pv的信息 -p hdisk0 查看具体数据存放的位置:例如,数据在第m到n个pp上面.lsvg 查看vg的信息 -l vg的列表 -c 被使用的vg -l rootvg 查看rootvg的详情.lslv -m lv1 查看lv1 的lp与pp的映射.getlvcv -AT lv1 看到lv1的控制信息.fsck -y /dev/newlv 检查lv.smit vg 可以管理vgsmit lv 管理lvvarryonvg rootvg 激活rootvg卷组,varryoffvg newvg 使newvg卷组脱机.nbpi:number of bytes per inode 每个i节点拥有的字节数,这个参数越小,文件系统的可用的inode越多.如果inode用完,即使有剩余空间,系统也会报空间不够.此时要调小nbpi的值.一般是4k df -k 中iused 指的是i节点的使用情况.设置从cd启动,bootlist -m normal cd0启动时按ESC+1或者F1,可以进入启动菜单.选择启动方式.用smitty crfs 创建完文件系统以后还要mount./etc/filesystems 文件记录文件系统的信息.如想把某个lv映射到不同的文件系统路径上面,可以直接修改这个文件.用logform /dev/testloglv 将lv格式化成jfs的log的格式.file 文件名可以看某个文件的信息,包括文件类型,可执行文件,文本文件,等等.uname -a 可以看到os的信息.fsck 检查文件系统的信息,在umount的时候是准确的, 相当于windows的磁盘扫描.碎片整理 smitty jfslsfs /root 显示文件系统的属性各个组件的关系:lsps -a 查看page space的使用情况vgda:vg description area 每个vg的头部存放vg的描述信息, 如果包含2个pv,那么第一个pv会在头部和另一个位置存放2个vgda,第2个pv也会存放一个.如果包含3个pv,那么每个pv上都有1个vgda.vg的信息在odm中也会存储,但必须和vgda中的信息一致,否则无法varryonvg,有下面4个命令来管理odm中的vg信息.importvg:从vgda中读取信息到odm中exportvg:从odm中删除vg信息varyonvg:激活(online)vgvaryoffvg:卸载(offline)vg修改vg的factor,这样可以将vg的max pp 从默认的1016 增大1倍,到2032,但由于vgda的总大小不变,这些信息都是记录到里面的.所以vg的最大文件数要减小1倍,实际上是个等式:max pp * max file = 固定的一个值,factor增大,实际上是max pp * factor,max file / factor.具体做法:chvg -t 2 rootvg 修改factor为2.vgda 用cfgmgr,来刷新,来认出新assign的hdisk.cfgmgr -v 检查新设备,新硬件.-i /dev/cd0 从光盘自动安装新硬件驱动.当作双机时,2个服务器server1 和server2 来连接同一个盘阵,server1对磁盘分配一个pvid,当第一次切换到server2时,要用ckdev命令来读出server1配置的pvid.系统是通过pvid来识别pv的.ckdev -l hdisk1 -a pv = clear 清除pvidckdev -l hdisk1 -a pv = yes 新置pvidlsdev 查看物理设备lsdev -C 显示所有设备状态rmdev -l cd0 逻辑删除 cd0mkdev -l cd0 安装cd0rmdev -d -l cd0 删除cd0设备驱动查看cpu的信息lsattr -El proc0lsdev -C | grep proc查看内存的信息lsattr -El mem0查看光驱的信息lsattr -El cd0查看硬盘的信息lsattr -El hdisk0lscfg -vp | more 分页看全部硬件信息prtconf | more 列出硬件信息查看谁在使用cdrom fuser /cdrom -k 直接杀掉用户进程telnet的登陆信息存放在/etc/motd文件中.想查看最近有谁登陆,用last命令.查看登录失败的信息: /etc/security/failedlogin存放用户密码的文件:/etc/security/passwd用户登录需要运行的脚本:1 /etc/profile2 /etc/environment 在这个文件中设置中文环境,LANG=zh_CN3 用户profile ,分2种情况:如果是命令行登录,则运行/home/user/.profile如果是图形登录,则运行/home/user/.dtprofile 需要将次文件中,#DTSOURCEPROFILE=TRUE 的# 去掉,否则还是使用.profile.在/dev下面有2种设备,一种是block设备,一种是char(字符)设备.这取决于不同的应用.vmstat的某些行的解释:vmstat->faults->cs: user calls 用户调用的次数cpu->wa: >40 说明io繁忙kthr: kernel threadkthr->r 在运行队列中等待执行的进程b 正在等待io的进程memory->avm:active vitual memory 物理内存+使用的虚拟内存,以4k为单位.page->re:是pin 和 pout 的总和.sr:search的内存块数.fr:释放的内存块数.每次作page out时,系统要搜索物理内存以找到可以释放的块,sr 和fr分别代表搜索的和通过搜索找到的可以释放的块数.如果2者很接近,说明内存中有很多用于file cache,内存的数量是够用的.如果fr/sr的值很小,说明内存不够.tty:代表终端iostat:%tm_act 实际transaction的百分比tps 每秒发生的次数kbps 每秒的速率名词:thrasing: 应用程序频繁交换,导致paging过多./usr/samples/kernel/vmtune -f 120 -F 128-f 120 代表minfree mem < 120 时要进行page out-F 128 代表maxfree mem > 128 时要进行page in-p -P 也跟page out 有关,具体不清楚,还需明确.sar->avque:平均的请求数对文件系统作监视:filemonfilemon -o /tmp/a.txt -O all -v运行之后系统会一直监视文件系统的使用情况并记录日志,-T 64000 是使用的buffer cache,在大型系统上,这个值可以调大.运行一段时间后,要停掉filemon,使用trcstop 或者 kill -9 进程.从a.txt中可以看到使用最频繁的文件等信息,有些类似statspack 的报告.对于后缀是Z的文件用uncompress来解压缩. uncompress a.tar.Z用strings 命令来看2进制文件如何调大page space,直接设置对应lv的大小.如果对应lv的vg 空间不够的话,可以向vg中加硬盘.dd的用法:dd if=/dev/rnewfs of=/dev/rcopyfs bs=1024 count=10240bs: block size 块大小,1024字节count: block count 块的数量if是input file ,of 是output file将任务切换到后台执行: ctrl+z ,然后 bg+回车查看后台执行的程序:jobs把后台执行的程序切换到前台执行:fg %n n是后台的job 编号ip抓包工具:iptrace 和 tcpdumpiptrace -a a.out停止iptrace:kill -9tcpdump -i en1 -w a.out a.out 是输出文件把进程与cpu绑定:bindprocessor -U 进程号 cpuidbindprocessor -U 12345 0odm库:env | grep objODMDIR=/etc/objrepos 这是odm库的存储路径在disk0上生成引导区bosboot -a -d /dev/hdisk0用kdb 查看os 的 dumpethernet channel 把2个网卡绑定到1个ip,可以作网络负载均衡.crontab 设置定时任务crontab -l list the crontabcrontab -e edit the crontabcrontab的格式:分钟小时月中的天数月份星期命令minute:0 到 59hour:0 到 23day_of_month:1 到 31month:1 到 12weekday:星期日到星期六的 0 到 6 时要在每星期日上午 2 时运行 fwlogmgmt 命令,请将下列各行添加至 crontab 文件底部:0 2 * * 0 /usr/bin/fwlogmgmt -1发送邮件,aix和redhad linux 都默认安装了smtp邮件服务,可以直接给internet发邮件.mail -s "test mail" *************************<$ORACLE_BASE/admin/$ORACLE_SID/bdump/alert$ORACLE_SI D.logmail-s"testmail"*************************<<EOF******** MAIL CONTENT *******FJLADSFJLAKHFGALFJALDSKFJAFASLJFLASF*****************************EOF有了crontab和mail,就可以定时监控数据库,然后把报告发送邮件到管理员的信箱.kill -9 9 是kill命令传送的一个信号,一共15个信号可以发送./etc/ftpusers 限制登录ftp的用户,谁在这个文件里面,谁就登不进去.网络服务 /etc/inetd.conf 刷新 refresh src -dlslpp -l | grep http 查看安装的软件检查瓶颈:利用vmstat iostat 查看总体情况,ps aux 可以看到具体进程占用资源的情况.如果是io瓶颈,可以利用filemon -o /tmp/a.txt -O all; sleep 10;trcstop 来查看io资源的使用情况.辨别僵尸进程:ps -ef pid 那列是 defunc的为僵尸进程.。

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

IBM pSeries服务器AIX系统的常用命令1.如何移动与重命名文件?要将文件和目录从一个目录移动到另一个目录,或重命名一个文件或目录,使用mv 命令。

如果将一个文件或目录移动到新的目录而不指定新的名字,则其保留原来的名字。

注意: 如果不指定-i 标志,mv 命令可能会覆盖许多已存在的文件。

-i 标志会在覆盖文件之前提示确认。

而-f 标志则不会提示确认。

如果一起指定了-f 和-i 两个标志,则后一个指定的标志优先。

以下是如何使用mv 命令的示例:1.要将文件移动到另一个目录并给它一个新名字,请输入:# mv intro manual/chap1按下Enter 键。

该命令将intro 文件移动到manual/chap1 目录。

名字intro 从当前目录被除去,同样的文件在manual 目录中以chap1 的名字出现。

2.要将文件移动到另一个目录,且不改变名字,请输入:# mv chap3 manual按下Enter 键。

该命令将chap3 移动到manual/chap3。

用mv 命令重命名文件可以使用mv 命令改变文件的名字而不将其移动到另一目录。

3.要重命名文件,请输入:# mv appendix apndx.a按下Enter 键。

该命令将appendix 文件重命名为apndx.a。

如果名为apndx.a 的文件已存在,则旧的内容被appendix 文件的内容替换。

2.如何在系统中移动或者重命名目录?如果需要移动或者重命名目录,可以在系统中使用mvdir 命令。

例如,如果需要移动目录,可以在命令行中输入下面的命令:# mvdir book manual然后按下Enter(回车)键。

如果manual 目录在系统中已经存在,则上面的命令会将book 目录移动到名为manual 的目录下面。

否则,book 目录会被重新命名为manual。

例如,如果需要移动和重命名目录,请在命令行中输入下面的命令:# mvdir book3 proj4/manual然后按下Enter(回车)键。

上面的命令会将book3 目录移动到名为proj4 的目录下面,并且会将proj4 目录重新命名为manual(如果manual 目录事先在系统中不存在)。

3.如何删除目录?可以使用rmdir 命令将以Directory 参数指定的目录从系统中除去。

在除去目录之前,目录必须为空(只能包含 . 和 ..),您在将其除去前必须对其父目录拥有写权限。

使用ls -a Directory 命令检查目录是否为空。

以下是如何使用rmdir 命令的示例:1.要清空并除去目录,请输入:# rm mydir/* mydir/.*# rmdir mydir按下Enter 键。

该命令除去mydir 的内容,然后除去空目录。

rm 命令显示有关试图除去目录圆点(.) 和双圆点(..) 的出错信息,然后rmdir 命令将它们和目录本身除去。

注:rm mydir/* mydir/.* 首先除去名字不以圆点开头的文件,然后除去那些名字以圆点开头的文件。

您可能无法认识到目录包含名字以圆点开头的文件,s 命令通常不显示因为如果不使用-a 标志,l它们。

2.要除去/tmp/jones/demo/mydir 目录及其下面所有的目录,请输入:# cd /tmp# rmdir -p jones/demo/mydir按下Enter 键。

该命令将jones/demo/mydir 目录从/tmp 目录中除去。

要删除目录时,如果目录非空,或者您对其没有写权限,则命令以适当的出错消息终止。

4.如何删除文件?当用户不再需要某个文件时,可以使用rm 命令将其除去。

rm 命令除去某个特定文件、一组文件或目录内从文件列表中选中的某些文件条目。

使用rm 命令时,在除去文件之前无需用户确认、读权限和写权限。

然而,用户必须对包含该文件的目录具有写权限。

以下是如何使用rm 命令删除文件的示例:1.要删除名为myfile 的文件,请输入下面的命令:# rm myfile按下Enter(回车)键。

2.要依次删除mydir 目录中的所有文件,请输入下面的命令:# rm -i mydir/*按下Enter(回车)键。

在每个文件名显示时,输入y 并按下Enter(回车)键以删除文件。

或者仅按下Enter 键以保留文件。

5.如何为文本文件排序?可以使用sort 命令将File 参数指定的文件中的行按字母顺序或其它方式排序,并将结果写到标准输出。

如果File 参数指定了多于一个的文件,则sort 命令将这些文件连接起来,并将它们像一个文件那样按字母顺序排序。

注:sort 命令区分大小写并规定大写字母在小写字母之前(这取决于语言环境)。

下例中,名为names 的文件的内容为:martadenisejoyceendricamelanie名为states 的文件的内容为:texascoloradoohio1.要显示names 文件排序后的内容,请输入:# sort names按下Enter 键。

系统显示与以下类似的信息:deniseendricajoycemartamelanie2.要显示names 和states 文件排序后的内容,请输入:# sort names states按下Enter 键。

系统显示与以下类似的信息:coloradodeniseendricajoycemartamelanieohiotexas3.要以names 文件排序后的内容替代原先的内容,请输入:# sort -o names names按下Enter 键。

该命令以相同但排过序的数据替换names 文件的内容。

【IT168 服务器学院】AIX的命令格式:$command option(s) argument(s)command:命令option(s):命令选项,均以''-''号开始argument(s):参数命令用途------------------------------------------------------- prtconf 显示系统的各项主要配置svmon -G 查看内存(4k)iostat 2 查看磁盘读写情况(每2秒刷新);set -o vi 调用缓冲区 k,j,x,h,l 向上下翻,Escsmit 进入管理界面cd 改变路径ls 列出文件ls -aF 列出隐含文件,并适当分类ls -l 列出文件的详细信息ls -ltrmore 输出文件内容到屏幕cat 显示文本文件内容/合并文件pg 分页显示文件内容,回车后下一页file 显示文件属性(可执行/ASCII/等)clear 清屏mkdir 创建目录rmdir 删除目录cp 拷贝文件mv 文件/目录改名,转移rm 删除文件/目录, 如:rm -fr ora*rmdir 删除目录,如: rmdir oracledf -k 显示文件系统的信息du 磁盘使用信息汇总mount 显示已经挂装的文件系统的信息或挂装文件系统 mount -rv cdrfs /dev/cd0 /cdrom mount /dev/lv02 /u01umount 卸载某个文件系统 umount /cdromfuser -kxuc /dev/cd0 当光驱不能正常释放时lsattr -E -l sys0 -a realmem 察看内存的命令env 输出用户环境变量到屏幕id 察看用户的属性whoami 察看当前用户名who 查看已经登录的用户who -r 查看目前系统的运行级别users 用单独的一行打印出当前登录的用户,每个显示的用户名对应一个登录会话如果一个用户有不止一个登录会话,那他的用户名将显示相同的次数w 显示当前系统中每个用户和它所运行的进程信息last 此命令往回搜索wtmp来显示自从文件第一次创建以来登录过的用户whereis 命令的绝对路径passwd 设置用户密码su 改变/切换用户idlsuser ALL 列出所有已经创建的用户lsgroup ALL 列出所有已经创建的组smitty user 管理用户mkuser 创建新用户,创建用户的缺省属性值于文件:/usr/lib/security/mkuser.default,只能由root修改smitty group 管理组mkgroup 创建新组chfn 改变用户详细信息jobs 查看后台任务/进程fg 把后台进程调到前台bg 把当前进程调到后台运行grep 查找匹配字符/字符串netstat -i 显示网络连接信息及统计信息netstat -INnetstat -rn 显示核心路由表netstat -I 网络设置名端口号监视端口情况netstat -v 正在使用的设备驱动程序的统计信息netstat -m 网络使用的内存空间情况netstat -D 显示丢弃包的情况ifconfig -a 显示网络配置信息umask 显示文件创建掩码,即新建文件或目录的缺省权限,如#umask 664 date 系统时间find path expression 查找文件,expression的值有:-name/-type/-size/-mtime(修改时间)/-perm(权限)/-usr/-o(或)uname 显示操作系统信息oslevel 系统版本man 帮助文件smitty clstart | clstop 起用|关闭HAsmitty hamcpsmitty chinet 改变网卡的配置信息smitty cluster 配置clustersmitty hacmp 配置hacmp/usr/sbin/cluster/clstat & 显示cluster信息dbassist 启动oracle数据库配置助手(dbca -9i 可以用配置数据库方式启动一个数据库)netasst 启动oracle数据库listener配置助手(-9i oemapp是一个包,后跟参数,不同工具)vi 文件编辑器动作字符:a 在当前字符后添加文字; x 删除单个字符;A 在当前行最后添加文字; dw 删除至当前词尾;i 在当前字符前添加文字; d$ 删除至当前行尾;I 在当前行开始处添加文字; d0 删除至当前行首;o 在当前行后添加新行; dd 删除当前行;O 在当前行前添加新行; :20,40d 删除20行至40行;/text 向后查询 ?text 向前查询r 修改当前字符 R 覆盖字符,直至按下[ESC]s 删除当前字符,并可添加字符直至按[ESC]S 删除当前行,并可添加字符直至按[ESC]yy 将当前行存入缓冲区ddpPerrpt|pg 创建/显示错误文件errclear 0 清除错误日志文件内容lsvg -o 显示卷组信息lsvg -l rootvginstfix -iv|grep AIX_ML 安装的文件集smitty tcpip tcp/ip配置lsdev -Cc disk 系统设备信息(磁盘)lspv 显示卷组里的物理卷信息lsdev -Cc pdisk 显示阵列里的磁盘信息errclear 清除error loglsps -a 显示交换空间swapon /dev/paging01 激活交换空间chps -a paging01 删除交换空间rmps paging01 删除不活动的交换空间smit mkps 增加交换空间smit chps 修改交换空间varyonvg 激活卷组如:varyonvg datavg 将datavg激活varyoffvg 关闭卷组/ect/services 查看端口/etc/hosts 机器名IP对照表/etc/inittab 相当于DOS的AUTOEXEC.BAT文件/etc/filesystems 记录所有的文件系统设置增加并配置端口删除端口ftp://root@10.188.12.250/ 在客户端登录AIX(用IE)lscfglsdevroute ADD 0 10.188.12.1route add default 192.168.0.1 设置网关(或在/etc/defaultrouter文件中加入网关地址,重起机器就行)su root 以ROOT用户登录;smitty lv 增加逻辑盘LN -s 源目录目标目录链接ls -l 查看权限./fielname 运行filename文件smitty clstart 启动HAsmitty clstop 停止HA.filename 表示filename文件(目录)为隐藏;cat file1 >> file2 合并file1到file2SMIT 综合管理工具# 表示ROOT用户;$ 表示一般用户;shutdown -fr 快速重启;smitty crjfs 创建结点; mount /u05 chown -R oracle.dbs u05 chmod -R 777 u05加一个文件系统的步骤: 加文件系统/chmod/chown/mount 文件系统名smitty jfssmitty lvsmitty lvm 管理逻辑卷smitty vg 管理卷组smitty chvgdrwxrwxrwx d表示目录,-表示普通文件,r表示链接; d421421421 777全部权限-rwxrwxrwx 第2-4:属主用户,5-7:同组用户,8-10所有用户date 021******* This sets the date and time to Sat Feb 17 14:25:00 CST 1990.当root不能在其终端上登录时修改/etc/hosts文件,查看其IP地址对应的主机名;当其他用户不能在其终端上登录时删除用户,并删除/home下对应的目录,重建;smitty aio 调整aioservers#pstat -a|grep aios|wc -l 查看aio的值是否常达到MAX,IF 增加MIN, MAX aio;当任何用户都不能登录图形界面时有可能根结点充满,在登录窗口用字符方式登录,加大根结点空间即可;ps -ef | grep cluster 查找包含"cluster"的进程more /etc/passwd|grep zhxx 查找静态字符"zhxx"ps -f 进程查看,如:# ps -fUID PID PPID C STIME TTY TIME CMDroot 43626 45014 0 20:38:58 pts/1 0:00 -kshroot 47710 43626 2 21:08:03 pts/1 0:00 ps -f用户ID 进程ID 父进程ID CPU利用率开始时间控制台运行时间命令kill -9 **** ***为进程号,可用ps获得ping 10.188.12.252 -l 17000 -t 以17000 bytes/包 ping 目标crontab 创建计划任务(crontab -l 查看已有任务, crontab -e 编辑或增加,删除任务)0 2 * * * /u05/dmpbak/auto.sh 表示:每天两点执行/u05/dmpbak/auto.sh 文件lsfs 列出所有文件系统lsvg -l rootvg 列出rootvg的卷lsvg -p rootvg 列出物理卷信息lsvg datavg 可查询空闲物理分区数smit reogvg 重组卷组smit importvg 导出卷组,卷组必须是不活动的;lspv hdisk0 显示物理卷lspv -l hdisk0 逻辑卷映射lspv -p hdisk0 物理卷映射defragfs -q /u01 报告文件系统的当前状态defragfs -r /u01 得到碎片连续化操作后和前后对比情况defragfs /u01 执行碎片连续化操作fsck /u05 检查u05文件系统xclock 时钟,可用于检查环境是否正常chmod 777 /u02r 2=3 相当于:chmod 777 /u03rsh zzyc2_sev 在其他机器上登录某主机dgmgrl 类似SVRMGRL(9i)ps -ef |grep oracle |pg 查看oracle用户的所有进程kill -9 14206 杀14206#进程kill -l 显示KILL命令可以用的信号量killall signal 删除除发送外的其他所有进程/usr/sbin/cluster/clstat & 显示双机热备状态图exit或logout 退出登录qprt filename1,filename2... 打印文件qchk 查看打印队列qcan 取消打印作业lsps -a 查询交换空间,如USE超过70%,则要增加set 查看已定义的变量;echo $name 查看某个变量的值;xxx=value 定义变量unset xxx 删除变量``把``之间的内容作为一个命令,返回命令结果; 如$now=`date`$echo $now'''' 直接显示''''间的内容,不予解释;"" 解释""间的$,``,等字符的特殊含义;忽略后的特殊字符的特殊含义;$$ 表示当前进程的ID$0 当前shell程序的名称$# 传给当前shell Script的参数个数;$* 传给当前shell Script的第*个参数,$1-$9,${10}......$? 最近一个命令的返回值;$! 最近一个后台进程的ID号;expr shell下的四则运算:* 乘;/除; % 求余数; +,- 如:expr (3+3)*(4-2)command1 && command2 如果第一个命令执行成功,则运行第二个命令;command1 || command2 如果第一个命令执行失败,则运行第二个命令;test 表达式测试条件表达式,主要有:-f filename 文件是否存在;-d dirctory 目录是否存在;-r filename 文件存在,且能被当前进程读;-w filename 文件存在,且能被当前进程写;-x filename 文件存在,且能被当前进程运行;-n string 字符STRING长度非零;-z string 字符STRING长度零;string1=string2 两个字符串相同;integer1 -eq integer2 两个变量相等;(ne:不等 gt:大于 lt:小于 le:小于等于 ge:大于等于)if ..then ..else...firead xxx 从标准输入读入一行,赋给xxx变量; read x echo $xfor i in ....do...donewhile expressiondo...doneksh scriptnamescriptnamepathname/scriptname shell script的三种执行方法#command 前台进程#command & 后台进程nice/renice 增加/再增加nice的值,从而降低进程优先级;nohup command & 使用户的后台进程在用户退出时仍然运行#alias alias=string 赋命令别名unalias aliasname 取消命令别名history 显示最后的16条命令cal 2003/cal 2 2003 日历finger [oracle] 显示用户信息mail 接收,发出,查看电子邮件clear 清屏echo 显示指定信息wc filename 统计指定文件的行数,词数,字节数head filename 显示文件头tail filename 显示文件尾tail -f /tmp/hacmp.out 显示HACMP启动情况[^+C]/[^+d]/[^+s]/[^+q]/[^+u] 终止/结束文件传输/暂停屏幕输出/继续屏幕输出/删除当前输入行smit(system management interface Tool)其log文件/script文件保存在各用户目录下;alog -o -t boot 查看引导日志chtz 设置新时区/etc/profile/etc/environment$HOME/.profile 系统设置用户环境的主要文件;lsuser -a id home ALL 列出所有用户/etc/motd 用户登录时显示的信息,可直接编辑,但如果用户主目录下$HOME/.hushlogin存在,motd不显示;wall ***** 向各登录用户发出*****消息,用户终端上将马上显示;/var/adm/sulog su命令执行记录/var/adm/wtmp,/etc/utmp 用who命令查看登录记录last root |pg root用户登录记录last reboot | pg 重启记录;/etc/passwd 合法用户(不含密码)/etc/group/etc/security 普通用户不能访问的安全性文件目录lsdev -P 列出所有的设备, lsdev -Pc disksmitty devices 设备管理lsattr -E -l sys0 列出已配置的设备jfs/Cdrfs/Nfs AIX支持的三种文件系统/var/adm/wtmp/var/spool/*/*/smit.log/etc/securibty/failedlogin/var/adm/sulog 这些文件增长很快,要定期清理,可用cat /dev/null > filename方式清理du /u05 | sort -r -n 查询文件或目录所占用的磁盘块数vmstat 显示虚拟内存,内存及CPU活动信息;arp -a 查看解析协议ARP表hostname 显示机器名/etc/rc.tcpip 系统启动时自动执行,进而执行以下子进程:-syslogd :错误信息日志-portmap :端口查找-inetd :Internet服务的主守护进程-named :域名服务器-lpd :打印服务器-routed or gated :动态路由-sendmail :邮件系统-timed :时间服务器-rwhod :远程用户信息-snmpd :SNMP代理进程host 机器名/IP 实现IP与机器名的转换rsh PTYC2_svc date 执行另一台主机上的命令lscfg 显示机器配置信息lsdev -C -c if 显示网络接口描述lsdev -C -c adapetr 显示适配描述netpmon -v 物理/逻辑资源的详细报告ps aux 查询内存使用情况sar [-u|-c|-a|-q|-r] [-p] 1 10 查询系统负载情况traceroute 10.188.182.1 跟踪IPnetpmon 可以监控关于网络行为的系统事件和性能以及网络行为对CPU的消耗。

相关文档
最新文档