文档库 最新最全的文档下载
当前位置:文档库 › AIX 常用命令及功能一览表

AIX 常用命令及功能一览表

AIX 常用命令及功能一览表
AIX 常用命令及功能一览表

AIX 常用命令及功能一览表

下面是常用的一些命令的语法以及功能描述:

oslevel Returns operating system level

whence (program) Returns full path of program

whereis (program) Returms full path of program

lslpp -L all list all installed software

lslpp -L (program set name) Check if software installed

lslpp -f Lists filesets vs packages

instfix -ik (fix number eg IX66617) Checks id fix is installed

compress -c file.txt > file.Z Create a compressed file.

uuencode (infile) (extract-file-name) > (output file)

Converts a binary file to an ASCII file for transfer by modem or email uudecode (encoded file)

Extracts a binary file from encoded file and calls it the extract-file-name examples :-

uuencode maymap maymap > maymap.enc

uuencode maymap.enc

od -c /tmp Displays contents of the /tmp directory file

ls -i Lists files with their inode numbers

echo * Lists files, can be used if ls is corrupt/missing

alog -o -t boot V iew the boot log

chtz (timezone eg GMT0BST) Changes the timezone in /etc/environment file chlang (language eg En_GB) Changes the language in /etc/environment file ar -v -t /usr/lib/libC-r.a Lists all objects in libC_r.a library

-------------------------------------------------------------------------------- TERMINALS

--------------------------------------------------------------------------------

tty Displays what the tty/pty number of the terminal is.

termdef reports the termtype setup in smit for the tty port

that termdef is run on.

chdev -l (device eg tty1) -a term=vt100 Sets tty to a vt100 terminal type penable tty0 adds getty line into /etc/inittab for tty0 and starts getty pdisable tty0 disables the getty line and disables getty

penable / pdisable -a option is for all

stty erase ^? Set backspace key for vt100 terminals

stty erase ^H Set backspace key for wyse50 terminals

lscons Displays the console device

chcons -a login=enable (device eg /dev/tty1) Changes the console device Create ttys on ports 0 to 7 on adapter sa2 :-

for i in 0 1 2 3 4 5 6 7

do

mkdev -c tty1 -t tty -s rs232 -p sa2 -w$i -a login=enable -a term=vt100

done

-------------------------------------------------------------------------------- NETWORK

--------------------------------------------------------------------------------

host (ip or hostname) Resolves a hostname / ip address

hostname Displays hostname

hostname (hostname) Sets the hostname until next reboot

chdev -l (device name) -a hostname=(hostname) Changes hostname permanently chdev -l inet0 -a hostname=thomas

ifconfig (device name) Displays network card settings

ifconfig (device name) up Turns on network card

ifconfig (device name) down Turns off network card

ifconfig (device name) detach Removes the network card from the

network interface list

ifconfig en0 inet 194.35.52.1 netmask 255.255.255.0 up

ifconfig lo0 alias 195.60.60.1 Create alias ip address for loopback

route (add/delete) (-net/-host) (destination) (gateway)

Adds or deletes routes to other networks or hosts, does not update

the ODM database and will be lost at reboot.

route add -net 194.60.89.0 194.60.90.4

netstat -i Displays interface statistics

entstat -d (ethernet adapter eg en0) Displays ethernet statistics

arp -a Displays ip to mac address table from arp cache

no -a Displays network options use -o to set individual options or

-d to set individual options to default.

no -o option=value (this value is reset at reboot)

no -o "ipforwarding=1"

traceroute (name or ipaddress) Displays all the hops from source to destination supplied.

ping -R (name or ipaddress) Same as traceroute except repeats.

--------------------------------------------------------------------------------

N.F.S.

--------------------------------------------------------------------------------

exportfs Lists all exported filesystems

exportfs -a Exports all fs's in /etc/exports file

exportfs -u (filesystem) Un-exports a filesystem

mknfs Configures and starts NFS services

rmnfs Stops and un-configures NFS services

-------------------------------------------------------------------------------- BACKUPS

--------------------------------------------------------------------------------

MKSYSB

------

mkszfile -f Creates /image.data file (4.x onwards)

mkszfile -X Creates /fs.size file (3.x)

mksysb (device eg /dev/rmt0)

CPIO ARCHIVE

------------

find (filesystem) -print ?cpio -ocv > (filename or device)

eg find ./usr/ -print ?cpio -ocv > /dev/rmt0

CPIO RESTORE

------------

cpio -ict < (filename or device) ?more Lists archive

cpio -icdv < (filename or device)

cpio -icdv < (filename or device) ("files or directories to restore")

eg cpio -icdv < /dev/rmt0 "tcpip/*" Restore directory and contents cpio -icdv < /dev/rmt0 "*resolve.conf" Restore a named file

TAR ARCHIVE

-----------

tar -cvf (filename or device) ("files or directories to archive")

eg tar -cvf /dev/rmt0 "/usr/*"

TAR RESTORE

-----------

tar -tvf (filename or device) Lists archive

tar -xvf (filename or device) Restore all

tar -xvf (filename or device) ("files or directories to restore")

use -p option for restoring with orginal permissions

eg tar -xvf /dev/rmt0 "tcpip" Restore directory and contents

tar -xvf /dev/rmt0 "tcpip/resolve.conf" Restore a named file

AIX ARCHIVE

-----------

find (filesystem) -print ?backup -iqvf (filename or device)

Backup by filename.

eg find /usr/ -print ?backup -iqvf /dev/rmt0

backup -(backup level 0 to 9) -f (filename or device) ("filesystem") Backup by inode.

eg backup -0 -f /dev/rmt0 "/usr" -u option updates /etc/dumpdates file AIX RESTORE

-----------

restore -qTvf (filename or device) Lists archive

restore -qvxf (filename or device) Restores all

restore -qvxf (filename or device) ("files or directories to restore") (use -d for restore directories)

-------------------------------------------------------------------------------- Copying diskettes and tape

-------------------------------------------------------------------------------- COPYING DISKETTES

-----------------

dd if=/dev/fd0 of=(filename) bs=36b

dd if=(filename) of=/dev/fd0 bs=36b conv=sync or flcopy

COPYING TAPES

-------------

dd if=/dev/rmt0 of=(filename)

dd if=(filename) of=/dev/rmt0 or tcopy

--------------------------------------------------------------------------------

VI Commands

--------------------------------------------------------------------------------

:g/xxx/s//yyy/ global change where xxx is to be changed by yyy

sed 's(ctrl v ctrl m)g//g' old.filename > new.filename

Strips out ^M characters from ascii files that have been transferred as binary. To enter crontrol characters type ctrl v then ctrl ? where ? is whatever

ctrl character you need.

-------------------------------------------------------------------------------- DEVICES

--------------------------------------------------------------------------------

lscfg lists all installed devices

lscfg -v lists all installed devices in detail

lscfg -vl (device name) lists device details

bootinfo -T reports type of machine ie rspc

bootinfo -r reports amount of memory (/ by 1024)

bootinfo -s (disk device) reports size of disk drive

mknod (device) c (major no) (minor no) Creates a /dev/ device file.

mknod /dev/null1 c 2 3

lsdev -C lists all customised devices ie installed

lsdev -P lists all pre-defined devices ie supported

lsdev -(C or P) -c (class) -t (type) -s (subtype)

chdev -l (device) -a (attribute)=(new value) Change a device attribute chdev -l sys0 -a maxuproc=80

lsattr -EH -l (device) -D Lists the defaults in the pre-defined db

lsattr -EH -l sys0 -a modelname

rmdev -l (device) Change device state from available to defined

rmdev -l (device) -d Delete the device

rmdev -l (device) -SR S stops device, R unconfigures child devices lsresource -l (device) Displays bus resource attributes of a device.

Power Management (PCI machines)

-------------------------------

pmctrl -a Displays the Power Management state

rmdev -l pmc0 Unconfigure Power Management

mkdev -l pmc0 Configuter Power Management

--------------------------------------------------------------------------------

TAPE DRIVES

--------------------------------------------------------------------------------

rmt0.x where x = A + B + C

A = density 0 = high 4 = low

B = retension 0 = no 2 = yes

C = rewind 0 = no 1 = yes

tctl -f (tape device) fsf (No) Skips forward (No) tape markers

tctl -f (tape device) bsf (No) Skips back (No) tape markers

tctl -f (tape device) rewind Rewind the tape

tctl -f (tape device) offline Eject the tape

tctl -f (tape device) status Show status of tape drive

chdev -l rmt0 -a block_size=512 changes block size to 512 bytes

(4mm = 1024, 8mm = variable but

1024 recommended)

bootinfo -e answer of 1 = machine can boot from a tape drive answer of 0 = machine CANNOT boot from tape drive

diag -c -d (tape device) Hardware reset a tape drive.

-------------------------------------------------------------------------------- PRINT QUEUES

-------------------------------------------------------------------------------- export $LPDEST="pqname" Set default printer queue for login session lsvirprt Lists/changes virtual printer attributes.

qpri -#(job No) -a(new priority) Change a queue job priority.

qhld -#(job No) Put a hold on hold

qhld -r #(job No) Release a held job

qchk -A Status of jobs in queues

lpstat

qcan -x (job No) Cancel a job from a queue

cancel (job No)

enq -U -P(queue) Enable a queue

enable (queue)

enq -D -P(queue) Disable a queue

disable (queue)

qmov -m(new queue) -#(job No) Move a job to another queue startsrc -s qdaemon Start qdaemon sub-system

lssrc -s qdaemon List status of qdaemon sub-system

stop -s qdaemon Stop qdaemon sub-system

-------------------------------------------------------------------------------- FILE SYSTEMS

-------------------------------------------------------------------------------- Physical V olumes (PV's)

-----------------------

lspv Lists all physical volumes (hard disks)

lspv (pv) Lists the physical volume details

lspv -l (pv) Lists the logical volumes on the physical volume

lspv -p (pv) Lists the physical partition usage for that PV

chdev -l (pv) -a pv=yes Makes a new hdisk a pysical volume.

chpv -v r (pv) Removes a disk from the system.

chpv -v a (pv) Adds the removed disk back into the system.

chpv -a y (pv) Changes pv allocatable state to YES

chpv -a n (pv) Changes pv allocatable state to NO

migratepv (old pv) (new pv) Moves all LV's from one PV to another PV, both PV's must be in the same volume group.

V olume Groups (VG's)

--------------------

lsvg Lists all volume groups

lsvg (vg) Lists the volume group details

lsvg -l (vg) Lists all logical volumes in the volume group

lsvg -p (vg) Lists all physical volumes in the volume group

lsvg -o Lists all varied on volume groups

varyonvg (vg) V ary On a volume group

varyonvg -f (vg) Forces the varyon process

varyonvg -s (vg) V ary on a VG in maintenance mode. LV commands can be used on VG, but LV,s cannot be opened for I/O.

varyoffvg (vg) V ary Off a volume group

synclvodm (vg) Tries to resync VGDA, LV control blocks and ODM.

mkvg -y(vg) -s(PP size) (pv) Create a volume group

mkvg -y datavg -s 4 hdisk1

reducevg -d (vg) (pv) Removes a volume group

reducevg (vg) (PVID) Removes the PVID disk reference from the VGDA when a disk has vanished without the reducevg (vg) (pv)

command being run first.

extendvg (vg) (new pv) Adds another PV into a VG.

exportvg (vg) Exports the volume group eg deletes it!

Note : Cannot export a VG if it has active paging space, turn off paging,

reboot before exporting VG. Exporting removes entries from filesystems

file but does not remove the mount points.

chvg -a y (vg) Auto V ary On a volume group at system start.

lqueryvg -Atp (pv) Details volume group info for the hard disk.

importvg -y (vg name) (pv) Import a volume group from a disk.

importvg (pv) Same as above but VG will be called vg00 etc.

chvg -Q (y/n) (vg name) Turns on/off Quorum checking on a vg.

Logical V olumes (LV's)

----------------------

lslv (lv) Lists the logical volume details

lslv -l (lv) Lists the physical volume which the LV is on

mklv (vg) (No of PP's) (pv Name optional) Create a logical volume

mklv -y (lv) (PP's) (pv name optional) Creates a named logical volume

chlv -n (new lv) (old lv) Rename a logical volume

extendlv (lv) (extra No of PP's) Increase the size of an LV

rmlv (lv) Remove a logical volume

mklv/extendlv -a = PP alocation policy

-am = middle -ac = center -ae = edge

-aie = inner edge -aim = inner middle

migratepv -l (lv) (old pv) (new pv)

Move a logical volume between physical volumes. Both physical volumes must be in the same volume group !

mklv -y (lv) -t jfslog (vg) (No of PP's) (pv Name optional)

Creates a JFSlog logical volume.

logform (/dev/lv) Initialises an LV for use as an JFSlog

File Systems (FS's)

-------------------

lsfs Lists all filesystems

lsfs -q (fs) Lists the file system details

mount Lists all the mounted filesystems

mount (fs or lv) Mounts a named filesystem

mount -a Mounts all filesystems

mount all

mount -r -v cdrfs /dev/cd0 /cdrom mounts cd0 drive over /cdrom

crfs -v jfs -d(lv) -m(mount point) -A yes

Will create a file system on the whole of the logical volume, adds entry into

/etc/filesystems and will create mount point directory if it does not exist.

crfs -v jfs -g(vg) -m(mount point) -a size=(size of fs) -A yes

Will create a logical volume on the volume group and create the file system on the logical volume. All at the size stated. Will add entry into

/etc/filesystems and will create the mount point directory if it does not exist. chfs -A yes (fs) Change file system to Auto mount in

/etc/filesystems

chfs -a size=(new fs size)(fs) Change file system size

rmfs (fs) Removes the file system and will also remove the

LV if there are no onther file systems on it.

defrag -q (fs) Reports the fragment status of the file system.

defragfs -r (fs) Runs in report only defrag mode (no action).

defragfs (fs) Defragments a file system.

fsck (fs) V erify a file system, the file system must be unmounted!

fsck (-y or -n) (fs) Pre-answer questions either yes or no !

fsck -p (fs) Will restore primary superblock from backup copy if the superblock is corrupt.

Mirroring

---------

mklv -y (lv) -c(copies 2 or 3) (vg) (No of PP's) (PV Name optional)

Creates a mirrored named logical volume.

mklvcopy -s n (lv) (copies 2 or 3) (pv)

Creates a copy of a logical volume onto another physical volume. The physical

volume MUST be in the same volume group as the orginal logical volume ! rmlvcopy (lv) (copies 1 or 2) Removes logical volume copies.

syncvg -p (pv) Synchronize logical partion copies

syncvg -l (lv)

syncvg -v (vg)

mirrorvg (vg) (pv)

Mirrors the all the logical volumes in a volume group onto a new physical volume. New physical volume must already be part of the volume group.

--------------------------------------------------------------------------------

BOOT LOGICAL VOLUME (BLV)

--------------------------------------------------------------------------------

bootlist -m (normal or service) -o displays bootlist

bootlist -m (normal or service) (list of devices) change bootlist

bootinfo -b Identifies the bootable disk

bootinfo -t Specifies type of boot

bosboot -a -d (/dev/pv) Creates a complete boot image on a physical volume. mkboot -c -d (/dev/pv) Zero's out the boot records on the physical volume. savebase -d (/dev/pv) Saves customised ODM info onto the boot device.

-------------------------------------------------------------------------------- SYSTEM DUMP

-------------------------------------------------------------------------------- sysdumpdev -l Lists current dump destination.

sysdumpdev -e Estimates dumpsize of the current system in bytes. sysdumpdev -L Displays information about the previous dump. sysdumpstart -p Starts a dump and writes to the primary dump device. sysdumpstart -s Starts a dump and writes to the secondary dump device. sysdumpdev -p (dump device) -P Sets the default dump device, permanently Analyse dump file :-

echo "stat\n status\n t -m" ?crash /var/adm/ras/vmcore.0

-------------------------------------------------------------------------------- PAGING SPACE (PS's)

--------------------------------------------------------------------------------

lsps -a Lists out all paging space

lsps (ps)

mkps -s(No of 4M blocks) -n -a (vg)

mkps -s(No of 4M blocks) -n -a (vg) (pv)

chps -a n (ps) Turns off paging space.

chps -s(No of 4M blocks) (ps) Increases paging space.

chlv -n (new name) (old name) Change paging space name

rmps (ps) Remove paging space. PS must have been turned off

and then the system rebooted before it can be removed.

Note : Need to change the swapon entry in /sbin/rc.boot script if you are changing the default paging space from /dev/hd6. Y ou also need to

do a "bosboot -a -d /dev/hdiskx" before the reboot.

-------------------------------------------------------------------------------- SCHEDULING

-------------------------------------------------------------------------------- crontab -l List out crontab entrys

crontab -e Edit crontab entrys

crontab -l > (filename) Output crontab entrys to a file

crontab (filename) Enter a crontab from a file

crontab -r Removes all crontab entrys

crontab -v Displays crontab submission time.

/var/adm/cron/cron.allow File containing users allowed crontab use. /var/adm/cron/cron.deny File containing users denied crontab use. /var/adm/cron/crontab Directory containing users crontab entries. at (now + 2 minutes, 13:05, etc) {return} Schedule a job using at Command or schell script {return}

{CTRL D}

at -l

atq Lists out jobs scheduled to run via at command

at -r (at job No)

atrm (at job No) Removes an at job scheduled to run.

/var/adm/cron/at.allow File containing users allowed at use.

/var/adm/cron/at.deny File containing users denied at use.

/var/adm/cron/atjobs Directory containing users at entries.

-------------------------------------------------------------------------------- SECURITY

-------------------------------------------------------------------------------- groups Lists out the groups that the user is a member of setgroups Shows user and process groups

chmod abcd (filename) Changes files/directory permissions Where a is (4 SUID) + (2 SGID) + (1 SVTX)

b is (4 read) + (2 write) + (1 execute) permissions for owner

c is (4 read) + (2 write) + (1 execute) permissions for group

d is (4 read) + (2 write) + (1 execute) permissions for others

-rwxrwxrwx -rwxrwxrwx -rwxrwxrwx

Ζ?Ζ?Ζ?

- - -

???

Owner Group Others

-rwSrwxrwx = SUID -rwxrwSrwx = SGID drwxrwxrwt = SVTX chown (new owner) (filename) Changes file/directory owners chgrp (new group) (filename) Changes file/directory groups umask Displays umask settings

umask abc Changes users umask settings

where ( 7 - a = new file read permissions)

( 7 - b = new file write permissions)

( 7 - c = new file execute permissions)

eg umask 022 = new file permissions of 755 = read write and execute for owner read ----- and execute for group

read ----- and execute for other

mrgpwd > file.txt Creates a standard password file in file.txt

passwd Change current user password

passwd -f Change current users gecos (user description)

passwd -s Change current users shell

pwdadm (username) Change a users password

lsgroup ALL Lists all groups on the system

mkgroup (new group) Creates a group

chgroup (attribute) (group) Change a group attribute

rmgroup (group) Removes a group

--------------------------------------------------------------------------------

USERS

--------------------------------------------------------------------------------

env Displays values of environment variables

printenv

id Displays current user's uid and gid details

id (user) Displays user uid and gid details

whoami Displays current user details

who am i (or who -m)

who Displays details of all users currently logged in.

w

uptime Displays number of users logged in, time since last

reboot, and the machine load averages.

lslicense Displays number of current user licensese

chlicense -u (number) Changes the number of user licenses

lsuser ALL Lists all users details

lsuser (username) Lists details for user

lsuser -a(attribute) (username or ALL) Lists user attributes

lsuser -a home ALL

mkuser -a(attributes) (newuser) Add a new user

chuser (attributes) (user) Change a user

chuser login=false (user) Lock a user account

rmuser -p (user) Removes a user and all entries in security files

usrck -t ALL Checks all the user entires are okay.

fuser -u (logical volume) Displays processes using the files in that LV

lsattr -D -l sys0 -a maxuproc Displays max number of processes per user chdev -l sys0 -a maxuproc=(number) Changes max number of processes per user --------------------------------------------------------------------------------

REMOTE USERS

--------------------------------------------------------------------------------

ruser -a -f (user) Adds entry into /etc/ftpusers file

ruser -a -p (host) Adds entry into /etc/host.lpd file

ruser -a -r (host) Adds entry into /etc/hosts.equiv file

ruser -d -f (user) Deletes entry in /etc/ftpusers file

ruser -d -p (host) Deletes entry in /etc/host.lpd file

ruser -d -r (host) Deletes entry in /etc/hosts.equiv file

ruser -s -F Shows all entries in /etc/ftpusers file

ruser -s -P Shows all entries in /etc/host.lpd file

ruser -s -R Shows all entries in /etc/hosts.equiv file

ruser -X -F Deletes all entries in /etc/ftpusers file

ruser -X -P Deletes all entries in /etc/host.lpd file

ruser -X -R Deletes all entries in /etc/hosts.equiv file

--------------------------------------------------------------------------------

INITTAB

--------------------------------------------------------------------------------

telinit S Switches to single user mode.

telinit 2 Switches to multi user mode.

lsitab -a Lists all entries in inittab

lsitab (ident eg tty1) Lists the tty1 entry in inittab

mkitab ("details") Creates a new inittab entry

chitab ("details") Ammends an existing inittab entry

rmitab (ident eg tty1) Removes an inittab entry.

chitab "tty1:2:respawn:/usr/bin/getty /dev/tty1"

--------------------------------------------------------------------------------

ODM

--------------------------------------------------------------------------------

odmget -q "name=lp1" CuDv ?ore Gets lp1 info from pre-defined database. odmget -q "name-lp1" CuAt ?ore Gets lp1 info from customised database. odmdelete -o CuAt -q "name=lp1" Deletes lp1 info from customised db.

odmget -q "name=lp1" CuAt > lp1.CuAt Export ODM info to text file.

odmadd < lp1.CuAt Import ODM info from text file.

--------------------------------------------------------------------------------

ERROR LOGGING

--------------------------------------------------------------------------------

/usr/lib/errdemon -l Displays errorlog attributes.

/usr/lib/errdemon Starts error logging.

/usr/lib/errstop Stops error logging.

errpt Displays summary errorlog report.

errpt -a Displays detailed errorlog report.

errpt -j (identifier) Displays singe errorlog report.

Note : errorlog classes are H=Hardware S=Software O=Information V=Undetermined errclear (days) Deletes all error classes in the errorlog.

errclear -d (class) (days) Deletes all error class entries in errlog.

Note : The errclear command will delete all entries older than the numbers of

days specified in the days paramenter. To delete ALL entries used 0.

errlogger "message up to 230 chrs"

Enters an operator notifaction message into the errorlog.

-------------------------------------------------------------------------------- PERFORMANCE MONITORING

--------------------------------------------------------------------------------

vmstat (drive) (interval) (count) Reports virtual memory statistics.

vmstat hdisk0 5 20

vmstat -s Diplays number of paging events since system start.

vmstat -f Diplays number of forks since system start.

vmstat -i Diplays number of interupts by device since system start.

iostat (drive) (interval) (count) Reports i/o and cpu statistics.

iostat hdisk0 5 20

iostat -d (drive) (interval) (count) Limits report to drive statistics.

iostat -t (interval) (count) Limits report to tty statistics.

--------------------------------------------------------------------------------

DOS DISKETTES

--------------------------------------------------------------------------------

dosdir Reads directory listing of a diskette

dosdir (directory) Reads directory listing of a named directory

dosread -D/dev/fd0 C41.TXT c41.txt Gets C41.TXT from diskette drive fd0 dosread -D/dev/fd0 DIRECTORY/C41.TXT c41.txt

(-D option can be dropped if using fd0)

doswrite -D/dev/fd0 (unixfile) (dosfile) Writes a file to diskette

dosdel (dosfile) Deletes a dos file on diskette

dosformat Formats the diskette

-------------------------------------------------------------------------------- SENDMAIL

-------------------------------------------------------------------------------- sendmail -bi Creates new aliase db from /etc/aliase file.

newaliases

mailq Displays the contents of the mail queue

sendmail -q Processes the sendmail queue NOW

AIX常用命令大全

AIX常用命令大全 查看交换区信息: lsps -a 显示交换区的分布信息 lsps -s 显示交换区的使用信息 slibclean 清除处理程序遗留的旧分页信息 smit mkps 建立交换区空间信息 swapon -a 启动所有的分页空间 /etc/swapspaces 存放分页空间表格信息 ------------------------------------------------- 显示卷信息: lsvg 显示卷的名称 lsvg -l rootvg 显示rootvg卷的详细信息 ------------------------------------------------- mount卷的方法: varyonvg datavg 加载datavg卷 mount /dev/data1 加载datavg下的一个data1卷 裸设备类型:raw,jfs jfs可以转变成文件系统,而raw则不行 ------------------------------------------------- 在裸设备上安装oracle系统: 修改裸设备的权限,如裸设备名为system01,安装数据库用户为oracle chown oracle:dba /dev/system01 chown oracle:dba /dev/rsystem01 在使用文件时必须用rsystem01 ------------------------------------------------- smit快速路径名称:(smit:图形方式,smitty:字符方式) dev 设备管理 diag 诊断 jfs 定期档案管理系统 lvm 逻辑卷册系统管理员管理 nfs NFS管理 sinstallp 软件安装及维护 spooler 列印队列管理 system 系统管理

AIX常用命令

AIX常用命令目录指令 文件操作 选择操作

安全操作 编程操作 进程操作 时间操作 网络与通信操作 Korn Shell命令

其他命令 1 基本命令 pwd 查看当前目录 ls -a查看隐藏信息-l查看详细信息 cd 转到指定目录 mkdir 创建目录 mkdir –p 创建多级目录 rmdir 删除目录(不能删除当前目录或父目录且必须为空) rm -rf file 删除文件 clear 清屏 istat 查看文件i_node表的信息

touch 更新文件的访问和修改时间 date 列出当前日期时间 who 查看已登陆的用户 who am i 查看当前用户 su 切换用户 man 帮助 vi file 创建/编辑文件 exit 退出 cp source target 拷贝文件 mv source target 移动文件或重命名 cat 查看文件内容 compress -v file 压缩文件 uncompress file.z 解压文件 passwd 修改口令 shutdown -h now 立刻关机 shutdown -r now 关闭并立刻重启 reboot 重启 2 查看端口连接数命令 netstat -an | find /i "8000" /c Windows下查看8000端口的连接

netstat -an | grep 8000 Linux和Aix下查看8000端口的连接 netstat -an | grep 8000 |wc -l 自动统计linux和Aix端口号为8000的连接数 3 更改权限命令 chmod a-x myfile rw- rw- rw-收回所有用户的执行权限chmod og-w myfile rw-r--r--收回同组用户和其他用户的写权限 chmod g+w myfile rw- rw- r--赋予同组用户写权限chmod u+x myfile rwx rw-r--赋予文件属主执行权限(常用) chmod go+x myfile rwx rwx r-x 赋予同组用户和其他用户执行权限 4 拷贝文件命令 //远程目录拷贝到本地 scp cata@108.199.2.201:/home/cata/nmon/nmon /home/oracle/nmon //本地拷贝到远程目录

AIX系统基本命令

AIX系统基本命令 mkdir:用于创建目录 $ mkdir oracle $ ls oracle $ rm:用于删除文件或目录(rm –r 删除目录时目录内有内容,用-r一起删除)$ rm -r oracle $ ls $ mv:用于改变文件或目录名 $ mkdir ll $ ls ll $ mkdir kk $ ls kk ll $ mv ll kk $ ls kk $ cd kk $ ls ll $ cd:用于进入系统某一级目录中去 $ cd / $ pwd / $ cd /home/oracle $ pwd /home/oracle $ ls 功能:显示目录中的内容,列出当前目录中所有文件的文件名 参数说明: a:列出目录中所有文件 d:列出所有子目录 l:列出长格式文件信息 举例: ls –a:列出当前目录中的所有文件 $ ls -a #UNTITLED# .dt createdbscripts oracle . .dtprofile dead_letter smit.log .. .profile ll smit.script .TTauthority .sh_history make.log websm.log .Xauthority afiedt.buf mbox websm.script $ ls –l:显示文件的详细信息 $ ls -l

-rw------- 1 201 dba 11174 Sep 17 09:15 err*.log drwxr-xr-x 3 201 dba 512 Sep 22 10:21 tra*.log -rw-r--r-- 1 201 dba 8971 Sep 20 11:08 smit.log -rw-r--r-- 1 201 dba 5437 Sep 20 11:08 smit.script -rw-r--r-- 1 201 system 1682 Sep 02 15:18 websm.log -rw-r--r-- 1 201 system 21441 Sep 02 15:10 websm.script (还有ls –rtl,ls –lt 等相关类似命令) $ date 功能:显示当前日期和时间,超级用户可以进行修改 举例:$ date Mon Sep 22 11:22:33 BEIST 2013 $ wc 功能:计算文件中的行数、字数和字符数 参数说明: c:计算字符数 l:计算行数 w:计算字数 举例: # wc profile 13 53 381 profile | | | 行数字数字符数 $ wc smit.log 422 1162 8971 smit.log $ who 功能:列出当前系统注册的用户 举例:$who am i-- 列出当前系统使用者身份 $ who oracle lft0 Sep 22 09:05 oracle pts/0 Sep 22 10:17 (192.168.100.79) oracle pts/4 Sep 22 09:05 (:0.0) $ who am i oracle pts/0 Sep 22 10:17 (192.168.100.79) $ finger 显示当前登陆到系统中的用户的信息 举例: # finger Login Name TTY Idle When Site I nfo oracle ??? *l0 2:02 Mon 09:05 oracle ??? p4 1:59 Mon 09:05 root ??? p0 Mon 11:06 # finger oracle

AIX系统常用命令

AIX常用命令 一.目录和文件操作 1.ls命令列出指定目录下的文件,缺省目录为当前目录 #ls -a 列出所有文件,包括隐藏文件 #ls –l 显示文件详细信息 2.pwd显示出当前的工作目录 3.cd改变当前的工作目录 #cd /tmp 进入/tmp 目录 #cd .. 进入上级目录 4.mkdir 建立目录 #mkdir tmp 在当前目录下建立子目录tmp #mkdir -p /tmp/a/b/c 建立目录/tmp/a/b/c ,若不存在目录/tmp/a 及/tmp/a/b 则建立 5.rm 删除文件或目录 - f 删除文件时不作提示 - r 删除目录及其所有子目录 [例子]: #rm file1 删除文件file1 #rm -r /mytmp 删除目录/mytmp 6.cp 拷贝文件 [语法]: cp [ -p ] [ -r ] 文件1 [ 文件2 ...] 目标 文件1(文件2 ...)拷贝到目标上,目标不能与文件同名。 [参数]:

- p 不仅拷贝文件内容,还有修改时间,存取模式,存取控制表 - r 若文件名为目录,则拷贝目录下所有文件及子目录和它们的文件 [例子]: #cp file1 file2 将文件file1 拷贝到文件file2 #cp file1 file2 /tmp 将文件file1 和文件file2 拷贝到目录/tmp 下 #cp -r /tmp /mytmp 将目录/tmp 下所有文件及其子目录拷贝至目录/mytmp 7.mv 移动文件 将文件移动至目标,若目标是文件名,则相当于文件改名 #mv file1 file2 将文件file1 改名为file2 #mv file1 file2 /tmp 将文件file1 和文件file2 移动到目录/tmp 下 8.chmod 文件权限设置 [语法]: chmod [-R] 模式文件. #chmod 777 file1将文件file1存取权限置为所有用户可读可写可执行 #chmod 755 file1 文件的属主对文件file1有可读可写可执行的权限,文件所归属的用户组有可读可执行的权限,其它用户有可读可执行的权限。 9.Chown 文件属性设置 [语法]: chown [-R] 文件属主文件... [参数]: -R 改变所有子目录下所有文件的存取模式 [例子]: chown tom file1 将文件file1 的文件属主改为用户tom chown –R oracle /oracle 将/oracle属主改为用户oracle 10.vi 文本编辑 vi是unix上最常用的文本编辑工具 vi filename :打开或新建文件,并将光标置于第一行首 插入命令:i 从光标所在位置前面开始插入资料

AIX最常用命令(中文注释)

AIX常用命令 目录操作 命令名功能描述使用举例 mkdir 创建一个目录mkdir dirname "mkdir yaohc/test" rmdir 删除一个目录rmdir dirname "rmdir yaohc/test" mvdir 移动或重命名一个目录mvdir dir1 dir2 "mvdir test testcopy" cd 改变当前目录cd dirname pwd 显示当前目录的路径名pwd ls 显示当前目录的内容ls -la dircmp 比较两个目录的内容dircmp dir1 dir2 文件操作 命令名功能描述使用举例 cat 显示或连接文件cat filename pg 分页格式化显示文件内容pg filename more 分屏显示文件内容more filename od 显示非文本文件的内容od -c filename cp 复制文件或目录cp file1 file2 rm 删除文件或目录rm filename "rm -r test" mv 改变文件名或所在目录mv file1 file2 "mv copytest copy" ln 联接文件ln -s file1 file2 find 使用匹配表达式查找文件find . -name "*.c" -print

file 显示文件类型file filename 选择操作 命令名功能描述使用举例 head 显示文件的最初几行head -20 filename tail 显示文件的最后几行tail -15 filename cut 显示文件每行中的某些域cut -f1,7 -d: /etc/passwd colrm 从标准输入中删除若干列colrm 8 20 file2 paste 横向连接文件paste file1 file2 diff 比较并显示两个文件的差异diff file1 file2 sed 非交互方式流编辑器sed "s/red/green/g" filename grep 在文件中按模式查找grep "^[a-zA-Z]" filename awk 在文件中查找并处理模式awk '{print $1 $1}' filename sort 排序或归并文件sort -d -f -u file1 uniq 去掉文件中的重复行uniq file1 file2 wc 统计文件的字符数、词数和行数wc filename nl 给文件加上行号nl file1 >file2 安全操作 命令名功能描述使用举例 passwd 修改用户密码passwd chmod 改变文件或目录的权限chmod ug+x filename

AIX常用命令介绍

常用命令介绍 文件系统维护命令: Mount /umount Lsfs/lsfs -q df命令 # df -k 以兆为单位列出文件系统空间使用情况 who命令 lsdev 命令 # lsdev –C –H –S a 列出系统中的可用设备 # lsdev -Cc adapter # lsdev -Cc disk 列出系统中的所有硬盘 # lsdev -Cc memory 列出系统中的所有内存 # lsdev -Cc processor 列出系统中的所有CPU lsattr 命令 # lsattr -El mem0 查看内存的大小 # lsattr -El hdisk0 查看硬盘的信息 # lsattr -El proc0 查看处理器的个数 lscfg 命令 # lscfg -vl ent0 查看en0网卡的位置 如显示Device Specific.(YL)........P2-I4/E1,表明该网卡在第四个槽位上。 如显示Device Specific.(YL)........P2/E1,表明该网卡在主板上。 #lscfg –vl ssa0 lppchk 命令 # lppchk -v检查是否有安装不正确的软件包 oslevel 命令 # oslevel 查看AIX操作系统版本号 如显示:4.3.3.0 ,表示版本号为4.3.3.0 # oslevel -l 4.3.3.0检查是否有版本低于V4.3.3的软件包,如果有,需重新安装 lslpp 命令 # lslpp -l查看已安装的软件包及版本号 # lslpp -w /usr/bin/vi uname 命令 # uname -m查看CPU的序列号,该序列号用来生成BTP的序列号# uname -S 主机名修改主机系统名 hostname

AIX管理常用命令

AIX 管理常用命令 1.关机 重新引导多用户系统 smit shutdown shutdown -r 重新引导单用户系统 smit shutdown shutdown -r 或 reboot 将系统关闭为单用户方式: 1. cd /; 2. shutdown -m 在紧急情况下关闭系统: shutdown -F 2.存储管理 2.1 创建卷组 smitty mkvg 2.2 显示系统所有卷组 lsvg 2.3 显示系统当前活动的卷组 lsvg -o 2.4 显示某一个卷组 lsvg 卷组名; 如 lsvg rootvg 2.5 显示指定卷组的逻辑卷 lsvg -l 卷组名 2.6 显示卷组中的物理卷 lsvg -p 卷组名 2.7 给指定卷组添加物理卷 smitty extendvg 2.8 从指定卷组中删减物理卷 smitty reducevg 2.9 显示所有物理卷 lspv 2.10 显示某个物理卷 lspv 物理卷名;如 lspv hdisk1 2.11 显示物理卷的物理分区 lspv -p 物理卷名 2.12 显示物理卷中的所有逻辑卷 lspv -l 物理卷名 2.13 新建一个逻辑卷 smitty lv 2.14 显示逻辑卷位置 lslv -l 逻辑卷名 2.15 文件系统信息在/etc/filesystems 2.16 建立一个文件系统 smitty fs;快捷方式 smitty crjfs 2.17 修改文件系统 smitty chjfs 2.18 显示文件系统 lsfs 2.19 删除一个文件系统 smitty rmfs 3.用户管理 3.1 添加用户 smit mkuser; 或直接使用命令 mkuser 3.2 改变用户属性 smit chuser 3.3 显示所有用户 smitty lsuser 3.4 显示某一用户所有属性 smitty chuser 或者 lsuser 用户名3.5 属性按格式显示 lsuser -f 用户名 3.6 删除用户 smitty rmuser 3.7 设置和修改密码 smitty passwd或者passwd 用户名 3.8 添加组 smitty mkgroup 3.9 改变组的属性 smitty chgroup 3.10 显示组 smitty group或者lsgroup 3.11 显示组属性 lsgroup -a -f 属性 ALL

IBM--AIX命令

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。 例如,如果需要移动和重命名目录,请在命令行中输入下面的命令:

AIX常用命令

平时在aix中做一些操作,把常用的一些命令记录在此。 一、磁盘与文件系统 mkvg时没有-B参数时,一个VG最多255个逻辑卷和32个物理卷,加上这个参数后,可以达到512个逻辑卷128个物理 卷。 1.镜像rootvg extendvg rootvg hdisk1 mirrorvg -c2 rootvg bootlist -m normal -o hdisk0 hdisk1 bootlist -m normal ent2 gateway=192.168.32.94 bserver=192.168.32.11 client=192.168.32.117 hdisk0 #在hdisk1上建立一个引导逻辑卷(BLV) bosboot -ad hdisk1 修改bootlist bootlist -m normal hdisk0 hdisk1 rmt0 fd 显示boolist bootlist -m normal -o chvg -Qn rootvg lsvg datavg 中QUORUM 2 rootvg 要关闭QUORUM 2.激活PV chdev -l pvname -a pv=yes 3. VG操作 删除vg varyonvg dbvg03 reducevg -df dbvg03 hdiskpower4 hdiskpower5 导出、导入vg exportvg dbvg01 importvg -y'dbvg01' -c -n importvg -V 50 -y'dbvg01' 50为major number 查看可以分配的major number lvlstmajor 建vg,-f -n为启动进不varyon,-c 为concurrent mkvg -f -y'dbvg01' -s'64' '-n' '-c' hdiskpower0 hdiskpower1 mkvg -B -t 32 -y'dbvg01' -s'64' -c -n hdiskpower0 hdiskpower1

AIX操作系统常用命令

1. AIX系统查看操作系统版本 #bootinfo -y 可以查看操作系统的位数 #oslevel 可以查看操作系统版本 #oslevel -r 可以查看操作系统小版本号 2. IBM pSeries服务器AIX系统的常用命令 IBM pSeries服务器AIX系统的常用命令,包括如何移动与重命名文件、如何在系统中移动或者重命名目录、如何删除目录、如何为文本文件排序等。 1) 如何移动与重命名文件? 要将文件和目录从一个目录移动到另一个目录,或重命名一个文件或目录,使用mv 命令。 如果将一个文件或目录移动到新的目录而不指定新的名字,则其保留原来的名字。 注意: 如果不指定 -i 标志,mv 命令可能会覆盖许多已存在的文件。-i 标志会在覆盖文件之前提示确认。而 -f 标志则不会提示确认。如果一起指定了 -f 和-i 两个标志,则后一个指定的标志优先。 以下是如何使用 mv 命令的示例: a) 要将文件移动到另一个目录并给它一个新名字,请输入:# mv intro manual/chap1按下 Enter 键。 该命令将 intro 文件移动到 manual/chap1 目录。名字 intro 从当前目录被除去,同样的文件在 manual 目录中以 chap1 的名字出现。 b) 要将文件移动到另一个目录,且不改变名字,请输入:# mv chap3 manual按下 Enter 键。 该命令将 chap3 移动到 manual/chap3.用 mv 命令重命名文件可以使用 mv 命令改变文件的名字而不将其移动到另一目录。 c) 要重命名文件,请输入:# 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 命令的示例: a) 要清空并除去目录,请输入:# rm mydir/* mydir/.* # rmdir mydir

aix常用的命令

aix常用命令 1、添加用户 useradd或mkuser +用户名 2、删除用户 userdel或rmuser+ 用户名 3、修改用户密码 passwd + 用户名然后输入密码 4、lsuser命令显示/etc/passwd和/etc/security/user文件中的所有用户 属性 用法:lsuser + 用户名备注:maxage表示密码过期时间,默认为10周5、chuser 命令更改用户的属性,账户属性保存在/etc/security/user文件中 用法:chuser Attribute=Value用户名 注:禁用账户为account_locked属性 6、新建组mkgroup + 组名 7、修改组id :chgroup id=123 组名 8、删除组 rmgroup + 组名 9、修改组内成员添加组内成员chgrpmem -m + 用户名组名 删除组内成员chgrpmem -m - 用户名组名 10、获得内核中的用户和组名称长度限制 getconf LOGIN_NAME_MAX 11、查看系统版本oslevel -s 12、查看当前已登录终端who 13、查看登录失败日志who /etc/security/failedlogin 14、查看历史登录信息last | grep -v wtmp | grep -v ^$ 15、查看lastlog日志lsuser -a time_last_login tty_last_login ALL 16、查看硬盘信息df 17、查看cpu及内存使用率nmon 按c和m 18、查看内核是否加载 genkex | grep hook 19、修改目录大小 chfs -a size=+4096M / 20、查看硬盘信息df -k 21、/etc/rc.d/init.d/ListenHostSwitch.sh stop/start 22、查看文件大小ls -l或者du -sk/sm 23、AIX查看CPU vmstat 1 2,查看内存svmon -G -i 1 5 24、修改系统时间:smit date

AIX常用命令

目录 目录1 AIX常用命令 (1)

1 AIX常用命令 ●概述 AIX一般没有配置SSH软件包,默认通过telnet协议登录,默认shell为KSH。 P6小型机常被分割为多个LPAR使用,各个LPAR之前互不干扰,独占相应的硬件资源。 ●系统详细信息 # smitty 系统管理的字符界面,可以实现绝大部分命令行操作,相当有用。 # smit 以图形方式进入系统管理界面 # lscfg 获得系统的详细配置 # prtconf 获得系统的详细配置 # uname –p 显示系统的芯片类型。例如,PowerPC # uname –r 显示操作系统的版本号 # uname –s 显示系统名称。例如,AIX # uname –n 显示节点名称 # uname –a 显示系统名称、节点名称、版本、计算机ID # uname –M 显示系统型号名称。例如,IBM, 9114-275 # uname –v 显示操作系统版本 # uname –m 显示运行系统的硬件的计算机ID 编号 # uname –u 显示系统 ID 编号 # smitty hostname 修改主机名 ●操作系统 oslevel –s 查看系统补丁版本 oslevel –r 查看系统大版本 ●查看AIX5300-04缺少哪些文件集更新 oslevel -rl 5300-04 cpu个数和位数 cpu个数 # lscfg | grep proc 显示系统上的处理器数量 cpu位数 # bootinfo –y # bootinfo –K ●32位修改成64位方法: 首先检查是否安装了64位内核的软件包。 # find . -name bos.mp64 如果安装了,请执行下列步骤:

AIX操作系统及常用命令

AIX操作系统及常用命令 一、AIX的性能和特点: 1、短小强干的内核和丰富的核外系统程序 AIX的设计者对系统的内核进行了精心设计,使之既简短又强干,可常驻内存。把凡是能从内核中分离出来的部分都从中分离出来,被分离出来的部分均按核外系统程序对待。 2、良好的用户界面 AIX向用户提供的界面功能齐备,使用方便。其中包括: 命令是用户通过键盘和显示终端与系统进行交互会话的界面。 系统调用命令是供用户在编写应用程序时使用的界面。 X-WINDOWS 是系统与用户之间的图形界面环境。 3、可装卸文件卷的文件系统 AIX的整个文件系统由一个基本文件系统和若干个可装卸的子文件系统构成,它允许用户根据需要把自己的文件卷装入并与基本文件系统连接起来,不需要时可以拆卸下来。AIX的这种特点既便于扩大文件存储空间,又有利于安全和保密。 4、文件、目录和各种I/O设备均作为文件统一处理 为了方便用户使用,AIX将普通数据文件、目录文件和I/O设备均以文件论之,三者使用相同的保护机制,在用户面前它们具有相同的语法和语义。 5、性能良好的网络环境 AIX为用户提供了良好的网络环境,主要包括: 一组网络通信协议,例如TCP/IP。 一组网络通信工具,例如mail, write,wall,talk等。 一组网络编程接口,例如TLI(Transport Layer Interface)和Socket等。 6、完善的安全机制 AIX具有完善的多级安全/保密机制,其中用户级机制的一些基本内容包括: AIX将其用户分为普通用户和特权(超级)用户,它们各自享有不同的权限。 AIX为每一个用户都建立一个户头,称之为用户帐户。系统通过用户帐户来组织和记录各用户在系统中的活动,并将其限制在一定的活动范围之内。 AIX要求每一个用户必须用合法的用户名、正确的口令进行注册,并将每一个用户都归划到某一个特定的用户组中。 AIX要求每一个用户必须按照自己拥有的权限对文件/目录进行访问,不符合权限规定的访问不被系统所接受。

AIX常用命令使用

AIX常用命令使用 分类:IBM小型机 1.查看当前有多少卷组信息 [root@p570-07_lpar3#]lsvg rootvg wvg 2.查看某一卷组所在物理硬盘 [root@p570-07_lpar3#]lsvg -p wvg wvg: PV_NAME PV STATE TOTAL PPs FREE PPs FREE DISTRIBUTION hdisk1 active 4374 4374 875..875..874..875..875 3.从物理硬盘上删除卷组 [root@p570-07_lpar3#]reducevg -d wvg hdisk1 ldeletepv: V olume Group deleted since it contains no physical volumes. 3001-047 There is no matching file entry for /dev/wvg. 4.在物理硬盘上创建卷组 [root@p570-07_lpar3#]mkvg -y wvg -s 16 hdisk1 wvg 5.查看某一卷组的详细信息 [root@p570-07_lpar3#]lsvg wvg VOLUME GROUP: wvg VG IDENTIFIER: 00cc49ef00004c000000010f5046b4d3 VG STATE: active PP SIZE: 16 megabyte(s) VG PERMISSION: read/write TOTAL PPs: 4375 (70000 megabytes) MAX LVs: 256 FREE PPs: 4375 (70000 megabytes) LVs: 0 USED PPs: 0 (0 megabytes) OPEN LVs: 0 QUORUM: 2 TOTAL PVs: 1 VG DESCRIPTORS: 2 STALE PVs: 0 STALE PPs: 0 ACTIVE PVs: 1 AUTO ON: yes MAX PPs per VG: 30480 MAX PPs per PV: 5080 MAX PVs: 6 LTG size (Dynamic): 256 kilobyte(s) AUTO SYNC: no HOT SPARE: no BB POLICY: relocatable 6.在某一卷组中创建逻辑卷 [root@p570-07_lpar3#]mklv -t jfs2 -y weblv wvg 4374 weblv 例如:

AIX常用命令

AIX常用命令 2.1本章的主要命令 alog,cfgmgr,last,bootlist,uptime,mpcfg,shutdown 2.2启动过程 1、启动的前提条件:必须有一个boot image可以加载,同时要能够进入/和/usr文件系统。(如果/tmp,/var不能进入呢?) 2、启动的三种形式 a、硬盘启动 b、无盘工作站启动(通过网络上的其它远程机器提供的启动文件) c、服务模式(也叫维护模式,key设置在service位置上,或是PCI架构通过按F5来进入维护模式) 3、机器启动的三个阶段 a、只读存储内核初始化阶段(Read only storage kernel init phase),在这一阶段,主板被检查,ROS初始化程序加载时寻找bootlist,一旦找到启动设备,boot image读入内存并开始系统初始化。 b、基本设备配置阶段,所有的设备在这一阶段被配置,通过cfgmgr命令 c、系统启动阶段,在这一阶段,所有的lv激活,交换换页开始,并且init开始读取并执行/etc/inittab里的程序。 2.3加电顺序,LED显示和声音提示 在启动过程中要注意LED上代码的变化,它可以提示系统处于哪一个启动阶段。 同时要注意嘀声提示,在设备logo展示完后,如果这时系统ROS没有被破坏,又会出现一次嘀声提示,这时可以选择按F1或F5,如果没有任何选择,这时开始调用bootlist来搜索启动设备。 2.4有用的命令 2.4.1 alog命令 可以使用alog命令来查找启动过程的产生的问题,它维护和管理启动日志,位于/var /adm/ras/bootlog,由于启动日志是固定大小的,所以它循环使用。在启动时,rc.boot启动脚本调用了alog并把启动日志记录到bootlog中去。alog配置数据库中又四种日志:boot,bosinst,nim,dumpsymp。 1、查看日志内容 alog –f LogFile [-o] 2、记录数据到一个指定的日志文件中 alog –f LofFile | [ [ -q] [ -s Szie] ] 3、显示某一日志类型的冗长值 alog –L LogType –V 4、改变某一日志类型的属性值 5、显示当前某一日志类型的属性 alog –L [-t LogType ] 实际应用: #alog –L #alog –o –t boot 记在,由于bootlog没有协同机制的控制,所有如果又多个进程要同时写该日志时,可能记录上会有错误。

AIX常用命令

AIX常用命令 系统(ls显示、pwd显示当前路径、cd跳转到路径) uname、hostname显示主机名 date 显示日期 oslevel -s 显示系统版本 bootlist -om normal 显示启动设备 prtconf 显示机器、系统和硬件信息 bootinfo -y 显示内核;-r显示内存 who显示当前用户和指令 instfix -i |grep ML显示系统更新信息smit update_by_fix /smit instfix 硬件 lscfg |grep -i adapter 显示适配器配置信息 lscfg -vpl hdisk0 显示hdisk0的配置信息 lsdev-CH lsdev -Cc disk 显示磁盘类的设备状态 lsdev -Cl hdisk0 显示hdisk0的状态 lsattr -E lsattr -El sys0显示系统信息 lsattr -El hdisk0显示磁盘信息 chdev -l sys0 -a 属性=值修改系统属性 cfgmgr 查找新添加设备 lquerypv -h /dev/hdisk0 80 10 列出磁盘PVID lquerypv -M hdisk0 查新LTG大小,IO磁盘操作的最大容许值。 ifconfig en0 down / ifconfig en0 detach / rmdev -l ent0 -d删除网络适配器 ODM库 odmdelete 从知道的对象类中删除选定的对象odmdelete -o objectclass odmadd 添加对象到创建的对象类 odmchange 更改指定对象类中的选定对象的内容 odmcreate 产生.C和.h文件odmcreate filename.cre odmget 从指定的对象类中检索对象到odmadd输入文件 odmdrop 除去对象类odmdrop -o classname odmshow 在屏幕上显示对象类定义odmshow objectclass 软件 lslpp -l 查看所有的软件集 lslpp -l bos.rte.* 列出bos.rte中已安装文件集的安装状态 lslpp -f bos.rte.lvm 列出文件集bos.rte.lvm中的所有文件的名称 lslpp -w /usr/sbin/installp 列出拥有installp的文件集 lslpp -ha ‘https://www.wendangku.net/doc/e08132542.html,.*’列出https://www.wendangku.net/doc/e08132542.html,软件包中所有文件集的历史记录信息 install -C清除失败安装 install -L -d ***列除安装介质上的软件 smit install安装软件 lppchk -v显示文件集安装正确具备条件。-c 验证组成软件包的所有文件,-l验证该软件产品的符号链接。 网络和配置 ping 查看网络是否通 arp显示hostname变量指定主机当前ARP条目 ifconfig -a 显示或修改网络接口的状态

AIX常用命令

系统(ls显示、pwd显示当前路径、cd跳转到路径) uname、hostname显示主机名 date 显示日期 oslevel -s 显示系统版本 bootlist -om normal 显示启动设备 prtconf 显示机器、系统和硬件信息 bootinfo -y 显示内核;-r显示内存 who显示当前用户和指令 instfix -i |grep ML显示系统更新信息 smit update_by_fix /smit instfix 硬件 lscfg |grep -i adapter 显示适配器配置信息 lscfg -vpl hdisk0 显示hdisk0的配置信息 lsdev -CH lsdev -Cc disk 显示磁盘类的设备状态 lsdev -Cl hdisk0 显示hdisk0的状态 lsattr -E lsattr -El sys0显示系统信息 lsattr -El hdisk0显示磁盘信息 chdev -l sys0 -a 属性=值修改系统属性 cfgmgr 查找新添加设备 lquerypv -h /dev/hdisk0 80 10 列出磁盘PVID lquerypv -M hdisk0 查新LTG大小,IO磁盘操作的最大容许值。 ifconfig en0 down / ifconfig en0 detach / rmdev -l ent0 -d删除网络适配器 ODM库 odmdelete 从知道的对象类中删除选定的对象 odmdelete -o objectclass odmadd 添加对象到创建的对象类 odmchange 更改指定对象类中的选定对象的内容 odmcreate 产生 .C和.h文件 odmcreate filename.cre

AIX巡检常用命令

AIX巡检常用命令 1、机房环境检查 零地电压是否小于1V 温度(摄氏℃) 10 ℃-40℃ 湿度(%) 8% -80% 电源线的母头是否为左零右火电压值是否为240V 2、查看硬件情况 检查设备故障灯,一般为橙色并有故障标志。 有没有异常声响,如硬盘、风扇等。 有没有破损的电缆等 3、主机检查 1)系统空间使用情况,文件系统是否有“满”。 命令:df –k 2)查看卷组信息,有没有"stale"状态的逻辑卷 命令:lsvg -l rootvg 3)检查内存交换区(paging space)使用率是否超过70% 命令:# lsps –s #lsps –a 观察内存大小的命令:lsattr –El mem0 命令:vmstat 2 5

svmon -G 显示从系统启动到现在使用fork(创建的进程)的数量 命令:vmstat - f 4)当前操作系统版本 命令:oslevel 5)系统性能检查: a) CPU性能:使用Vmstat, topas来检查 b) 内存使用情况:也是使用topas, vmstat来检查 c) 检查IO平衡使用情况:使用iostat来检查 d) 交换空间使用情况:使用lsps –a来检查 6)网络检查 netstat -i 查看网卡状态 Ierrs/Ipkts 和Oerrs/Opkts是否>1% ping host_name /IP Address 查看是否通和是否有丢包。 路由表#netstat -rn 查看路由表是否正确,ping 各路由器是否通核对主机名: #hostname #ifconfig -a #lsattr –El inet0 7)检查dump设置 #sysdumpdev –l 8)检查系统合法/非法登陆情况 使用Last命令来检查来自登陆的地方。

AIX5.3常用命令

查看HACMP进程: clstrmgr与clcomd是随HACMP安装后启动的进程,不论HACMP是否在运行,只要安装了V5.3版本的HACMP,这两个进程都会一直存在。 gzoa_clu是这套cluster的名称,在配置HACMP时指定的。 clinfo是启动HACMP监控的一个进程,当此进程存在时,才能用/usr/es/sbin/cluster/clstat命令来查看HACMP的状态。只有在图形界面中才会出现如下图示。 查看oracle进程:

查看SSH服务: 查看VG状态: lsvg -o:查看当前已经激活的VG。 lsvg:查看所有的VG,包含激活和未激活的。 lsvg vgname:查看指定VG的详细信息。 黑色标记处是需要关注的参数。 VG STA TE:active表示当前是激活的。 PP SIZE:是构成VG的最小单位,在建立LV的时候需要用到。 VG Mode:Concurrent表示当前VG为并发模式,用于oracle的RAC。AUTO ON:no表示VG不是自动激活,而是由HACMP或者手工激活的。

lsvg -l vgname:查看指定VG所包含的逻辑卷LV信息。 查看网络状态: 查看每个网络接口的信息,包含IP Label信息。 此处可以看到,固定IP(OASRV1_p550_per)是附在en0即boot1网卡上的。关于固定IP,在HACMP中配置后,将随机附在本节点的网卡上。 查看路由信息

查看安装的文件包及补丁: 查看补丁的命令: instfix -i|grep ML:显示从5300-00到5300-04的补丁全部都有。oslevel -r:当前补丁级别为5300-04。 查看当前系统所包含的文件包,以SSH为例,lslpp -l|grep ssh lslpp -l|grep cluster:查看系统所包含的有关cluster的文件包。

相关文档