UNIX System Administration Commands Guide
UNIX System Administration Commands Guide
© 2000 UNIXguide.net, All Rights Reserved. Hermelito Go (Last Update: Friday, 10-Aug-2018 17:11:57 EDT )
Directory AIX FreeBSD HP-UX LINUX(RedHat) SOLARIS Tru64
Mappings
/tmp
{/dev/hd3} /tmp {/dev/vg00/lvol6} /tmp
/dev/vx/dsk/swapvol}
/usr
{/dev/hd2} /usr /usr {/dev/vg00/lvol7} /usr /usr {/dev/rz0g}
{/dev/ad0s1f}
http://www.unixguide.net/unixguide.shtml[22-09-2023 23:42:13]
UNIXguide.net ( AIX, FreeBSD, HP-UX, LINUX, SOLARIS & Tru64)
reporter
Virtual Memory vmstat vmstat vmstat vmstat vmstat vmstat
statistics
I/O statistics iostat iostat iostat iostat {sysstat} iostat iostat
Error logs alog -o -t boot dmesg dmesg dmesg dmesg uerf -R -o full
errpt
Physical RAM 1TB 4TB 64 GB {>2.3.24} 16TB 4TB
Shared Memory 2.75GB 8TB sysctl kernel.shmmax
Process Data 2GB 4GB 900 MB
Space
Swap device /dev/hd6 /dev/ad0s1b /dev/vg00/lvol2 /dev/sda2 /dev/vx/dsk/swapvol /dev/rz0b
Swap file type /etc/swapspaces swap swap partition type 82 swap raw
Display swap lsps -a swapinfo swapinfo -a free swap -l swapon -s
size
Activate Swap swapon -a swapon -a swapon -a swapon -a swap -a swapon -a
Printers AIX FreeBSD HP-UX LINUX Solaris Tru64
Printer Queues /etc/qconfig /var/spool/print /etc/lp/interface/* /var/spool/lpd/lp/* /etc/lp/interfaces/* /usr/spool/lpd
Stop LP stopsrc -s lpd lpshut /etc/init.d/lpd stop /usr/lib/lp/lpshut /sbin/init.d/lpd stop
Start LP startsrc -s lpd lpd lpsched /etc/init.d/lpd start /usr/lib/lp/lpsched /sbin/init.d/lpd start
enq
Submit print lp lp lp lpr lp lp
jobs lpr lpr
lpr
qprt
enq -A
LP statistics lpq lpq lpstat lpq lpstat lpstat
lpstat
qchk
cancel
Remove print lprm cancel cancel lprm cancel cancel
jobs lprm lprm lprm
qcan
enq -x
Add printer smit mkpq lpadmin -p pq printtool lpadmin -p pq lprsetup
queue
Remove Printer smit rmpq lpadmin -x pq lpadmin -x pq lprsetup
queue
Make default export LPDEST="pq" lpadmin -d pq lpadmin -d pq export PRINTER="lp"
printer
TCP/IP AIX HP-UX LINUX(RedHat) Solaris Tru64
/etc/hostname.*
Network IP lsattr -E -l inet0 /etc/rc.conf /etc/rc.config.d/netconf /etc/sysconfig/network- /etc/rc.config
configuration scripts/ /etc/inet/*
/etc/defaultrouter
Hosts IP /etc/hosts /etc/hosts /etc/hosts /etc/hosts /etc/inet/hosts /etc/hosts
addresses
Name service /etc/netsvc.conf /etc/host.conf /etc/nsswitch.conf /etc/nsswitch.conf /etc/nsswitch.conf /etc/svc.conf
switch
Network no -a sysctl ndd -h sysctl -a | grep net ndd /dev/[tcp|ip] ?
parameters
Routing daemon gated routed gated routed in.routed routed
NIC ifconfig -a ifconfig -a lanscan -v ifconfig -a ifconfig -a ifconfig -a
Configurations
Secondary IP ifconfig en0 alias IP ifconfig xl0 alias ifconfig lan0:1 IP modprobe ip_alias ifconfig hme0:1 IP up ifconfig ln0 alias
Address IP ifconfig eth0:1 IP
http://www.unixguide.net/unixguide.shtml[22-09-2023 23:42:13]
UNIXguide.net ( AIX, FreeBSD, HP-UX, LINUX, SOLARIS & Tru64)
these new values NPTY=#
uniquetype=pty/pty/pty" set pt_cnt = # {SYSV}
PdAt | sed "s/0-64/0-512/" NSTRPY=#
set npty = # {BSD}
|
Increase the # reboot
of pseudo- odmchange -q cd /dev cd /dev
"attribute=num and ./MAKEDEV -v pty {/etc/iu.ap} ./MAKEDEV PTY_1
terminals ptsl 0 # ldterm ttcompat
uniquetype=pty/pty/pty" -o insf -d ptys -n #
PdAt
insf -d ptym -n #
insf -d pts -s # -e -v halt
chdev -l pty0 -anum=256 -P boot -r
reboot
Maximum # of 512 {MAXUSERS} 256 176
{BSD} 8192
ptys 3000
{SYSV}
http://www.unixguide.net/unixguide.shtml[22-09-2023 23:42:13]
UNIXguide.net ( AIX, FreeBSD, HP-UX, LINUX, SOLARIS & Tru64)
another physical object
volumes
Create volume mkvg vgcreate vgcreate vxdg init voldg init
group
Remove volume vgremove vgremove
group
chvg
Volume group vgchange vgchange
availability varyonvg
varyoffvg
Restore volume vgcfgrestore vgcfgrestore
group
Exports volume exportvg vgexport vgexport vxdg deport voldg deport
group
Imports volume importvg vgimport vgimport vxdg import voldg import
group
Volume group lsvg vgscan vgscan
listing
Change logical
volume chlv lvchange lvchange vxedit set voledit set
characteristics
List logical lslv vinum lv lvdisplay lvdisplay vxprint -vl volprint -vl
volume
Make logical mklv lvcreate lvcreate vxassist make volassist make
volume
Extend logical extendlv lvextend lvextend vxassist growto volassist growto
volume
Reduce logical AIX reduce LV lvreduce lvreduce vxassist shrinkto volassist shrinkto
volume
Remove logical rmlv vinum rm vol lvremove lvremove vxedit rm voledit -g rootdg -rf rm
volume vol1
Prepare boot bootlist -m normal lvlnboot lilo vxbootsetup
volumes
Remove boot lvrmboot
volumes
Create mirrors mklv -c 2 vinum mirror drive lvcreate -m 1 vxassist mirror volassist make vol 100mb
mirror=true
Add mirrors mklvcopy lv 2 lvextend -m 1
Create striped mklv -u 3 -S 64K vinum stripe drive lvcreate -i 3 -I 64 lvcreate -i 3 -I 64 vxassist make vol 100mb volassist make vol 100mb
volumes layout=raid5 layout=stripe
System recovery mksysb -i /dev/rmt0 /opt/ignite/bin/make_recovery /usr/sys/bin/btcreate
tape
Backup savevg -i rootvg vinum saveconfig fbackup tar cvf /dev/rst0 / ufsdump vdump
Restore restvg frecover tar xvf /dev/rst0 ufsrestore vrestore
MISC AIX FreeBSD HP-UX LINUX(RedHat) SOLARIS Tru64
Startup script /etc/rc /etc/rc /sbin/rc /etc/rc.d/rc /etc/init.d /sbin/init.d
Kernel /usr/lib/boot/unix_up /kernel /stand/vmunix /boot/vmlinuz /kernel/genunix /vmunix
Kernel sysdef
lsattr -E -l sys0 sysctl -a kmtune sysctl -a sysdef -i sysconfig
Parameters kmsystem dxkerneltuner
cd /usr/src/linux
make mrproper
make menuconfig
cd /stand/build
/usr/lbin/sysadm/system_prep
make dep
make clean
http://www.unixguide.net/unixguide.shtml[22-09-2023 23:42:13]
UNIXguide.net ( AIX, FreeBSD, HP-UX, LINUX, SOLARIS & Tru64)
cd /sys/i386/conf -v -s system
vi system make bzImage
vi KERNEL
mk_kernel -s system make install
config KERNEL
Reconfigure the cd cd /stand make modules vi /etc/system doconfig
kernel chdev -l sys0 -a ../../compile/KERNEL make modules_install reboot
mv system system.prev
make depend
mv vmunix vmunix.prev
make
mv dlkm dlkm.prev
cp arch/i386/boot/bzImage
make install /boot/vmlinuz-2.2.16
mv /stand/build/system system
kmupdate mkinitrd /boot/initrd-
/stand/build/vmunix_test
2.2.16.img 2.2.16
vi /etc/lilo.conf
lilo
List modules genkex kldstat kmadmin -s lsmod modinfo
Load module kldload kmadmin -L insmod modload
Unload module kldunload kmadmin -U rmmod modunload
Initialize
system install_assist /stand/sysinstall set_parms initial netconf sys-unconfig netsetup
Physical RAM bootinfo -r sysctl hw.physmem grep -i Physical free prtconf uerf | grep memory
/var/adm/syslog/syslog.log
Kernel Bits bootinfo -K getconf KERNEL_BITS getconf LONG_BIT isainfo -kv 64
Crash utility crash crash adb lcrash crash kdbx
Trace System syscalls truss tusc strace truss trace
Calls
http://www.unixguide.net/unixguide.shtml[22-09-2023 23:42:13]
UNIXguide.net ( AIX, FreeBSD, HP-UX, LINUX, SOLARIS & Tru64)
software pkginfo -p
List all files lslpp -f fileset pkg_info -L package swlist -l file fileset rpm -ql package pkgchk -l package setld -i package
List installed instfix -i swlist -l patch patchadd -p dupatch -track -type
patches what /stand/vmunix patch
Package owner lslpp -w path swlist -l file | grep path rpm -qf file pkgchk -l -p path
SW Directory /usr/lpp /var/db/pkg /var/adm/sw/ /var/lib/rpm /var/sadm /var/adm/smlogs
Devices AIX FreeBSD HP-UX LINUX(RedHat) SOLARIS Tru64
Devices /dev /dev /dev /dev /devices /dev
drvconfig
Install devices devlinks
for attached cfgmgr -v /dev/MAKEDEV insf -e /dev/MAKEDEV scu scan edt
disks scsimgr -scan_all
peripherals
tapes
ports
Remove device rmdev -l rmsf rem_drv
Device drivers lscfg lsdev prtconf -D
CPU lsdev -Cc processor sysctl hw.model ioscan -fnC processor cat /proc/cpuinfo psrinfo -v psrinfo -v
List Terminal lsdev -Cc tty ioscan -fnC tty pmadm -l
/usr/platform/`uname -m`/
lspci sbin/prtdiag
Diagnostics diag pciconf -l stm pnpdump ok test-all
/opt/SUNWvts/bin/sunvts
Whole Disk /dev/hdisk# /dev/ad0s1c /dev/dsk/c#t#d0 /dev/sda /dev/c#t#d0s2 /dev/rz0c
CDROM /dev/cd0 /dev/acd0c /dev/dsk/c#t2d0 /dev/cdrom /dev/dsk/c#t6d0s2 /dev/rz3c
CDROM file type cdrfs cd9660 cdfs iso9660 hsfs cdfs
Rewinding tape /dev/rmt0 /dev/rwt0d /dev/rmt/0m /dev/rst0
{ /dev/rmt/0 /dev/rmt0
drive c 9 0}
Non-rewinding /dev/rmt0.1 /dev/nrwt0d /dev/rmt/0mn /dev/nrst0
{ c 9 /dev/rmt/0n /dev/nrmt0
tape drive 128 }
Floppy drive /dev/rfd0 /dev/fd0 - /dev/fd0 /dev/diskette /dev/fd0c
Links AIX FreeBSD HP-UX LINUX(RedHat) SOLARIS Tru64
FAQ AIX-FAQ FreeBSD FAQ HP-UX FAQ LINUX FAQ Solaris 2 FAQ Tru64 FAQ
Linux Documentation
Online Manual AIX 5.3 Docs FreeBSD Hand Book HP-UX Reference Manual Project Solaris 10 Documentation Tru64 Documents
Technical p5 TechSupport IT Resource Center Red Hat support SunSolve Alpha Systems Support
Support
Phone Number 1-800-CALL-AIX 1-800-633-3600 1-888-REDHAT1 1-800-USA-4SUN 1-800-474-6836
Public Domain Software Tru64 Demos, Shareware &
Free Software Library FreeBSD Primary Site HP-UX Ports Linux Software Map Sun Freeware Freeware
Certification www.ibm.com education.hp.com RHCE suned.sun.com ASE Information
http://www.unixguide.net/unixguide.shtml[22-09-2023 23:42:13]