HP UX Common+Unix+Commands
HP UX Common+Unix+Commands
swap
Solaris Red Hat HP
swap -l cat /proc/swaps (detailed) swapinfo (displayed in KB)
display swap swap -s swapon -s swapinfo -m (display in Mb)
swapinfo -tm (total / Mb)
Create logical volume or filesystem
mkfile 5m device:
/var/swapfile create partition with fdisk (type 82) swapon <device> | -f <logical
swap -a /var/swapfile file: device>
dd if=/dev/zero of=/var/swapfile bs=1024 swapon -p 3 <device> | -f <logical
adding swap update /etc/vfstab count=65536 device>
sysinfo
List Raw Partitions n/a raw -qa n/a
tunefs tune2fs tunefs
Tune Filesystems
fstyp -v <device> tune2fs -l /dev/sda1
isainfo -kv (solaris 9+) uname -a
isalist (sparc v9 will be listed first) uname -m getconf KERNEL_BITS ( version 11)
getconf -a |grep -i 'long_bit'
Kernel 32 or 64 HPUX < version 11 all 32 bit
servers:
truss -p <pid> strace -p <pid> download and install tusc
Trace system calls
tusc -p <pid>
n/a /proc/interrupts n/a
Display IRQ, IO ports and
/proc/ioports
DMA
/proc/dma
Services
NFS
Disk
Kernel Modules
No reboot (dynamically):
set kernel parameters echo "250 32000 100 28" >
/proc/sys/kernel/sem
echo "536870912" >
/proc/sys/kernel/shmmax
echo "4096" > /proc/sys/kernel/shmmni
echo "2097152" > /proc/sys/kernel/shmall
etc.............................................
display kernel cat /etc/system sysctl -a kctune (11i only)
parameters sysdef -i cat /etc/sysctl.conf sysdef
ipcs -a kmtune
cat /proc/sys/kernel/sem kmsystem
cat /proc/sys/kernel/shmmax /usr/sam/lbin/getkinfo -f /stand/vmunix -o
etc................................... /tmp/kernel.data
ipcs -a
cd /usr/src/linux-2.4
edit and update file then edit Makefile (change EXTRAVERSION) cd /stand/build
reboot: make mrproper /usr/lbin/sysadm/system_prep -s system
/etc/system backup .config edit system file
make xconfig /usr/sbin/mk_kernel -s ./system
make dep mv /stand/system /stand/system.old
build kernel
make bzImage mv /stand/vmunix /stand/vmunix.old
make modules mv /stand/build/system /stand
move new kernel mv /stand/build/vmunix_test /stand/vmunix
make modules_install reboot
change lilo/grub config file
reboot
Networking
Patching / Software
Accounts
NTP
Solaris Red Hat HP
netdaemons
Time daemons
xntpd ntpd
Edit: chkconfig --list ntpd /etc/rc.config.d/netdaemons (set XNTPD to 1)
# Solaris 8 chkconfig --level 2345 ntpd on /etc/ntp.conf
/etc/ntp.conf /etc/ntp.conf (edit with ntp servers)
/etc/ntp.server /sbin/service ntpd start
ntp setup /etc/ntp.client
dateconfig (GUI)
# Solaris 10
/etc/inet/ntp.server
/etc/inet/ntp.client
ntpq -p ntpq -p
NTP Trace commands
ntptrace ntptrace
Log Files
Security
Misc
Solaris Red Hat HP
eeprom grub (GUI) setboot -p
startup lilo (text based)
setenv boot-device
shutdown -i5 -g0 -y (power down) shutdown -h (halt) shutdown -h -y (halt)
shutdown -i6 -g0 -y (reboot) shutdown -r (reboot) shutdown -r -y (reboot)
shutdown shutdown -i0 -g0 -y (OK prompt) shutdown -f (fast reboot no fsck)
shutdown -F (force fsck)
reboot -- -r (reboot/reconfigure)
init status shutdown halt
0 single user single user halt
1 n/a multiuser (no networking) single users
2 Multi-user multiuser (networking) multiuser (no networking)
3 n/a unused multiuser (networking and GUI)
4 power off GUI multiuser (netwrking and old GUI)
5 reboot reboot n/a
6 n/a
-s single user linux single
-a interactive linux emergency
-x no device drivers (used in linux rescue
clustering)
-r reconfigure devices single: runlevel1, local fs mounted, no
Startup options
-m milestone network
emergency: root fs read-only, no init files
run
rescue: use cd-rom/network, root mounted
as /mnt/sysimage
/etc/init.d /etc/init.d /etc/rc.config.d
startup scripts
/etc/rc0.d - /etc/rc6.d /etc/rc0.d - /etc/rc6.d /sbin/rc0.d - /sbin/rc6.d
determine the run level who -r runlevel who -r
obtain default run level cat /etc/inittab cat /etc/inittab /etc/inittab
n/a startx (shorthand of below) n/a
start xwindows
initx (lots of parms)
force a fsck n/a touch /forcefsck n/a
shutdown -rF now
/usr/bin/pagesize /usr/bin/getconf -a| egrep -i 'pagesize| 4Kb
page size (memory)
page_size'
initialize system sys-unconfig netconf set_parms initi
/etc/TIMEZONE /etc/sysconfig/clock /etc/TIMEZONE
Timezone
/etc/default/init
drvconfig /dev/MAKEDEV <device> insf -C tape (Class)
devlinks
update /dev directory disks|tapes|ports insf -H 0.1.0 -e (recreate deleted link)
/etc/nodename
change the hostname
/etc/hostname.<interface>
/etc/inet/hosts
/etc/inet/ipnodes
floppy: floppy: floppy:
/dev/fd0 n/a
disk:
/dev/dsk/c0t0d0s0 disk: disk:
/dev/hda or /dev/sda /dev/dsk/c0t6d0
Device paths tape: /dev/hdb or /dev/sdb
/dev/rmt/0ucb tape:
tape: /dev/dsk/rmt/0
cdrom:
/dev/dsk/c0t6d0s0 cdrom: cdrom:
/dev/hda (depends on number of IDE disks) /dev/dsk/c1t6d0
Crash Dump dumpadm -d <device> diskdump edit /stand/system
netdump
crash (used to analyse crash dumps) kdump (part of kexec rpm) add either:
adb (used to analyse crash dumps) dump 2/0/1.5.0
crash (used to analyse crash dumps) dump lvol
dump none
Boot (jumpstart) servers: Boot (jumpstart) servers: Boot (jumpstart) servers:
rpcinfo -b bootparam 1 rpcinfo -b bootparam 1 rpcinfo -b bootparam 1