Thursday, March 19, 2020

HP-UX Commands Cheat Sheet

HP-UX Commands Cheat Sheet

Reference

Hardware

OperationCommandsupplement
Check Hardware
(CPU, Memory, Firm, OS)
machinfo
machinfo |grep -i memory
Check model numbermodelExample: superdome, Integrity rx2800
rebootshutdown -r 0
shutdown -r now
reboot
haltshutdown -h 0
# shutdown -r 0

SHUTDOWN PROGRAM
05/23/15 11:40:00 JST
Do you want to send your own message? (You must respond with 'y' or 'n'.): n

Broadcast Message from user01 (pts/0) Sat May 23 11:40:15...
PLEASE LOG OFF NOW ! ! !
        System maintenance about to begin.
All processes will be terminated in 0 second
# shutdown -r 0

SHUTDOWN PROGRAM
05/23/15 11:42:53 JST
Do you want to send your own message? (You must respond with 'y' or 'n'.): y
Type your message.
End with a new-line and EOF character ([CTRL]-[D]).                                        <- Ctrl - D
# reboot
Shutdown at 16:44 (in 0 minutes)

        *** FINAL System shutdown message from user@test-hpux-1 ***

System going down IMMEDIATELY

System shutdown time has arrived
reboot: redirecting error messages to /dev/console

OS Information

OperationCommandsupplement
Check OS InformationosinfoHost, Version, LastBootTime,
SystemUpTime
Check hostnamehostname
grep -i hostname /etc/rc.config.d/netconf
Check runlevelwho -r
grep initdefault /etc/inittab
Check release dateuname -a
uname -r
Check kernel configuration datekconfig -w
Check kernel parameterkctune ← all parameter
kctune -S ← not default parameter
kctune PARAMETER
Setting kernel parameterkctune PARAMETER=VALUE
kctune PARAMETER= ← Change Default
kctune PARAMETER=Default ← Change Default
kctune -h PARAMETER=VALUE
-h : Changes will be held until next boot
Example
kctune filecache_max=4%
kctune semmns=“(semmni*2)”
dmesg

Network

  • /etc/rc.config.d/netconf
OperationCommandsupplement
Check NICnwmgrIs the NIC Down or Up?
Check NIClanscanIs the NIC Down or Up?
List All NIC's IPnetstat -in ← no DNS
netstat -i ← Use DNS
Check IPifconfig NICNAME
ifconfig lan0
Check routingnetstat -rn
Check NIC Speedlanadmin -x PPANUMBER
lanadmin -x 0
Change NIC Downifconfig NICNAME down
Change NIC Upifconfig NICNAME up

User

OperationCommandsupplement
add a new group to the systemgroupadd -g GID GROUP
groupadd -g 1000 dev
add a new user login to the systemuseradd -m USER
useradd -g PRIMARY_GROUP -G GROUP -u UID -s /usr/local/bin/bash -m USER
-m : Create the home directory for the new login if it does not exist.
delete a user login from the systemuserdel USER
userdel -r USER ← delete home directory
change login passwordpasswd
passwd USER
password expires's daypasswd -x 90 USER ← 90days
Check Locked User?userstat -u USER
unlock useruserdbset -d -u USER auth_failures
password rule/usr/sbin/userdbget -u USER ← check
/usr/sbin/userdbset -u USER MIN_PASSWORD_LENGTH=8 PASSWORD_HISTORY_DEPTH=1 AUTH_MAXTRIES=10 PASSWORD_MIN_LOWER_CASE_CHARS=1 PASSWORD_MIN_UPPER_CASE_CHARS=1 PASSWORD_MIN_DIGIT_CHARS=1 PASSWORD_MIN_SPECIAL_CHARS=0
modify a user login on the systemusermod -u UID -g PRIMARY_GROUP -G GROUP USER

Disk

OperationCommandsupplement
utilization ratiobdf
summarize disk usagedu -sk DIRECTORY
check mountmount
mount -v
mount volumemount -F vxfs -o largefiles,log,nodatainlog /dev/vg01/lvol1 /u02
largefiles : using over 2GB file.
umount volumeumount /u02
check mount processfuser -u /u02
pvdisplay /dev/disk/disk3_p2
list vg (volume group)vgdisplay
vgdisplay -v
vgdisplay -v vg00 |grep "PV Name"
check activated or not
VG activate / deactivatevghcnage -a n /dev/vgxxx ← deactivate
vgchange -a y /dev/vgxxx ← activate
list lv (logical volume)lvdisplay /dev/vg*/lvol*


Associated Site

Storage

OperationCommandsupplement
Check LUN of Storageioscan -N -fnu -C disk
ioscan -fnkC disk
ioscan -m dsf
ioscan -m lun
Check HP XP Storagexpinfo -i ← reduction
xpinfo ← detail
xpinfo -v ← check xpinfo version
Scan Storageioscan
ioscan -f ← Detail

Software

OperationCommandsupplement
Listing Softwareswlist
HP-UX Versionswlist |grep HPUX11i
HP-UX pach versionswlist -l bundle QPKBASE
swlist -l bundle | grep QPK
Installing Softwareswinstall -s ./SOURCE.depot
swinstall -s ./SOURCE.depot SOFTWARE
swinstall -s ./SOURCE.depot "*"
Installed /usr/local
You need correct hosts and DNS.
Removing Softwareswremove ← GUI
swremove SOFTWARE ← CUI
show_patches

Operation

OperationCommandsupplement
lsls -l ← Byte Unit
sudovisudo
Performance Information right nowtop
Performance Information right nowglance
Memory Informationswapinfo
Load Averagew
login information right noww
login information backwardlast

Service

OperationCommandsupplement
stop service/sbin/init.d/SERVICE stopsecsh ← ssh
net ← network
start service/sbin/init.d/SERVICE start
restart
/sbin/init.d/secsh stop; /sbin/init.d/secsh start

Note

OperationCommandsupplement
Japanese LANGexport LANG=ja_JP.SJIS

ICAP

OperationCommandsupplement
icapstatus
parstatus

Replacement for Linux Command

Linux OperationHP-UX Commandsupplement
find --maxdepth=1cd /etc ; find . -name "hosts" -type f ! -path '.*/*/*'
compress tar z optiontar -cvf - test.d | gzip > /tmp/test.tar.gz
tar -cvf - /etc/test.d | gzip > /tmp/test.tar.gz
uncompress tar z optiongzip -dc test.tar.gz | tar xvf -
bzip2 -dc test.tar.bz2 | tar xvf -

No comments:

Post a Comment

  How to Change Instance Type & Security Group of EC2 in AWS By David Taylor Updated April 29, 2023 EC2 stands for Elastic Compute Cloud...