AIX 常用命令

  • 格式:pdf
  • 大小:167.00 KB
  • 文档页数:18

AIX 常用命令

官网上的介绍:

AIX 常用命令汇总 我们先SSH 到AIX 系统:

*******************************************************************************

* *

* *

* Welcome to AIX Version 5.3! *

* *

* *

* Please see the README file in /usr/lpp/bos for information pertinent to *

* this release of the AIX Operating System. *

* *

* * *********************************************************************

********** -bash-3.00$

AIX的命令格式: $command option(s) argument(s)

command: 命令 option(s): 命令选项,均以'-'号开始

argument(s): 参数

查看某个命令的使用方法,可以使用man 命令,如: -bash-3.00$ man lsdev

Commands Reference, Volume 3, i - m

lsdev Command Purpose

Displays devices in the system and their characteristics. Syntax

lsdev [ -C ][ -c Class ] [ -s Subclass ] [ -t Type ] [ -f File ] [ -F Format | -r

ColumnName ] [ -h ] [ -H ] [ -l { Name | - } ] [ -p Parent ] [ -S State ]

lsdev -P [ -c Class ] [ -s Subclass ] [ -t Type ] [ -f File ] [ -F Format | -r ColumnName ]

[ -h ] [ -H ] Description

The lsdev command displays information about devices in the Device Configuration database.

You can display information about all devices in the Customized Devices object class using

the -C flag. Any combination of the -c Class, -s Subclass, -t Type, -l Name, -p Parent, and

-S State flags selects a subset of the customized devices. You can display information

about all devices in the Predefined Devices object class using the -P flag. Any combination

of the -c Class, -s Subclass, and -t Type flags selects a subset of the predefined devices.

You can display the default output one of the following ways: * From the Customized Devices object class using the -C flag

* From the Predefined Devices object class using the -P flag To override these two default outputs, use the -F Format flag to

display the output in a format that you specify using the Format parameter. The Format parameter is a quoted list of column names separated and

possibly ended by non-alphanumeric characters or white space. -bash-3.00$

一些常用的系统命令:

clear 清屏 mkdir 创建目录

rmdir 删除目录 cp 拷贝文件

mv 文件/目录改名,转移 rm 删除文件/目录, 如:rm -fr ora*

rmdir 删除目录,如: rmdir oracle df -k 显示文件系统的信息

du 磁盘使用信息汇总 du /u05 | sort -r -n 查询文件或目录所占用的磁盘块数

cd: 改变路径 ls: 列出文件

ls -aF 列出隐含文件,并适当分类 ls -l 列出文件的详细信息

ls -ltr more: 输出文件内容到屏幕

more /etc/passwd|grep zhxx 查找静态字符"zhxx" cat 显示文本文件内容/合并文件, cat file1 >> file2 合并file1到file2

pg 分页显示文件内容,回车后下一页 file 显示文件属性(可执行/ASCII/等)

uname 显示操作系统信息 oslevel 系统版本

man 帮助文件

mount 显示已经挂装的文件系统的信息或挂装文件系统 umount 卸载某个文件系统

fuser -kxuc /dev/cd0 当光驱不能正常释放时

env 输出用户环境变量到屏幕 id 察看用户的属性

whoami 察看当前用户名 who 查看已经登录的用户

who -r 查看目前系统的运行级别 users 用单独的一行打印出当前登录的用户,每个显示的用户名对应一个登录会

话,如果一个用户有不止一个登录会话,那他的用户名将显示相同的次数 w 显示当前系统中每个用户和它所运行的进程信息

/var/adm/wtmp,/etc/utmp 用who命令查看登录记录

last 此命令往回搜索wtmp来显示自从文件第一次创建以来登录过的用户 last root |pg root用户登录记录

last reboot | pg 重启记录;

whereis 命令的绝对路径 passwd 设置用户密码

su 改变/切换用户id lsuser ALL 列出所有已经创建的用户

lsgroup ALL 列出所有已经创建的组 mkuser 创建新用户,创建用户的缺省属性值于文

件:/usr/lib/security/mkuser.default,只能由root修改 mkgroup 创建新组

chfn 改变用户详细信息 jobs 查看后台任务/进程

fg 把后台进程调到前台 bg 把当前进程调到后台运行

grep 查找匹配字符/字符串

fsck /u05 检查u05文件系统 xclock 时钟,可用于检查环境是否正常

rsh zzyc2_sev 在其他机器上登录某主机 dgmgrl 类似SVRMGRL(9i)

/usr/sbin/cluster/clstat & 显示双机热备状态图

qprt filename1,filename2... 打印文件 qchk 查看打印队列

qcan 取消打印作业 set 查看已定义的变量;

echo $name 查看某个变量的值; xxx=value 定义变量

unset xxx 删除变量 ''把''之间的内容作为一个命令,返回命令结果; 如$now='date' $echo $now

'' 直接显示''间的内容,不予解释; "" 解释""间的$,'',等字符的特殊含义;

忽略后的特殊字符的特殊含义; $$ 表示当前进程的ID

$0 当前shell程序的名称 $# 传给当前shell Script的参数个数;

$* 传给当前shell Script的第*个参数,$1-$9,${10}...... $? 最近一个命令的返回值;

$! 最近一个后台进程的ID号;

#command 前台进程 #command & 后台进程

nice/renice 增加/再增加nice的值,从而降低进程优先级; nohup command & 使用户的后台进程在用户退出时仍然运行

alias alias=string 赋命令别名 unalias aliasname 取消命令别名

history 显示最后的16条命令 cal 2003/cal 2 2003 日历

finger [oracle] 显示用户信息 mail 接收,发出,查看电子邮件

wc filename 统计指定文件的行数,词数,字节数 head filename 显示文件头

tail filename 显示文件尾 tail -f /tmp/hacmp.out 显示HACMP启动情况 [^+C]/[^+d]/[^+s]/[^+q]/[^+u] 终止/结束文件传输/暂停屏幕输出/继续屏幕

输出/删除当前输入行 alog -o -t boot 查看引导日志

chtz 设置新时区 /etc/profile

/etc/environment $HOME/.profile 系统设置用户环境的主要文件;

/etc/motd 用户登录时显示的信息,可直接编辑,但如果用户主目录下$HOME/.hushlogin存在,motd不显示;

wall ***** 向各登录用户发出*****消息,用户终端上将马上显示; /var/adm/sulog su命令执行记录

/var/adm/sulog 这些文件增长很快,要定期清理,可用cat /dev/null > filename方式清理

/etc/passwd 合法用户(不含密码)

/etc/group /etc/security 普通用户不能访问的安全性文件目录

AIX支持的三种文件系统:jfs/Cdrfs/Nfs

/var/spool/*/* /smit.log

/etc/securibty/failedlogin hostname 显示机器名

/etc/rc.tcpip 系统启动时自动执行,进而执行以下子进程: