====== AIX Commands ====== ===== Display operating system level ===== bash-3.00# oslevel <-- Gives Base OS level 6.1.0.0 bash-3.00# oslevel -s <-- Gives Service packs 6100-04-01-0944 Format is 6100-04-01-0748, where\\ 6100 refers to base level 6.1.0.0\\ 04 refers to technology level 4\\ 01 refers to service pack 1\\ 0944 refers to the yyww build date in year and weeks, (44th week of the year 2009).\\ ===== Display Installed packages ===== ==== List all Installed Software ==== bash-3.00# lslpp -L all Fileset Level State Type Description (Uninstaller) ---------------------------------------------------------------------------- bos.64bit 6.1.4.0 C F Base Operating System 64 bit Runtime bos.acct 6.1.4.0 C F Accounting Services bos.adt.base 6.1.4.0 C F Base Application Development Toolkit bos.adt.data 6.1.0.0 C F Base Application Development Toolkit Data bos.adt.debug 6.1.4.0 C F Base Application Development De buggers <-- Truncated --> ==== List files installed by package ==== bash-3.00# lslpp -f Fileset File ---------------------------------------------------------------------------- bos.64bit 6.1.1.0 /usr/lib/methods/cfg64 /usr/ccs/bin/usla64 /usr/lib/drivers/syscalls64.ext /usr/ccs/bin/shlap64 bos.rte 6.1.0.0 / /usr/aix /usr/lpp /usr/lpp/bos /usr/lpp/bos/inst_root /usr/include /usr/include/sys /usr/lib /usr/lib/fs /usr/lib/fs/nfs /usr/lib/threads /usr/sysv /usr/sysv/bin /usr/ucb /usr/usg /usr/bin <-- Truncated --> ==== Lists Installation History ==== bash-3.00# lslpp -ha bos.rte Fileset Level Action Status Date Time ---------------------------------------------------------------------------- Path: /usr/lib/objrepos bos.rte 6.1.0.0 COMMIT COMPLETE 15/02/08 12:05:26 6.1.2.0 COMMIT COMPLETE 06/01/09 15:47:16 6.1.2.0 APPLY COMPLETE 06/01/09 15:17:54 6.1.4.0 COMMIT COMPLETE 22/03/10 11:08:52 6.1.4.0 APPLY COMPLETE 22/03/10 10:57:06 Path: /etc/objrepos bos.rte 6.1.0.0 COMMIT COMPLETE 15/02/08 12:05:26 6.1.2.0 COMMIT COMPLETE 06/01/09 15:47:17 6.1.2.0 APPLY COMPLETE 06/01/09 15:17:55 6.1.4.0 COMMIT COMPLETE 22/03/10 11:08:52 6.1.4.0 APPLY COMPLETE 22/03/10 10:57:08 ===== List files ===== |ls |horizontal list| |ls -1 |vertical list| |ls -i |give inode number| |ls -lart |list in reverse date order| ===== Boot Commands ===== bootlist -om normal (-Out Mode normal) alog -o -t boot View the boot log ===== Terminal commands ===== Show your logged in terminal number:- bash-3.00# tty /dev/pts/13 ===== Networking ===== Show all network interfaces:- ifconfig -a Turn on interface:- ifconfig up Turn off interface:- ifconfig down Remove interface:- ifconfig detach Use smitty tcpip for permanent changes. ===== Device management ===== |lscfg |lists all installed devices| |lscfg -v |lists all installed devices in detail| |lscfg -vl (device name)|lists device details| |bootinfo -b |reports last device the system booted from| |bootinfo -k |reports keyswitch position, 1=secure, 2=service, 3=normal | |bootinfo -T |reports type of machine ie rspc | |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 | |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 | ===== Start and Stop service ===== startsrc -s >service name< stopsrc -s >service name< ===== NFS exports ===== List all exported filesystems exportfs Reload NFS exports after editing /etc/exports exportfs -a Un-exports filesystem exportfs -u ===== Disk and Filesystem Commands ===== ==== Device Commands ==== |lsdev |The "lsdev -Cc disk" command can be used to display the what disks are recognized by the system. This will display disks whether they have been initialized as PVs or not.| |rmdev |Remove a device from the system configuration. This is done to remove the device configuration when a faulty disk is replaced, or if a disk is moved to another system.| |cfgmgr |Re-scan the system for devices that were not available at system start up. This can be done to recognize hot pluggable drives that were added after the system was up, or can be used to recognize devices such as external tape or disk drives that were not powered on when the system was booted up.| ==== Physical Volume Commands ==== |pvcreate |Initialize a disk as a Physical Volume. This must be done prior to adding a disk to a volume group.| |lspv |Display the Physical Volumes on a system. When given a PV name as a parameter, it gives detailed information about that PV.| |lspv -l |gives Logical Volumes contained| |lspv -p |gives partitions| |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. | ==== Volume Group Commands ==== |lsvg |List information about logical volumes. When given with parameters, it lists all volume groups on the system.| |lsvg -l Volumegroup | List all Logical Volumes in VG| |lsvg -p Volumegroup | List all Physical Volumes in VG| |lsvg -o| List all varied on VG's| |chvg |Change volume group characteristics.| |mkvg |Create a volume group.| |extendvg |Add PVs to a volume group.| |reducevg |Remove unused PVs from a volume group. If logical volumes currently reside on the PV in question, the "migratepv" command can be used to move the LV onto another disk in the VG provided there is enough space to do so.| |exportvg |Remove knowledge of a volume group from the Kernel. This can be used on removable disks such as optical disks or Iomega Jaz drives prior to removing the drive from a system, or can be used when moving a disk or disks from one system to another. The data in the VG is left intact.| |importvg -y (vg name) (pv) |Re-initializes kernel knowledge of a volume group that had been previously exported. The data on the VG is left intact, and becomes accessible once it has been imported. The existing logical volume names are used unless they conflict with logical volumes currently in use on the system.| |mirrorvg |Creates mirror volumes for all volumes in a volume group.| |unmirrorvg |Removes a mirror from each volume in a volume group.| |varyonvg volgrp |Vary On a volume group| |varyonvg -f volgrp |Forces the varyon process| |varyonvg -s volgrp |Vary on a VG in service (maintainance) mode. LV commands can be used on VG, but LV's cannot be opened for I/O.| |varyoffvg volgrp |Vary Off a volume group | === Change the Volume Group Name === I think there is no direct method of changing the name of volume group, But i think it is possible in 5.3 of AIX. In AIX 5.2 L we can do it buy an indirect command:- varyoffvg oldvg exportvg oldvg importvg -y "newvg" hdisk10 === Extend filesystem === chfs -asize=+1G /dev/logicalvolume ==== Logical Volume Commands ==== |lslv |Lists information about logical volumes. A logical volume name must be specified. In order to list information about all logical volumes, you would need to use "lsvg" to list all volume groups, and then use "lsvg -l " on each volume group. You could then use "lslv " to list the detailed information about each logical volume found.| |mklv |Create a logical volume.| |rmlv |Delete a logical volume.| |extendlv |Increase the size of a logical volume.| |chlv |Change the characteristics of a logical volume.| |mklvcopy |Mirror a logical volume. This allows for RAID-1 in software.| |rmlvcopy |Removes a mirror copy of a logical volume.| ==== File System Commands ==== |crfs |Create a file system. This command can be used to create a file system on an existing logical volume, or it can be used as an all in one command to create both a logical volume and file system at once.| |chfs |Change file system characteristics. This can be used to increase the size of a file system.| |rmfs |Remove a filesystem, its associated logical volume, and its entry in /etc/filesystems.| ==== Paging Space Commands ==== |lsps |Lists information about paging space volumes.| |lsps -a |lists all paging spaces| |lsps -s |Displays total paging spaces and usages|