View common Aix commands for exchanging information:
Lsps -a displays the distribution information of the switching area.
Lsps -s displays the usage information of the exchange area.
Slibclean clears the old paging information left by the handler.
Smit mkps establishes exchange area spatial information
Swapon -a starts all paging spaces.
/etc/swapspaces stores paging space table information.
Display volume information:
Lsvg displays the name of the volume.
Lsvg -l rootvg displays the details of the rootvg volume.
How to mount a volume:
Varyonvg datavg loads the datavg volume.
Mount /dev/data 1 loads a data 1 volume under datavg.
Installation CD
mount -rv cdrfs /dev/cd0 /cdrom
Raw device type: raw, jfs jfs can be converted into a file system, but raw cannot.
Smit quick path name: (smit: graphic mode, smitty: character mode)
Development equipment management
diagnose
Periodic document management system
Administrator management of lvm logical volume system
Nfs NFS management
Installation and maintenance of sinstallp software
Print queue management of background printer
System system management
TCP/IP management
User user management
Clstart, clstop: starting and stopping the cluster
Lssrc -g cluser: View the status of cluser.
To view installed software information:
Ls -aF /usr/lpp (lpp: licensed program product)
View installation media content:
installp -q -d /dev/cdrom -l
View operating system patches
Instrument fixing -a
To view error log information:
errpt -a
Commands about TCP/IP
Network card:
Smit chgenet, chgtok, chgfddi, opschange, mktty: the fast path of adptr architecture.
Smit mkinet, ppp:slip and ppp fast path
Ifconfig: configure interface
Address:
/etc/hosts static host table
The name server for /etc/resolv.conf address resolution.
/etc/named.boot name server architecture
/etc/named。 C. root name server cache (remove spaces)
/etc/name. data address list
/etc/named.rev reverses the indicator list.
Nslookup queries name server information.
Network routing:
Route management route
Netstat -rn lists the defined routes.
Route routing (daekmin rip)
Gated routing (daekmin rip, egp, hello)
/etc/ Gateway Known Gateway
/etc/networks known networks
Services:
/etc/ service
/etc/inetd.conf
TCP/IP group subsystem:
/etc/rc.n e t (remove spaces)
Startsrc -g tcpip starts all tcpip subsystems.
Startsrc -s inetd starts the main internet.
Debugging:
Iptrace starts packet tracing.
Print format of Ipreport tracking results
Netstat network statistics
Ping to check if it can be reached.
Check HACMP, external hard disk information:
lscfg -v
Lsdev -Cc adapter
Peer machine information:
/etc/。 Rhodes
/etc/hosts.equiv
/etc/hosts
View memory
/etc/lsattr -El mem0
Displays the actual memory in kilobytes.
bootinfo -r
or
lsattr -El sys0 -a realmem
View swap space
lsps -l
View the operating system file system
Lslpp-l[ fileset name]
Check the top performance of system kernel, process, hard disk, etc.
Topaz
To display whether the kernel is 32-bit or 64-bit enabled:
bootinfo -K
32-bit or 64-bit display hardware:
bootinfo -y
Displays the number of processors in the system.
Lscfg | grep process
To display the number of hard disks on the system, you can enter the following command:
lspv
Detailed configuration of the system
lscfg
How does the axi advanced command know whether it is running a single processor or a multiprocessor kernel?
/unix is a symbolic link to the booted kernel. To find out the running kernel mode, enter ls -l /unix and see what the file /unix is linked to. The following are three possible outputs of the ls -l /unix command and its corresponding kernel:
/UNIX-& gt; /usr/lib/boot/unix_up # 32-bit single processor kernel
/UNIX-& gt; /usr/lib/boot/unix_mp # 32-bit multiprocessor kernel
/UNIX-& gt; /usr/lib/boot/unix_64 # 64-bit multiprocessor kernel
Switch from one kernel mode to another.
During installation, the kernel suitable for AIX version and operating hardware is enabled by default. Let's use the method in the previous question and assume that the 32-bit kernel is enabled. We also assume that you want to boot in 64-bit kernel mode. This can be achieved by sequentially executing the following commands:
ln-SF/usr/lib/boot/UNIX _ 64/UNIX
ln-SF/usr/lib/boot/UNIX _ 64/usr/lib/boot/UNIX
bosboot -ad /dev/hdiskxx
Shut down -r
The /dev/hdiskxx directory is where the boot logical volume /dev/hd5 is located. To find out what xx is in hdiskxx, you can run the following command:
lslv -m hd5
To install an oracle system on an original device:
Modify the permissions of the raw device, for example, the name of the raw device is system0 1, and the user who installs the database is oracle.
chown Oracle:DBA/dev/system 0 1
chown Oracle:DBA/dev/rsystem 0 1
Rsystem0 1 must be used when using files.
Automatically load file system information at startup:
The information to be loaded is stored in /etc/filesystems.
Mount -t nf loads all file systems of type=nfs defined in /ect/filesystems.
Displays the mounted file system and its status: df -v, mount.
How do I know if my computer is based on CHRP?
Run prtconf command. If it is a chrp computer, the string CHRP will appear on the model schema line.
What are the device attribute values in the system?
To list the current attribute values of the tape device rmt0, enter the following command:
lsattr -l rmt0 -E
To list the default attribute values of the tape device rmt0, enter the following command:
lsattr -l rmt0 -D
To list the possible login attribute values of TTY device tty0, enter the following command:
Lsatt-l tty0-a login -R
To display system-level properties, enter the following command:
lsattr -E -l sys0
List information about specific physical volumes?
For example, to learn more about hdisk 1, you can run the following command:
lspv hdisk 1
Get the detailed configuration of the system?
Enter the following command:
lscfg
The following options can provide specific information:
-p Displays platform-specific device information. This flag applies to AIX 4.2. 1 or later.
-v shows the important product database (VPD) found in the custom VPD object class.
For example, to display detailed information about the tape drive rmt0, enter the following command:
lscfg -vl rmt0
You can get very similar information by running the prtconf command.
How to determine the chip type, system name, node name, model and so on?
Uname command can provide detailed information about the system.
Chip types of uname -p display system. Like PowerPC.
Uname -r displays the version number of the operating system.
Uname -s displays the system name. Like AIX.
Uname -n displays the node name.
Uname -a displays the system name, node name, version and computer ID.
Uname -M displays the system model name. For example, IBM, 9 1 14-275.
Uname -v displays the operating system version.
Uname -m displays the computer ID number of the hardware running the system.
Uname -u displays the system ID number.
Advanced Interactive Executive program
What are the major, minor and maintenance levels of AIX running on my system?
Enter one of the following commands:
oslevel -r
lslpp -h bos.rte
Observe the process memory usage:
Ps aux observation parameter %mem: memory usage percentage RSS: actual memory usage
The unit of vmstat free is blocks, and the default value is 4096bytst.
Type selected when creating raw devices:
raw_lv
Backup of original equipment
DD if =/dev/raw 1 of =/dev/rmt 0 bs = 16k
Patches needed by AIX system
IX72696,IX85 104,IX8 1863,IX873 13,IX89087,IX89522,IY02407,IY034 12,IY05995,IY07276,IY0 1050
# lspv * List device names
hdisk 0 0006 fa7f 2 12ee 586 rootvg
hdisk 1 0006 fa 7 f 7 DC 2 b 8 a 8 oradata
If you want to delete a device, use rmdev -dl hdisk 1. ...
Smit ssaRAID (create RAID array first)
Then create VG smit vg.
Then create lv (original device) in VG.
At this point, you can create a database, or you can create FS: smit fs at this point.
Create a file system
The following command will create a jfs file system with the size of 10MB and the mount point of /fs 1 in the volume group testvg:
CRFs-v jfs-g testvg-a size = 10M-m/fs 1
Install all default file systems (all standard file systems marked with the mount=true attribute in the /etc/filesystems file).
The following command will mount all such file systems:
mount {-a|all}
Displays mounted file systems.
Enter the following command to display information about all currently mounted file systems:
increase
Unmount the file system
Unmount the /test file system by entering the following command:
Unloading/testing
Delete file system
Enter the following command to delete the /test file system:
Rmfs/ test
Defragment the file system
You can use the defragfs command to improve or report the status of contiguous spaces in the file system. For example, to defragment the file system /home, you can use the following command:
defragfs /home
Change the size of the file system
To increase the size of the /usr file system by 100000 blocks of 5 12 bytes, enter the following command:
chfs -a size=+ 1000000 /usr
#lscfg? V (shows all installed system resources)
#lsattr? E -l sys0 (display system initial parameter settings)
#lsdev? CH (display system resource status)
#df? K (file system utilization)
#
#bootinfo -y operating system environment (number)
#bootinfo -m hardware environment
Change the number of LVS in each VG. Default value = vgsize/pp.
#chvg -t
#chlv -x
"lsps -a" lists the status of the defined paging space.
"lslpp -h" is used to determine the version of AIX you are running and the versions of all licensed products.
Lsattr -E -lsys0' helps to determine how much actual memory resides on the system.
"lsdev -C" is used to determine which devices are defined by the system.
"ps av" gives an approximate estimate of the percentage of cpu and memory used by each currently running process.
Vmstat 3 20' helps to determine how much paging activity has occurred on the system. It also provides useful cpu usage information.
Iostat 3 20' helps to determine the disk utilization of each hard disk.
Verify that the fileset has the necessary prerequisites and is fully installed.
To show which filesets need to be installed or corrected, enter the following command:
lppchk -v
How to get the dump of loader segment header and symbol item in symbolic representation?
Enter the following command:
Dump -Htv
Determine the amount of paging space allocated and used.
Enter the following command:
lsps -a
Increase paging space
You can use chps -s command to dynamically increase paging space. For example, if you want to increase the size of hd6 by three logical partitions, you can execute the following command:
chps -s 3 hd6
Reduce paging space
You can use the chps -d command to dynamically reduce the paging space. For example, if you want to reduce the size of hd6 by four logical partitions, you can execute the following command:
chps -d 4 hd6
Back up the original device
# DD if =/dev/raw _ device of =/dev/rmt 0. 1 bs = 256k
Restore the original device from tape
# DD if =/dev/rmt 0. 1 of =/dev/raw _ device count = 63 seek = 1 skip = 1 bs = 4k
# mt-f/dev/rmt 0. 1 BSF 1
# DD if =/dev/rmt 0. 1 of =/dev/raw _ device seek = 1 skip = 1 bs = 256k
# DD if =/dev/r system of =/dev/r system _ bak bs = 8 192
How do I know if my system can use synchronous multithreading (SMT)?
If your system is a POWER5-based system running AIX 5L Version 5.3, it can use SMT.
How do I know if SMT is enabled in my system?
If you run the smtctl command without any options, it will tell you whether SMT is enabled.
Does 32-bit kernel support SMT?
Yes, both 32-bit and 64-bit kernels support SMT.
How to enable or disable SMT?
You can enable or disable SMT by running the smtctl command. The following is the syntax of this command:
smtctl [ -m off | on [ -w boot | now]]
How to mirror rootvg?
Here are some examples:
1. Add a new hard disk to rootvg.
#extendvg rootvg hdisk 1
2. mirror rootvg
#mirrorvg -c 2 rootvg hdisk 1
3. Regenerate the boot image
#bosboot -ad /dev/hdisk0
Update boot list
# boot list-m normal hdisk 0 hdisk 1 cd0
5. Restart the system
# Turn it off? father
network
How to display or set network parameter values?
There is no command to set or display the current or next startup value of network optimization parameters.
How do I get the IP address of my computer?
Enter one of the following commands:
Profile -a
or
Host fully qualified host name
For example, enter the host cyclop.austin.ibm.com.
How to determine the network interface on the server?
Both of the following commands will display the network interface:
lsdev -Cc if
or
Profile -a
To get information about a specific network interface, such as tr0, you can run the following command:
ifconfig tr0
How to activate the network interface?
To activate the network interface tr0, you can run the following command:
Ifconfig tr0 and above
How to disable the network interface?
For example, to disable the network interface tr0, you can run the following command:
Ifconfig tr0 is closed.
System backup
Use the following menu commands to form a boot tape for system recovery.
# smit mksysb
#lsattr -E -l sys0 (display system initial parameter settings)
#lsdev -CH (display system resource status)
Usage of cplv: copy of fs
If there is a file system /dev/lv00 in lv00, the mount point is /testfs.
Cplv-v vgname-y new old LV (this command automatically creates newlv).
Delete old lv
Modify /testfs under /etc/filesystems and set dev to /dev/newlv.
fsck /testfs
Mount /testfs can access the contents of the original file system.
Disable the interrupt key (CTRL+C) on the terminal.
In many application systems, the system administrator hopes that ordinary users can only run their own applications and cannot enter the shell prompt of the system, but by default, when users press CTRL+C key on the terminal, they will retreat to the system prompt. Because user terminals generally have no fixed port number, in order to prohibit the use of interrupt keys, the following measures can be taken:
(1) If you use ksh, you can add the following in the first line of $HOME/. Personal data:
Trap "echoes" abnormal operation "; Exit "1239 15"
(2) If you use csh(ksh is also acceptable), you can use the following commands:
% stty intr ^!
If normal conditions return, type the following command:
% stty international c
Do not echo characters in the shell.
In practical application, we generally don't want the password to be displayed on the screen when entering it on the keyboard. We can adopt the following two methods:
? Use the stty command
Do not display password
Echo "Enter password: \c"
Read PASSWD # to get the password.
Stty echo # Restore Standard Configuration
? Use the echo command
Set the security attribute: echo "\033[8m "
Unsafe attribute: echo "\ 033[m]
Find strings in all files in a directory and its subdirectories.
In the process of program maintenance, it is sometimes necessary to find a string in all files in a directory and its subdirectories. Therefore, you can use the following two methods (assuming that the string "abc" is in *. Cp file and put the results in the file and take them out):
( 1)cat/dev/null & gt; be away from home
Find it. /-Name "*. CP "-exec grep " ABC " { } & gt; & gt is outside
(2) looking for. /-Name "*. CP "| xargsgrain" ABC "> is outside.
The second method is recommended because of its low system overhead and high speed.
Comment a line in the /etc/inittab file.
We all know that "#" is used as a comment symbol in the shell, but the way to comment a line in /etc/inittab is to insert the character ":"before the first character.
Convert text files in DOS and AIX formats
There are two ways to convert text files in DOS and AIX formats:
(1) ftp command: set the ASCII transmission type, and transmit between one machine running AIX and another machine running Windows, which will not be described here.
(2) use aix2dos or dos2aix commands.
If you convert a text file in DOS format into AIX format, you can use the command A: dos2aix to input the file outfile, and vice versa: aix2dos to input the file outfile. Please refer to "DOS2AIX-h" and "aix2dos -h" for detailed usage of dos2aix and aix2dos commands. Note that to use these two commands, you must first install the fileset bos.pci
Solve the problem that VGDA on PV is inconsistent with ODM library.
In the process of system maintenance, due to operational errors or other special reasons, it is possible that the LVCB and VGDA on a PV are inconsistent with their corresponding ODM libraries, resulting in confusion of ODM libraries and inability to perform related operations on PV. At this point, you can use the following two AIX commands to solve this problem:
Redefine the virtual disk name Virtual disk name
This command uses LVM information on the specified PV to redefine the ODM library of the given VG.
Or: synclvodm -P -v vgname
This command synchronizes or rebuilds the ODM library and LVM information of a given VG.
Set file size limits for users
In AIX system, users have certain restrictions on the use of system resources. For example, by default, the largest file that users can create or expand is 1G (see/etc/security/limits: fsize = 2097151,fsize _ hard = fsize 5 12 byte block).
If you want to modify it, you can use smit:
# smit chuser Select the user and modify the following two items:
Soft file size [4 194302]
# (2G, which can be set as required)
Hard file size [4 194302]
# (2G, which can be set as required)
Log in as this user, and use "ulimit -f" and "ulimit -Hf" to display the size of its fsize and fsize_hard respectively.
Lists files under the file system by file size.
When monitoring the space usage of the file system, if the remaining space of the file system is small or the used space grows rapidly, it is necessary to list all files in the file system that are larger than a given number of bytes for further maintenance and management. To do this, you can use the following command:
# find[ file system name] -xdev -size +[5 12 byte block] -ls | sort -r -n -k7
Is the file system full?
Method: df? You can check the utilization rate of the file system in units of k (more than 90%, which needs to be adjusted).
Use errpt |more to check the system error log.
Clear existing log: Errclear 0
Check the legal/illegal login of the system.
Use the last command to check from the landing site.
Check whether the system has generated a huge core file.
Use find/-name core? Print to check. For core files, it is generally enough to delete them directly.
System performance check:
A) CPU performance: check with Vmstat and topas.
B) Memory usage: topas and vmstat are also used for checking.
C) Check the balanced use of IO: use iostat for inspection.
D) exchange space use: use LSP? To check
6. Mail check
Diagnose once a month
Use the command SVMON to monitor the server,
such as
root@AIX 1 [/]# svmon
Use the size of the idle pin virtual.
Memory10485661023178 4976 55113251293.
pg space 524288 1087 1
Staff client
pin 55 1 16 0 0
In use 250952 772224 2
With SVMON, you can specify a process number, such as