This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
aix:tricks [2022/08/02 14:35] manu [Encode password : Base64 Encoding] |
aix:tricks [2025/08/23 22:56] (current) |
||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== AIX: Tips and Tricks ====== | ====== AIX: Tips and Tricks ====== | ||
| + | |||
| + | ==== Sum multiple lines ==== | ||
| + | |||
| + | <cli prompt='>'> | ||
| + | root@prod /root> ps vx | sort -rn +4 | awk '{print $5}' | ||
| + | 68087 | ||
| + | 2186 | ||
| + | 2186 | ||
| + | 898 | ||
| + | 704 | ||
| + | 700 | ||
| + | 578 | ||
| + | 560 | ||
| + | 550 | ||
| + | 508 | ||
| + | |||
| + | root@prod /root> ps vx | sort -rn +4 | awk '{print $5}' | paste -s -d+ - | ||
| + | 68087+2186+2186+898+704+700+578+560+550+508+ | ||
| + | |||
| + | root@prod /root> ps vx | sort -rn +4 | awk '{print $5}' | paste -s -d+ - | bc | ||
| + | 76957 | ||
| + | </cli> | ||
| + | |||
| + | |||
| + | |||
| ==== bash, absolute value ==== | ==== bash, absolute value ==== | ||
| Line 119: | Line 144: | ||
| ==== Verification of environment settings for a running process under AIX ==== | ==== Verification of environment settings for a running process under AIX ==== | ||
| - | <fc #FF0000>**ps eww <processid>**</fc> | + | **ps eww <processid>** |
| (ps e displays the environment as well as the parameters to the command, up to a limit of 80 characters, ps eww wraps the display from the e flag and displays the ENV list until the flag reaches the LINE_MAX value) | (ps e displays the environment as well as the parameters to the command, up to a limit of 80 characters, ps eww wraps the display from the e flag and displays the ENV list until the flag reaches the LINE_MAX value) | ||
| Line 172: | Line 197: | ||
| # find / -nogroup | # find / -nogroup | ||
| </cli> | </cli> | ||
| + | |||
| + | ==== Find files or directories belonging to a user or group and change it ==== | ||
| + | |||
| + | To change a userID / groupID, first top all processes from user | ||
| + | |||
| + | initial userID and groupID is 100 and 150, so first change into /etc/passd and /etc/group, then do it in 2 steps: user and then group | ||
| + | <cli prompt='#'> | ||
| + | # find / -user 100 -exec chown myuser {} + | ||
| + | # find / -user 150 -exec chgrp mygrp {} + | ||
| + | </cli> | ||
| + | |||
| + | You can aslo do it like | ||
| + | find / -user 100 -exec chown myuser {} \; | ||
| ==== Increase perf on NFS ==== | ==== Increase perf on NFS ==== | ||
| Line 416: | Line 454: | ||
| </code> | </code> | ||
| - | ==== Debug for an AIX service ==== | + | ==== AIX devices attributes ==== |
| + | |||
| + | To list all devices | ||
| + | <code> | ||
| + | # # lsdev -C | more | ||
| + | ... | ||
| + | en0 Available Standard Ethernet Network Interface | ||
| + | ent0 Available Virtual I/O Ethernet Adapter (l-lan) | ||
| + | et0 Defined IEEE 802.3 Ethernet Network Interface | ||
| + | fcs0 Available C5-T0 Virtual Fibre Channel Client Adapter | ||
| + | fcs1 Available C6-T0 Virtual Fibre Channel Client Adapter | ||
| + | hdisk4 Available C7-T1-01 MPIO IBM 2076 FC Disk | ||
| + | hdisk5 Available C7-T1-01 MPIO IBM 2076 FC Disk | ||
| + | sys0 Available System Object | ||
| + | </code> | ||
| To query current setting of a device: | To query current setting of a device: | ||
| Line 422: | Line 474: | ||
| # lsattr -D -l sys0 -a maxuproc | # lsattr -D -l sys0 -a maxuproc | ||
| </code> | </code> | ||
| + | |||
| To set to a different value: | To set to a different value: | ||
| <code> | <code> | ||
| Line 528: | Line 581: | ||
| varyonvg | varyonvg | ||
| </cli> | </cli> | ||
| + | |||