cmdref.net - Cheat Sheet and Example

cmdref.net is command references/cheat sheets/examples for system engineers.

User Tools

Site Tools


Sidebar








Cloud



Etc


Reference














.

os:hpux:command:index.html



HP-UX

HP-UX Commands Cheat Sheet

Reference

Hardware

Operation Command supplement
Check Hardware
(CPU, Memory, Firm, OS)
machinfo
machinfo |grep -i memory
Check model number model Example: superdome, Integrity rx2800
reboot shutdown -r 0
shutdown -r now
reboot
halt shutdown -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

Operation Command supplement
Check OS Information osinfo Host, Version, LastBootTime,
SystemUpTime
Check hostname hostname
grep -i hostname /etc/rc.config.d/netconf
Check runlevel who -r
grep initdefault /etc/inittab
Check release date uname -a
uname -r
Check kernel configuration date kconfig -w
Check kernel parameter kctune ← all parameter
kctune -S ← not default parameter
kctune PARAMETER
Setting kernel parameter kctune 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
Operation Command supplement
Check NIC nwmgr Is the NIC Down or Up?
Check NIC lanscanIs the NIC Down or Up?
List All NIC's IP netstat -in ← no DNS
netstat -i ← Use DNS
Check IP ifconfig NICNAME
ifconfig lan0
Check routing netstat -rn
Check NIC Speed lanadmin -x PPANUMBER
lanadmin -x 0
Change NIC Down ifconfig NICNAME down
Change NIC Up ifconfig NICNAME up


User

Operation Command supplement
add a new group to the system groupadd -g GID GROUP
groupadd -g 1000 dev
add a new user login to the system useradd -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 system userdel USER
userdel -r USER ← delete home directory
change login password passwd
passwd USER
password expires's day passwd -x 90 USER ← 90days
Check Locked User? userstat -u USER
unlock user userdbset -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 system usermod -u UID -g PRIMARY_GROUP -G GROUP USER


Disk

Operation Command supplement
utilization ratio bdf
summarize disk usage du -sk DIRECTORY
check mount mount
mount -v
mount volume mount -F vxfs -o largefiles,log,nodatainlog /dev/vg01/lvol1 /u02
largefiles : using over 2GB file.
umount volume umount /u02
check mount process fuser -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 / deactivate vghcnage -a n /dev/vgxxx ← deactivate
vgchange -a y /dev/vgxxx ← activate
list lv (logical volume) lvdisplay /dev/vg*/lvol*



Associated Site


Storage

Operation Command supplement
Check LUN of Storage ioscan -N -fnu -C disk
ioscan -fnkC disk
ioscan -m dsf
ioscan -m lun
Check HP XP Storage xpinfo -i ← reduction
xpinfo ← detail
xpinfo -v ← check xpinfo version
Scan Storage ioscan
ioscan -f ← Detail


Software

Operation Command supplement
Listing Software swlist
HP-UX Version swlist |grep HPUX11i
HP-UX pach version swlist -l bundle QPKBASE
swlist -l bundle | grep QPK
Installing Software swinstall -s ./SOURCE.depot
swinstall -s ./SOURCE.depot SOFTWARE
swinstall -s ./SOURCE.depot "*"
Installed /usr/local
You need correct hosts and DNS.
Removing Software swremove ← GUI
swremove SOFTWARE ← CUI
show_patches


Operation

Operation Command supplement
ls ls -l ← Byte Unit
sudo visudo
Performance Information right now top
Performance Information right now glance
Memory Information swapinfo
Load Average w
login information right now w
login information backward last


Service

Operation Command supplement
stop service /sbin/init.d/SERVICE stop secsh ← ssh
net ← network
start service /sbin/init.d/SERVICE start

restart

/sbin/init.d/secsh stop; /sbin/init.d/secsh start

Note

Operation Command supplement
Japanese LANG export LANG=ja_JP.SJIS


ICAP

Operation Command supplement
icapstatus
parstatus


Replacement for Linux Command

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



os/hpux/command/index.html.txt · Last modified: 2021/02/20 by admin

Page Tools