Sunteți pe pagina 1din 8

Unix Commands http://www.datadisk.co.uk/html_docs/misc/unix_...

Common Unix Commands


Sysinfo Display system information i.e cpu, memory, etc
Memory and Swap Information regarding the physical memory and swap area
Disks, Filesystems and Devices Displaying disk information, filesystems
Networking Display and configuring network parameters
Crash Dump Configure, display and use the crash dump utiltities
Performance Monitoring and Diagnostics List, Monitor and trace processes
Kernel Modules and Parameters Displaying, modifying and tuning kernel parameters
Services Display, start and stop services
Patching / Packages Installing and removing patches and software packages
Accounts Setting up and removing user accounts
NFS Information on NFS i.e starting, stopping, etc
NTP Network Time Protocol
Log Files Location to common log files
Security Security information
Misc Other stuff i.e shutdown, timezone, run level, etc

sysinfo

Solaris Red Hat Ubuntu/Debian HP-UX AIX


cat /etc/release cat /etc/enterprise-release cat /etc/lsb-release /stand/kernrel
cat /etc/redhat-release
lsb_release -a
Server Release info lsb_release -a oslevel -r Server Release info

cat /proc/version

/usr/platform/`uname -i`/sbin/prtdiag -v dmidecode dmidecode prtconf | grep -i 'System Model'


model
Server type Server type
uname -a

lspci
prtdiag -v lspci lsusb ioscan lscfg -v
prtconf -D lsusb lshal ioscan -fun [disk|tape|lan] lscfg -l ent0
prtpicl -v [-c <class>] lshal lscfg -vl fcs0 (find the WWN of HBA adapter)
/opt/ignite/bin/print_manifest
picl = platform information and control Note: hal = hardware abstraction layer cat /var/opt/ignite/local/manifest/manifest.info lsdev
library lsdev -Cc disk
lsdev -Cc disk -p scsi0
Hardware Info Hardware Info
lsslot -c [pci|phb|port]
lsslot -c pci -l ent0

lspath -l hdisk0

diag

Operating System uname -a uname -a uname -a uname -a oslevel [-r|-s] Operating System
/usr/platform/`uname -i`/sbin/prtdiag -v prtconf -m
prtconf | grep -i mem cat /proc/meminfo (detailed) cat /proc/meminfo (detailed) dmesg | grep -i physical prtconf |grep -i memory
free -om free -om /usr/sam/lbin/getmem lsattr -El sys0 -a realmem
Memory /opt/ignite/bin/print_manifest bootinfo -r Memory
cat /proc/slabinfo cat /proc/slabinfo
cat /var/opt/ignite/local/manifest/manifest.info

cat /proc/cpuinfo (detailed) cat /proc/cpuinfo (detailed) prtconf |grep -i processor


/usr/platform/`uname -i`/sbin/prtdiag -v /opt/ignite/bin/print_manifest
sam -> performance monitors -> system properties
## display,offline,online
CPU (type, number, etc) psrinfo cat /var/opt/ignite/local/manifest/manifest.info CPU (type, number, etc)
psradm -f 0 (offline)
psradm -n 0 (online)

fdisk -l fdisk -l ioscan -funC disk lsdev -Cc disk


format sfdisk -l (advanced server) sfdisk -l (advanced server) lsdev -Cc disk -p scsi0 (specific controller)
prtvtoc <device> parted <device> print parted <device> print lsdev -Cc disk -S [a|d|s] (available, defined, stopped)
partprobe -s <device> partprobe <device>
format -e (to convert EFI (zfs) to SMI) lscfg -v -l hdisk0
Disk Drives Disk Drives
smartctl -a <device>
Note:
EFI - Extensible Firmware Interface
SMI - Sun Microsystems Inc

/boot/initrd.?????.img /boot/initrd.img-?????-server /stand/vmunix /unix


/kernel/genunix /boot/vmlinuz /boot/vmlinuz-????-server
/usr/lib/boot
Kernel File and associated /platform/`uname -m`/kernel /usr/lib/drivers Kernel File
directories /platform/i86pc/kernel
/kernel Note: /unix - symbolic link to kernel file i.e /usr/lib
/usr/kernel /boot/unix_64

isainfo -kv (solaris 9+) uname -a uname -a prtconf -k


isalist (sparc v9 will be listed first) uname -m uname -m getconf KERNEL_BITS ( version 11) bootinfo -K
isainfo -b getconf -a |grep -i 'long_bit' getconf -a |grep -i 'long_bit' /opt/ignite/bin/print_manifest |grep -i 'os mode'
cat /proc/version
HPUX < version 11 all 32 bit
Kernel 32 or 64 Kernel 32 or 64
Note: determine if system supports 64 bit
getconf HW_CPU_SUPP_BITS
/opt/ignite/bin/print_manifest |grep -i 'hw capability'

At the OK prompt type banner boot into the BIOS (normally F2 or F12) boot into the BIOS (normally F2 or F12) prtconf |grep -i firmware
workstations: lscfg -pv
reboot invscout
Display Firmware enter PDC Display Firmware
type: IN (information menu)
type: FV (Firmware Version)

n/a /proc/interrupts /proc/interrupts n/a prtconf


Display IRQ, IO ports and
Display IRQ, IO ports and DMA /proc/ioports /proc/ioports
DMA
/proc/dma /proc/dma
admintool linuxconf linuxconf sam smit
GUI admin tool GUI admin tool
smitty

Memory and Swap

Solaris Red Hat Ubuntu/Debian HP AIX


/usr/platform/`uname -i`/sbin cat /proc/meminfo (detailed) cat /proc/meminfo (detailed) prtconf -m
/prtdiag -v free -om free -om dmesg | grep -i physical prtconf |grep -i memory
prtconf | grep -i mem /usr/sam/lbin/getmem lsattr -El sys0 -a realmem
Memory /opt/ignite/bin/print_manifest bootinfo -r Memory

cat /var/opt/ignite/local/manifest/manifest.info

page size /usr/bin/pagesize /usr/bin/getconf -a| egrep -i /usr/bin/getconf -a| egrep -i dmesg |grep -i physical pagesize
page size (memory)
(memory) 'pagesize|page_size' 'pagesize|page_size' pagesize -a (display all supported pagesizes)
swap -l cat /proc/swaps (detailed) cat /proc/swaps (detailed) swapinfo (displayed in KB) lsps -a (detailed)
display swap swap -s swapon -s swapon -s swapinfo -m (display in Mb) lsps -s display swap
swapinfo -tm (total / Mb)
device: Create logical volume or filesystem mkps -a -s 4 -n <volume group>
mkfile 5m /var/swapfile device: create partition with fdisk (type 82)
swap -a /var/swapfile create partition with fdisk (type 82) file(create 50MB swap file): swapon <device> | -f <logical device> # change the attributes
file(create 50MB swap file): dd if=/dev/zero of=/var/swapfile swapon -p 3 <device> | -f <logical device> chps -a n paging00 (don't use after restart)
update /etc/vfstab dd if=/dev/zero of=/var/swapfile bs=1024 count=50000
bs=1024 count=50000 update /etc/fstab # change the logical volume attributes (name in this case)
mkswap <device>|<file> chlv -n <new name> <old old> (chang page space name)
adding swap mkswap <device>|<file> adding swap
swapon <device>|<file> Note: -p = priority swap number . The nswapdev
swapon <device>|<file> tunable system parameter controls the maximum Note:
update /etc/fstab number of swap devices.
update /etc/fstab -a reconfigure paging space after restart
-s size of the page space (logical partitions)
-n activiates the paging space (use swapoff to deactivate)

1 of 8 04/28/2014 04:32 PM
Unix Commands http://www.datadisk.co.uk/html_docs/misc/unix_...

also see /etc/swapspaces file


update /etc/vfstab swapoff <device>|<file> swapoff <device>|<file> remove entry from /etc/fstab swapoff /dev/paging00
removing swap -d reboot rmps paging00
removing swap
swap Remove device or file as normal Remove device or file as normal
Note: paging space must be deactiviated before removing

Disks, Filesystems and Devices

Solaris Red Hat Ubuntu/Debian HP AIX


fdisk -l ioscan -funC disk lsdev -Cc disk
format fdisk -l sfdisk -l (advanced server) lsdev -Cc disk -p scsi0 (specific controller)
prtvtoc <device> sfdisk -l (advanced server) parted <device> print lsdev -Cc disk -S [a|d|s] (available, defined,stopped)
cfgadm -al parted <device> print partprobe <device>
fcinfo hba-port partprobe <device> lscfg -v -l hdisk0
luxadm probe
mpathadm list initiator-port udevadm info -q all -n /dev/sda1
mpathadm show <initiator-port name> blkid
Disk Drives iscsiadm list initiator-node dmsetup [ls|info] Disk Drives
iscsiadm list discovery

format -e (to convert EFI (zfs) to SMI)

Note:
EFI - Extensible Firmware Interface
SMI - Sun Microsystems Inc

format hdparm -i /dev/hda hdparm -i /dev/hda lscfg -vl hdisk0


iostat -En hdparm -I /dev/hda (detailed) hdparm -I /dev/hda (detailed) diskinfo -v /dev/rdsk/c0t4d0 (detailed but no serial lscfg -vl hdisk*
luxadm inq <disk> (A5x00 disk arrays) number)
hdparm -Tt /dev/hda (speed test) haparm -Tt /dev/hda (speed test) /opt/ignite/bin/print_manifest (no serial number)

sdparm -i /dev/sdb sdparm -i /dev/sdb ## Insure that the online diagnostic support tools have
been installed
cat /proc/ide/ide0/hda/model cat /proc/ide/ide0/hda/model swlist -l bundle | grep 'Support Tools'
Disk serial Number, type, cat /proc/scsi/scsi cat /proc/scsi/scsi
## Command-Line Support Tools Manager (cstm) Disk serial Numbe
etc
## The run cstm
cstm
cstm> map
cstm> sel dev 4 (select the disk of you choice)
cstm> info
cstm> il (obtain the serial number)
cstm> quit

prtvtoc <device>
fdisk -l fdisk -l lvlnboot -v /dev/vg00 lsvg -l rootvg
cat /etc/vfstab sfdisk -l (advanced server) sfdisk -l (advanced server) lifls -Clv <device> lchangelv

cat /proc/partitions (very high level) cat /proc/partitions (very high level) # Display the LIF contents cat /etc/filesystems
cat /etc/fstab cat /etc/fstab lifcp /dev/dsk/c0t6d0:AUTO -

cat /etc/fstab
Disk disk partitions Disk disk partitions
Note: Boot programs are stored in the boot area in
Logical Interchange Format (LIF), which is similar to a
file system. For a device to be bootable, the LIF
volume on that device must contain at least the ISL
(the initial system loader) and HPUX (the HP-UX
bootstrap utility) LIF files. ISL is like GRUB.

use format to partition the disk then just use the mknod /dev/rawctl c 162 0 Just create a new LVOL without a filesystem - that's it.
slice as a raw partition, remember to use the ## Old way mknod /dev/raw/raw0 c 162 1 Just create a new LVOL without a filesystem
character device /etc/sysconfig/rawdevices mknod /dev/raw/raw1 c 162 2
service rawdevices start ln -s /dev/rawctl /dev/raw/rawctl # create a raw volume
chkconfig rawdevices on mklv -y rawVolume vg01 10
## map raw devices to the disk
List Raw Partitions ## New way, Edit below file raw /dev/raw/raw1 /dev/sdb1 List Raw Partitions
/etc/udev/rules.d/60-raw.rules
udevinfo -d or udevadm info ## display raw devices
raw -qa
## Display raw partitions
raw -qa

format (use analyse ) badblocks badblocks dd if=/dev/rdsk/cXtYd0 of=/dev/null bs=1024K chlv -b [y|n] <lv>
Bad Blocks
Note: no errors means disk is good Note: enables bad block relocation
df -k df -k df -k bdf df -k
Filesystem commands df -h df -h df -h df [-egiklnvfb] lsfs [<filesystem>] Filesystem comm
lsfs -q <filesystem> (detailed)
newfs -v <raw device> mkfs -t ext3 /dev/sdb1 newfs -F vxfs -o largefiles /dev/vg01/rlvol1
mkfs -t ext3 /dev/sdb1 crfs -v jfs2 -d data02lv -m /data02 -A yes
# Display how the filesystem was created mke2fs -t ext4 /dev/sdb1 mkfs -F vxfs -o largefiles /dev/vg01/rlvol1
newfs -Nv <filesystem> -v filesystem type
# all point to mke2fs Note: mkfs and newfs are a pointer to -d device or logical volume
mkfs.ext2 /sbin/fs_wrapper -m mountpoint
mkfs.ext3 -A mount after restart [yes|no]
Filesystem (create|remove) mkfs.ext4 Filesystem (crea
rmfs -ri /data02
cat /etc/mke2fs.conf
-r remove the mountpoint
-i display warning before removing

chfs -a size=+1G /var (grow by additional 1GB)


chfs -a size=1G /var (grow to 1GB in size)

tunefs tunefs -v <filesystem> chfs


fstyp -v <device> |grep -i minfree tune2fs tune2fs vxtunefs -v <filesystem>
tune2fs -l /dev/sda1 tune2fs -l /dev/sda1 fstyp -v <filesystem> Note: you can perform the following
resize
Tune Filesystems # change reserved blocks percentage to 1% # change reserved blocks percentage to 1% Tune Filesystem
# Disk fragmentation freeze
tune2fs -m 1 /dev/sda1 tune2fs -m 1 /dev/sda1 fsadm -F vxfs -E / (report) change mountpoint
fsadm -F vxfs -e / (defrag) permissions
lots more..............................
touch /forcefsck n/a
touch /forcefsck shutdown -r now
shutdown -Fr now
fsck.mode=force (kernel parameter)
Force fsck # Check to see filesystem needs checking tune2fs -l /dev/sdb<?> |grep -i 'filesystem state' Force fsck
# Look at the second line to see if a filesystem
fstyp -v <filesystem> | grep fsclean
tune2fs -l /dev/sdb<?> |grep -i 'filesystem state' # needs checking
# edit /etc/default/rcS change below so
tunefs -v <filesystem>
# you dont have to hang around
FSCKFIX=yes
ufsdump|ufsrestore dump/restore dump/restore fbackup/frecover backup|restore
tar tar tar dump/restore tar
dd dd dd ftio dd
backup filesystem backup filesystem
cpio cpio cpio tar cpio
dd
cpio
eeprom |grep boot-device cat /boot/grub/menu.lst setboot bootinfo -b (display last boot device)
prtconf -pv |grep bootpath cat /boot/grub/grub.conf bootlist -m [normal|service] -o (display bootable devices)
prtpicl -v|grep ':bootpath' cat /etc/lilo.conf
Display the boot device Display the boot d
grub = grand unified boot loader
lilo = linux loader

setenv boot-device [<device>|<alias>] /boot/grub/menu.lst setboot -p <primary path> bootlist -m normal hdisk0 hdisk1
eeprom boot-device [<device>|<alias>] /boot/grub/grub.conf setboot -a <alternate path>
/etc/lilo.conf
Setting the boot device Setting the boot dev
# autoboot sequnce
setboot -b [on|off]

installboot /usr/platform/`uname -i`/lib/fs/ufs grub-install <raw-device> grub-install <raw-device> mkboot -l <device> bosboot -a (uses default device)
Creating boot device (MBR) /bootblk <raw-device> lilo -v bosboot -ad hdisk1 Creating boot d
Note: we are treating the disk as a LVM device
fdformat -v -U floppy --probe (use device obtained below ) n/a n/a format -d /dev/rfd0
volcheck -v floppy --createrc > /etc/fd0 format -d /dev/fd0.18 (high format)
Format floppy drive Format floppy drive
newfs -v /vol/disk/aliases/floppy0 floppy --format /dev/fd0
mkfs /dev/fd0
volrmmount -l floppy0 mount /dev/fd0 /mnt/floppy n/a n/a mount /dev/rfd0 /floppy
mount/unmount floppy mount/unmount flo
eject floppy umount /mnt/floppy
mount -F hsfs -o ro <device path> /cdrom mount -rt iso9660 /dev/cdrom /mnt/cdrom mount -v cdrfs -r /dev/cd0 /cdrom
/cdrom0 mount -rt iso9660 /dev/cdrom /mnt/cdrom umount /mnt/cdrom mount -rF cdfs /dev/dsk/c1t6d0 /cdrom umount /cdrom
umount /cdrom/cdrom0 umount /mnt/cdrom eject cdrom
mount/unmount CDROM eject cdrom start: /usr/sbin/pps_mountd mount/unmount CDROM
/etc/init.d/volmgr start pps_mount
eject cdrom

2 of 8 04/28/2014 04:32 PM
Unix Commands http://www.datadisk.co.uk/html_docs/misc/unix_...

lofiadm -a <iso image> /dev/lofi/1


mount -F hsfs -o ro /dev/lofi/1 /mnt
mount/umount ISO image
# to list
lofiadm

n/a mount -o remount,rw / mount -o remount,rw / mount_vxfs -o remount,ro <filesystem>


mount -o remount,rw <filesystem>
remount a filesystem remount a filesys
Note:I did find a note that it should be possible to remount a
jfs2 filesystem, but it did not work on my system

n/a mkbootdisk `uname -r` (boot diskette) n/a recovery tape (preview) mksysb
create boot disk or
make_tape_recovery -v -l -x inc_entire=vg00 create boot disk or r
recovery tape
/opt/ignite/bin/make_recovery -ACv
ok> boot cdrom -s using the grub window append the word single to using the grub window append the word single to enter PDC based on a 9114-275 workstation
the kernel line the kernel line > search
>boot p1 (cdrom) 1. Restart the machine.
interact with IPL? Y 2. Wait the the AIX splash screen to come up. Devices
boot cdrom/diskette (single ISL> hpux -is begin to initialize here.
boot cdrom/disk
user) 3. When you see the [keyboard] word on screen hit the
F5 button or the 5 key depending on your console.
4. Choose “default boot list ” when the maintenance
screen comes up.

ok> boot -as f10 or f12 f10 or f12 >boot pri based on a 9114-275 workstation
interact with IPL? Y
ISL> hpux -lm 1. Restart the machine.
2. Wait the the AIX splash screen to come up. Devices
begin to initialize here.
boot into maintenace mode 3. When you see the [keyboard] word on screen hit the boot into mainte
F5 button or the 5 key depending on your console.
4. Choose “select boot options ” when the maintenance
screen comes up, then option 1, then option 1 for
scsi, then option 3 service mode boot

floppy:
floppy: floppy: floppy: floppy:
disk: /dev/fd0 /dev/fd0 n/a /dev/fd0
/dev/dsk/c0t0d0s0 /dev/rfd0
disk: disk: disk:
tape: /dev/hda or /dev/sda /dev/hda or /dev/sda /dev/dsk/c0t6d0 disk:
/dev/rmt/0ucb /dev/hdb or /dev/sdb /dev/hdb or /dev/sdb /dev/hdisk0
Device paths tape: Device paths
cdrom: tape: tape: /dev/dsk/rmt/0 tape:
/dev/dsk/c0t6d0s0
cdrom: cdrom: cdrom: cdrom:
/dev/scd0 (external usb cd)
/dev/hda (depends on number of IDE disks) /dev/hda (depends on number of IDE disks) /dev/dsk/c1t6d0 /dev/cd0

drvconfig /dev/MAKEDEV <device> /dev/MAKEDEV <device>


devlinks insf -C tape (Class) cfgmgr
disks|tapes|ports cfgmgr -l scsi0
update /dev directory insf -H 0.1.0 -e (recreate deleted link) update /dev dire

devfsadm ( solaris 8, 9, 10) mkdev

rem_drv # remove all devices from a hardward path rmdev


rmsf -k -H 52.6.0 rmdev -l cd0
remove or change a device remove or change a
chdev
chdev -l rmt0 -a ret=no
prtconf -D cat /proc/devices cat /proc/devices lsdev
sysdef lsdev
lsdev -Cc disk
lsdev -Cc disk -p scsi0

lsslot -c pci -l ent0

list device drivers lscfg list device drive


lscfg -l ent0
lscfg -vl fcs0 (find the WWN of HBA adapter)

lspath -l hdisk0

getconf DISK_SIZE hdisk1 (detailed)

Networking

Solaris Red Hat Ubuntu/Debian HP AIX


/etc/hostname.hme0 /etc/sysconfig/network /etc/network/interfaces /etc/rc.config.d/netconf stores information in the ODM (Object Database Manager) Basic network
Basic network information
/etc/sysconfig/network-scripts/ifcfg-eth0 information
(hostname, ip address)
(hostna
ifconfig ifconfig ioscan -funC lan (list hardware) ifconfig -a
prtdiag -v system-config-network (GUI) lanscan -v (list configured)
ifconfig -a ifconfig lan0 (individual) entstat -d <interface>

kstat hme:0:parameters:<param name> lsdev -Cc if


kstat e1000g:0:parameters:<param name> lsdev -Cc tcpip

module:instance:name:statistics odmget -q "name=en0" CuAt

# Solaris 11 lsattr -EHl en0


netadm list
displaying network
displaying network interfaces
interface
dladm show-phys
dladm show-link
dladm show-linkprop
dladm show-vnic
dladm show-etherstub

ipadm show-if
ipadm show-ifprop
ipadm show-addr
ipadm show-addrprop

ifconfig ifconfig ifconfig <interface>


ifconfig mktcpip (completely setup a network interface)
rmtcpip (remove all network interfaces)
# Solaris 11 - Automatic (using profiles)
netadm enable -p ncp Automatic # configure an interface
netcfg (use by Automatic) mktcpip -h aix1 -a 192.168.1.200 -m 255.255.255.0 -i en1
-g 192.168.0.10
# Solaris 11 - Manual
netadm enable -p ncp DefaultFixed -h - hostname assigned to interface
netcfg -a - ip address
-m - netmask Configure
Configure network interface
dladm create-vnic -i - interface name interface
dladm delete-vnic -g - gateway ip address
dladm rename-link
# remove an interface
dladm create-etherstub ifconfig en1 detach

ipadm create-ip net1 ifconfig (configures IP address)


ipadm create-addr -T static -a 192.168.0.110/24 net1/pfv
ipadm delete-ip chdev (add aliases to network interface)
ipadm delete-addr

ifconfig qfe0 up /sbin/ifup eth0 /sbin/ifup eth0


ifconfig qfe0 down /sbin/ifdown eth0 /sbin/ifdown eth0 ifconfig lan0 up ifconfig en0 up
ifconfig lan0 down ifconfig en0 down
Starting and stopping a network Starting and stopping a
ifconfig en0 detach (remove)
interface note: there is no "ifconfig -a" in hpux use lanscan then network in
"ifconfig <interface>"

ndd -set <device> <parm> <value> (dynamically) mii-tool -F 100baseTx-FD eth0 ethtool -s eth1 speed 100 duplex full ndd -set <device> <parm> <value> chdev -l ent0 -a media_speed=1000_Full_Duplex -P
/etc/system (edit and update then reboot - permanent) ethtool -s eth1 speed 100 duplex full lanadmin -X <option> lan0 chdev -l ent0 -a media_speed=Auto_Negotiation -P
Setting NIC speed Setting NIC spe
Note:
entX - physical device
enX - frame type run on entX
ethtool eth0
ndd -get <device> <parm> mii-tool -v lanadmin -> lan -> display netstat -v
ethtool eth1 sysctl -a |grep net* entstat -d <interface>
Change NIC parameters # List parameters ethtool -t eth0 online ## options supported NIC spee
ndd -get /dev/hme \? ndd -get /dev/ip ? no -a
ndd -get /dev/e1000g0 \? sysctl -a | grep net* ndd -get /dev/tcp ? no -o "ipforwarding=1"

3 of 8 04/28/2014 04:32 PM
Unix Commands http://www.datadisk.co.uk/html_docs/misc/unix_...

ndd -get /dev/ip \? ndd -get /dev/arp ?


ndd -get /dev/tcp \? ndd -get /dev/udp ?

netstat -i [-I interface] netstat -i [-f inet]


Display NIC statistics netstat -s netstat -s Display n
entstat -d <interface>
ifconfig -a (as user root) ifconfig ifconfig lanscan netstat -ia
display MAC address display MAC a
system-config-network (GUI)
snoop -d <interface>
tcpdump -i <interface> tcpdump -i <interface> nettl -start tcpdump -i <interface>
nettl -status all iptrace -i <interface> <output file>
ethereal (needs to be installed) ethereal (needs to be installed) nettl -tn pduin pduout -e ns_ls_driver -file ipreport (used with iptrace to view reports)
Displayin
Displaying network packets /var/adm/LAN
packets
nettl -stop
Note: you must stop the iptrace by using "kill -15"
use netfmt to display the trace file

/etc/defaultrouter edit /etc/network/interfaces /etc/rc.config.d/netconf route add 0 <gateway IP address>


edit /etc/sysconfig/network
default router route add default <gateway> add: gateway <IP address> Note: there is no file that holds the default router default router
route -p add default <gateway> (persist changes) add: GATEWAY=<IP address>

netstat -rn netstat -rn netstat -rn netstat -rn netstat -rn
display routing table route -n route -n netstat -r -f inet display ro
lsattr -EHl inet0 -a route
You buy an optional product called Auto-Port smitty etherchannel (creates, deletes and tests)
if_mpadm -d (detach) ifenslave -d bond0 eth1 (detach) ifenslave -d bond0 eth1 (detach) Aggragation.
if_mpadm -r (reattach) ifenslave bond0 eth1 (reattach) ifenslave bond0 eth1 (reattach) entstat -d ent0

tail /var/adm/messages cat /proc/net/bonding/bond0 cat /proc/net/bonding/bond0

# create bonding
/etc/sysconfig/network-scripts/ifcfg-bond0
Test IPMP, Bonding Test IPMP
# modprobe
/etc/modprobe.d/bonding.conf

# for bonding options - use BONDING_OPTS


/etc/sysconfig/network-scripts/ifcfg-bond0

# see bonding mode


cat /sys/class/net/bond0/bonding/mode

/etc/sysconfig/network /etc/hostname set_parms hostname (requires reboot) hostname <new hostname>


change the following files: /etc/hosts /etc/hosts chdev -l inet0 -a hostname=<hostname>

/etc/nodename sysctl -a |grep hostname sysctl -a |grep hostname


/etc/hostname.<interface>
/etc/inet/hosts
/etc/inet/ipnodes
/etc/net - few files in here as well
change the hostname change th
# Solaris 11
svccfg -s system/identity:node listprop config/nodename

svcfg -s system/identity:node setprop config/nodename =


astring: hostname
svcadm refresh system/identity:node
svcadm restart indentity:node

/etc/resolv.conf /etc/resolv.conf /etc/resolv.conf /etc/resolv.conf


/etc/resolv.conf

# Solaris 11 - You need to use the svccfg command


svccfg -s dns/client listprop config/nameserver
svccfg -s dns/client listprop config/search
svccfg -s name-service/switch listprop config/host
svccfg -s name-service/switch listprop config/password

svcprop <pattern>
setup DNS setup DNS
Note: just use listprop on its own to view all options

svccfg -s "dns/client" setprop "config/nameserver =


net_address: (192.168.0.1)"
svccfg -s "dns/client" setprop 'config/domain = astring:
("datadisk.co.uk")'
svccfg -s "name-service/switch" setprop 'config/host =
astring: "file dns"'
svcadm refresh name-service/switch
svcadm refresh dns/client

/etc/nsswitch.conf /etc/nsswitch.conf /etc/nsswitch.conf /etc/netsvc.conf


/etc/nsswitch.conf /etc/host.conf /etc/host.conf /etc/resolv.conf /etc/resolv.conf
/etc/resolv.conf /etc/resolv.conf /etc/resolv.conf /etc/irs.conf (may not be there)
Name service switch file (DNS Name serv
client) # Solaris 11 - you need to use the svccfg command (DNS client)
chnamsv (change name service)
see above rmnamsv (remove a name service)
lsnamsv -C (list name services)
svcadm restart system/name-service-cache:default ## if installed n/a netcdctrl -t dns -e hosts -f
Flush DNS cache Flush DNS c
service nscd restart
/etc/defaultdomain /etc/sysconfig/network (HOSTNAME option) /etc/host /etc/rc.config.d/netconf domainname <domainname>
/etc/resolv.conf /etc/resolv.conf
Domain Name Domain Na
Note: for NIS use the NISDOMAIN option
route -n get <hostname> ip route get <IP address> ip route get <IP address> n/a route -n get <hostname>
Obtain IP Address routing Obtain IP Addre
traceroute traceroute traceroute

Boot (jumpstart) servers: Boot (jumpstart) servers: Boot (jumpstart) servers: Boot (jumpstart) servers: Boot (jumpstart) servers:
rpcinfo -b bootparam 1 rpcinfo -b bootparam 1 rpcinfo -b bootparam 1 rpcinfo -b bootparam 1 rpcinfo -b bootparam 1

NFS servers: NFS servers: NFS servers: NFS servers: NFS servers:
Find Serv
Find Services on the network rpcinfo -b mountd 1 rpcinfo -b mountd 1 rpcinfo -b mountd 1 rpcinfo -b mountd 1 rpcinfo -b mountd 1
network
NIS servers/slaves: NIS servers/slaves: NIS servers/slaves: NIS servers/slaves: NIS servers/slaves:
rpcinfo -b ypserv 1 rpcinfo -u <yp server> ypserv rpcinfo -u <yp server> ypserv rpcinfo -b ypserv 1 rpcinfo -b ypserv 1

Crash Dump

Solaris Red Hat Ubuntu/Debian HP AIX

dumpadm -d diskdump diskdump edit /stand/system sysdumpdev -l (list dump destination)


<device> netdump netdump sysdumpdev -e (estimates dumpsize)
coreadm kdump (part of kexec rpm) kdump (part of kexec rpm) add either: sysdumpdev -L (info)
dump 2/0/1.5.0
crash (used to /etc/kdump.conf (select where you /etc/kdump.conf (select where you dump lvol sysdumpstart -p (start dump primary)
analyse crash dumps) want the dump to go) want the dump to go) dump none sysdumpstart -s (start dump secondary)
Crash Dump adb (used to analyse service kdump start service kdump start Crash Dump
crash dumps) chkconfig kdump on chkconfig kdump on # crash config file # set the dump device permanently
/etc/rc.config.d/savecrash sysdumpdev -p <dump device> -P
## to crash the system ## to crash the system
echo "c" > /proc/sysrq-trigger echo "c" > /proc/sysrq-trigger # analyse dump file
echo "stat\n status\n t -m" | crash /var/adm/ras/vmcore.0
crash (used to analyse crash dumps) crash (used to analyse crash dumps)

Performance Monitoring and Diagnostics

Solaris Red Hat Ubuntu/Debian HP AIX


top (sunfreeware) top top top
prstat sar sar sar topas -P
sar mpstat mpstat w (load average) topas -L (logical partitions)
mpstat w (load average) w (load average) uptime (load average) mpstat
w (load average) uptime (load average) uptime (load average) ps sar -c
uptime (load average) ps ps vmstat w (load average)
CPU ps vmstat vmstat glance uptime (load average) CPU
vmstat procinfo procinfo sam lparstat
oprofile cat /proc/cpuinfo ps
cat /proc/cpuinfo iostat -tT 1
tprof
curt

4 of 8 04/28/2014 04:32 PM
Unix Commands http://www.datadisk.co.uk/html_docs/misc/unix_...

prstat free free top topas


vmstat vmstat vmstat vmstat vmstat
top top top sar sar -b
sar procinfo procinfo sam svmon
Memory Memory
slabtop slabtop glance ps
sar sar ipcs -a
cat /proc/meminfo cat /proc/meminfo lockstat (version 4)
rmss
ndd ethtool ethtool netstat [ent|tok|fddi|atm]stat
netstat mii-tool mii-tool lanadmin netstat
lsof netstat netstat sam netpmon (trcstop to stop trace)
snoop lsof lsof glance
Network Network I/O
route tcpdump tcpdump
ip ip
iptraf iptraf
nmap
sar -d sar -d sar -d iostat topas -D (disk)
iostat iostat iostat sar topas -F (filesystem)
vmstat vmstat vmstat sam iostat
lsof lsof lsof glance sar -D
fcstat (fibre)
lvmstat
Disk Disk I/O
filemon (trcstop to stop)
fileplace

# disk stat history


chdev -l sys0 -a iostat=true
lsattr -HEl sys0 -a iostat
truss -p <pid> strace -p <pid> strace -p <pid> download and install tusc
ppriv -D -e <command> topas
tusc -p <pid> truss
sar
Application Application
probevue
tprof
svmon -P <pid>

NFS nfsstat nfsstat nfsstat nfsstat nfsstat NFS


top
prstat
ps -ef
pargs <pid>
pcred <pid>
pfiles <pid>
pflags <pid>
pgrep <pattern>
pkill <pattern>
pmap <pid>
Process
pldd <pid>
preap <pid>
prun <pid>
psig <pid>
pstack <pid>
pstop <pid>
ptime <pid>
ptree <pid>
pwait <pid>
pwdx<pid>

Kernel Modules and Parameters

Solaris Red Hat Ubuntu/Debian HP AIX


modinfo cat /proc/modules (more detailed) cat /proc/modules (more detailed) kmadmin -k genkex
lsmod lsmod
modinfo <module>
Location:
Location: /lib/modules/`uname -r`/kernel/drivers
display loaded
/lib/modules/`uname -r`/kernel/drivers display loaded modu
modules
Config:
Config: /etc/modprobe.d/options
/etc/modprobe.conf /etc/modprobe.d
/etc/modprobe.d

modload -p drv/<module name> modprobe <module> modprobe <module> kmadmin -L <module name> n/a
load modules load modules
insmod insmod
modunload -i <module number> modprobe -r <module> modprobe -r <module> n/a
rmmod rmmod kmadmin -U <module name>
unload modules unload modules
kmadmin -u <module id>

/etc/system (edit and reboot) /etc/sysctl.conf (edit and update then reboot) /etc/sysctl.conf (edit and update then reboot) kcweb (11i)
sysctl -p <filename> sysctl -p <filename> kctune (11i only) chdev -l sys0 -a <parameter>=<value>
rebuild kernel (< 11i see below) no -a (network)
sysctl -w param=value sysctl -w param=value vmo -a (virtual memory)
nfso -a (NFS)
No reboot (dynamically): No reboot (dynamically): ioo -a (Input/Ouput)
echo "250 32000 100 28" > /proc/sys/kernel/sem echo "250 32000 100 28" > /proc/sys/kernel/sem raso -a (reliability, availability, serviceability)
echo "536870912" > /proc/sys/kernel/shmmax echo "536870912" > /proc/sys/kernel/shmmax schedo -a (processor scheduler)
set kernel parameters
echo "4096" > /proc/sys/kernel/shmmni echo "4096" > /proc/sys/kernel/shmmni set kernel para
(tuning)
echo "2097152" > /proc/sys/kernel/shmall echo "2097152" > /proc/sys/kernel/shmall vi /etc/security/limits
etc............................................. etc............................................. cd /etc/tunables

tunchange, tundefault, tunsave, tunrestore, tuncheck

Note: most parameters are dynamically changed in AIX , for example


memory segments are dynamically adjusted

cat /etc/system sysctl -a sysctl -a kctune (11i only) lsattr -EHl sys0
sysdef -i cat /etc/sysctl.conf cat /etc/sysctl.conf sysdef
display kernel kmtune Note: only a few kernel parameters can be changed
display kernel pa
parameters cat /proc/sys/kernel/sem cat /proc/sys/kernel/sem kmsystem
cat /proc/sys/kernel/shmmax cat /proc/sys/kernel/shmmax /usr/sam/lbin/getkinfo -f /stand/vmunix -o /tmp/kernel.data
etc................................... etc...................................
cd /usr/src/linux-2.5 chdev -l sys0 -a <parameter>=<value>
edit and update file then reboot: edit Makefile (change EXTRAVERSION) cd /stand/build
/etc/system make mrproper /usr/lbin/sysadm/system_prep -v -s system Note: most parameters are dynamically changed in AIX , for example
backup .config edit system file memory segments are dynamically adjusted
make xconfig /usr/sbin/mk_kernel -s ./system
make dep mv /stand/system /stand/system.old
build kernel mv /stand/vmunix /stand/vmunix.old build kernel
make bzImage
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
interprocess ipcs -a ipcs -a ipcs -a ipcs -a ipcs -a interprocess
communication communicat

Services

Solaris Red Hat Ubuntu/Debian HP AIX


service --status-all There is no services or chkconfig There is no services or chkconfig lssrc -a
svcs -a command use the old fashioned way command
svcs -l <service> /etc/init.d/<service> use the old fashioned way /sbin/init.d
display services display services
svcs -vx /<service>
inetadm -l

svcadm enable nfs service nfs start startsrc -s <subsystem>


start services start services
startsrc -g <group>
svcadm disable nfs service nfs stop stopsrc -s <subsystem>
stop services stop services
stopsrc -g <group>
svcadm refresh nfs service nfs reload refresh -s <subsystem>
reload service reload service
svcadm clear nfs (changes state)
svcadm restart nfs service nfs restart stopsrc -s <subsystem>
restart service restart service
startsrc -s <subsystem>
service status svcs nfs service nfs staus lssrc -a service status
service svcs -d network n/a n/a service
dependencies dependencies
service dependants svcs -D network n/a n/a service dependants

# change or add
Service notifications svccfg

5 of 8 04/28/2014 04:32 PM
Unix Commands http://www.datadisk.co.uk/html_docs/misc/unix_...

# verify or confirm
svcprop

/var/svc/log n/a /var/adm/ras


/var/svc/manifest /etc/syslog.conf
service logging, etc /lib/svc/method /etc/rc.tcpip service logging, etc
/etc/svc/repository.db
/system/volatile/svc_nonpersist.db
change service n/a chkconfig --levels 2345 n/a change service
startup nfs on startup
n/a
# Create your stop/start
# script in /etc/init.d
Add a new service
chkconfig --add <script>

Patching / Software

Solaris Red Hat Ubuntu/Debian HP AIX


showrev -p swlist -l bundle instfix -ia
display installed patches patchadd -p swlist -l product display installed patches
swlist -l patch
patchadd patch -p1 <patch> instfix -k
patchadd -M <dir> (multiple patches)
zcat patch46.gz | patch -p1 swcopy (install patch into depot)
adding patch swinstall (install patch from depot) adding patch
Note: -p = # of path stripping
Note: the swagentd daemon must be running

removing patch patchrm patch -R -p1 <patch> swremove installp -r removing patch
pkginfo (all packages) rpm -qa (all packages) dpkg -l swlist -l bundle <bundle>
pkginfo -l (single package) rpm -q (single package) dpkg -S <search string> (search) swlist -l product <product> lslpp -L all (all filesets)
pkgchk -l -p <file> (file belongs) rpm -qf (file belongs) dpkg -S <filename> (file belongs) lslpp -L <package> (single fileset)
rpm -qi <package> (very detailed) dpkg -s <package> (status) ## check a package lslpp -w <file> (file belongs)
# NEW IPS dpkg -p <package> (detailed) swlist -s <full_path/software> lslpp -ha (history of filesets)
pkg list (all packages)
pkg info (single package) rpm -qa (all packages)
pkg search (find packages and files) rpm -q (single package)
display installed packages rpm -qf (file belongs) display installed packages
rpm -qi <package> (very detailed)

oslevel -g (install packkages above os level)

whereis <filename>
which_fileset <filename>

pkgadd rpm -Uhv (updates/installs if not already) dpkg -i <package> swinstall


rpm -ihv (install) swinstall -s <full_path/software> installp -a
# NEW IPS installp -c (cleanup after failed install)
adding package pkg install adding package
pkg update rpm -i

geninstall (generic installer: installp, RPM, etc)

rpm -e <package> dpkg -r <package> (do not remove config files) swremove
pkgrm dpkg -P <package> (remove config files) installp -u (commited packages)
installp -r (applied packages)
# NEW IPS
removing packages removing packages
pkg uninstall <package> rpm -e <package>

geninstall -u <package>

rpm -V <package> n/a swverity <fileset> (see /var/adm/sw/swagent.log) lppchk -v


pkginfo -l
pkginfo -p rpm -V <package>
verify package verify package
# NEW IPS
pkg publisher
pkg verify <package>

pkgchk -l <package> | grep -i pathname rpm -ql <package> dpkg -L <package> (list files) swlist -l file <product>
lslpp -f <fileset>
List files in package # NEW IPS List files in package
pkg contents <package> rpm -ql <package>

# NEW IPS
pkg history
pkg purge-history
pkg freeze
Other package commands
pkg unfreeze
pkg fix
pkg refresh
pkg publisher
/var/sadm /var/lib/rpm /var/lib/dpkg/info /var/adm/sw
/usr/lpp
Package directory Package directory
/var/lib/rpm

List libraries required for binary ldd <file> ldd <file> ldd <file> chatr <file> ldd <file> List libraries required for binar
program program

Accounts

Solaris Red Hat Ubuntu/Debian HP AIX


cat /etc/passwd cat /etc/passwd cat /etc/passwd cat /etc/passwd cat /etc/passwd
display users system-config-users (GUI) logins -x display users
logins -x [-p] lsuser -f ALL (detailed)

useradd
useradd useradd mkuser
create a user useradd create a user
# user defaults system-config-users (GUI) sam useradd
/usr/sadm/defadduser

userdel userdel rmuser


remove a user userdel userdel remove a user
system-config-users (GUI) sam userdel
chuser -a
usermod
usermod usermod passwd -f
modify a user usermod usermod modify a user
system-config-users (GUI) sam passwd -s
chfn <username>
chfn <username><shell>
passwd
change user
passwd passwd passwd passwd pwdadm change user password
password
pwdck -t ALL
create a group groupadd groupadd groupadd groupadd mkgroup <group name> create a group
remove a group groupdel groupdel groupdel groupdel rmgroup <group name> remove a group
modify a goup groupmod groupmod groupmod groupmod chgroup <attribute><group name> modify a goup
/etc/passwd /etc/passwd /etc/passwd /etc/passwd
password files /etc/security/passwd password files
/etc/shadow /etc/shadow /etc/shadow /tcb/files/auth/r/root (trusted system)
id -a id -a id -a id id
whoami whoami whoami whoami whoami
who who who who who
w w w w w
finger finger finger uptime (displays # of users logged in) uptime (displays # of users logged in)
logins -p finger finger
useful user
useful user commands
commands # License information
lslicense
chlicense

# Maximum number of processes for a user


lsattr -D -l sys0 -a maxuproc
chdev -l sys0 -a maxuproc=<number>
groups groups groups groups groups
useful group
setpgrp setprivgrp setgroups useful group commands
commands
newgrp lsgroup ALL
/etc/security/policy.conf /etc/login.defs
Password Policy
/etc/default/passwd

6 of 8 04/28/2014 04:32 PM
Unix Commands http://www.datadisk.co.uk/html_docs/misc/unix_...

passwd chage -l <user>


Password Aging
chage <options> <user>

NFS

Solaris Red Hat Ubuntu/Debian HP AIX


server: mountd, nfsd server: rpc.mountd,nfsd server: rpc.mountd, nfsd
client: statd, lockd client: rpc.statd, lockd server: rpc.mountd,nfsd client: rpc.statd, lockd server: rpc.mountd, nfsd
NFS Daemons NFS Da
client: rpc.statd, lockd client: rpc.statd, rpc.lockd

/etc/dfs/dfstab /etc/exports /etc/exports /etc/exports /etc/exports


NFS files /etc/dfs/sharetab /var/lib/nfs/etab /var/lib/nfs/etab /etc/xtab /etc/xtab NFS files
/etc/rmtab /var/lib/nfs/xtab /var/lib/nfs/xtab
/etc/rmtab /var/lib/nfs/rmtab /var/lib/nfs/rmtab /etc/rmtab /etc/xtab List nfs c
List nfs clients that have a remote mount
remote mount
dfshares showmount -e localhost showmount -e localhost showmount -e localhost exportfs
display nfs shares displa
showmount -e localhost showmount -e localhost
/etc/dfs/dfstab (edit and add share) redhat-config-nfs (GUI) /etc/exports (edit and add share, see below example) mknfsexp -d <directory>
share <path> exportfs -rav (export the shares) /etc/rc.config.d/nfsconf (edit) mknfsmnt
/etc/exports (edit and add share) /etc/exports (edit and add share)
## dfstab example /sbin/service nfs reload /etc/init.d/portmap restart exportfs -a shareall
create nfs share crea
share -F nfs -d "jumpstart" /export/jumpstart /etc/init.d/nfs-kernel-server restart
## /etc/exports example
/export *(rw,fsid=0,insecure,no_root_squash,sync) ## /etc/exports example
/export *(rw,fsid=0,insecure,no_root_squash,sync)
unshare <path> /etc/exports (edit and remove share) /etc/exports (edit and remove share) /etc/rc.config.d/nfsconf (edit) rmnfsexp -d <directory> (unshares and removes from file)
/etc/dfs/dfstab (edit and remove share) /sbin/service nfs reload exportfs -rav (export the shares) exportfs -au (unshare all)
uncreate nfs share exportfs -u /home/vallep exportfs -u <filesystem> un
/etc/exports (edit and remove share) unshareall

/sbin/service nfs start /etc/init.d/portmap start /sbin/init.d/nfs.core start mknfs


/etc/init.d/nfs.server start /etc/init.d/nfs-kernel-server start /sbin/init.d/nfs.server start chnfs
/etc/init.d/nfs.client start /sbin/init.d/nfs.client start
start/change nfs daemons startsrc -s nfsd sta
svcadm enable nfs/server startsrc -s rpc.mountd
svcadm disable nfs/server

/etc/init.d/nfs.server stop /sbin/service nfs stop /etc/init.d/portmap stop /sbin/init.d/nfs.client stop rmnfs
/etc/init.d/nfs.client stop /etc/init.d/nfs-kernel-server stop /sbin/init.d/nfs.server stop
stop nfs daemons stop nf
/sbin/init.d/nfs.core stop stopsrc -s nfsd
stopsrc -s rpc.mountd
nfs status ps -ef|grep < nfs daemons> /sbin/service nfs status /etc/init.d/nfs-kernel-server status ps -ef | grep <nfs daemons> lssrc -a |grep -i nfs nfs status
nfs reload shareall /sbin/service nfs reload exportfs -rav (export the shares) exportfs -a exportfs -av nfs
nfs performanace nfsstat nfsstat nfsstat nfsstat nfsstat nfs
n/a cat /var/lib/nfs/etab cat /var/lib/nfs/etab n/a nfso -a
nfso -o <option>=<value>
nfs Options nfs Options
exportfs (display options)
## Make sure you use NFS version 3 n/a n/a n/a n/a
solaris/redhat mount problems (nfs v3 to so
mount -F nfs -o vers=3 <mount>
v4) prob
<mountpoint>

NTP

Solaris Red Hat Ubuntu/Debian HP AIX


ntpd xntpd xntpd
Time daemons xntpd ntpd Time daemons

/etc/rc.config.d/netdaemons (set XNTPD to 1)


# Solaris 8 /etc/ntp.conf (edit with ntp servers) /etc/default/ntp /etc/ntp.conf /etc/ntp.conf
/etc/ntp.conf dateconfig (GUI) /etc/ntp.conf
/etc/ntp.server startsrc -s xntpd
/etc/ntp.client chkconfig --list ntpd /etc/init.d/ntp [start|stop|restart] stopsrc -s xntpd
chkconfig --level 2345 ntpd on
/etc/rc2.d/xntpd [start|stop] /sbin/service ntpd start lslpp -L all|grep xntpd
ntp setup ntp setup
# Solaris 10
/etc/inet/ntp.server
/etc/inet/ntp.client

svcadm enable ntpd

/lib/svc/method/xntp /etc/sysconfig/ntpd /etc/default/ntp /etc/rc.config.d/netdaemons


startsrc -s xntpd -a "-x"
ntp daemon options ntp daemon options
/etc/rc.tcpip

ntpq -p ntpq -p ntpq -p ntpq -p ntpq -p


NTP Trace commands ntptrace ntptrace ntptrace ntpdate (set the date) ntptrace NTP Trace commands
ntpdate

Log Files

Solaris Red Hat Ubuntu/Debian HP AIX


messages /var/adm/messages /var/log/messages /var/log/messages /var/adm/syslog/syslog.log /var/adm/ras messages
syslog /var/log/syslog /var/log/syslog /var/log/syslog /var/adm/syslog/syslog.log /var/adm/ras syslog
mail /var/log/mail /var/log/mail.* /var/adm/syslog/mail.log /usr/spool/mqueue/syslog mail
cron /var/cron/log /var/log/cron /var/log/cron.log /var/adm/cron/log /var/adm/cron/log cron
/var/adm/ras
/var/adm/messages /var/log/boot /var/log/boot /var/adm/syslog/syslog.log
boot alog -o -t boot boot
dmesg dmesg dmesg dmesg
alog -o -t console
alog -L (list all the logs available)

/usr/lib/errdemon -l (display attributes)


/usr/lib/errdemon (start error logging)
/usr/lib/errstop (stop error logging)

# use with above errorlog file


errpt (summary errorlog report)
Error errpt -a (detailed errorlog report)
logger logger logger logger Error logging
logging errpt -j <identifier> (single errorlog report)

errclear (clears errorlog)


errclear -d <class><days> (clears class errors)

errlogger "message upto 230 chars"

Security

Solaris Red Hat Ubuntu/Debian HP AIX


pwdck -t ALL
Checking the passwd file pwck pwck pwck pwck Checking the passwd file
usrck -t ALL
checking the group file grpck grpck grpck grpck grpck checking the group file
# No reboot required # No reboot required # No reboot required
# Solaris 10 (no reboot) /etc/securetty /etc/securetty /etc/security/user
/etc/default/login # No reboot required
/etc/securetty chsec -f /etc/security/user -s root
# Solaris 11 (no reboot)
console login (allow/deny) console login (allow/deny)
/etc/default/login
Note: you may need to create this file
/etc/user_attr (see below)
if it does not exist
rolemod -K type=normal root

Misc

Solaris Red Hat Ubuntu/Debian HP AIX


grub (GUI) grub (GUI) setboot -p <primary path> bootlist -m normal hdisk0 hdisk1
eeprom lilo (text based) setboot -a <alternate path>
startup startup
setenv boot-device # autoboot sequnce
setboot -b [on|off]

7 of 8 04/28/2014 04:32 PM
Unix Commands http://www.datadisk.co.uk/html_docs/misc/unix_...

shutdown -h (halt) shutdown -h now (halt) shutdown -F (fast shutdown)


shutdown -i5 -g0 -y (power down) shutdown -r (reboot) shutdown -h (halt) shutdown -r now(reboot) shutdown -Fr (fast shutdown and reboot)
shutdown -i6 -g0 -y (reboot) shutdown -f (fast reboot no fsck) shutdown -r (reboot)
shutdown -i0 -g0 -y (OK prompt) shutdown -F (force fsck) shutdown -P (power off)

shutdown reboot -- -r (reboot/reconfigure) touch /forcefsck shutdown

touch /reconfigure # edit /etc/default/rcS change below so


# you dont have to hang around
FSCKFIX=yes

halt halt halt init init


init init init reboot shutdown
poweroff poweroff poweroff shutdown reboot
Change run level reboot reboot reboot telinit Change run level
shutdown shutdown shutdown halt
telinit telinit telinit
uadmin
init status init status
0 0 - halt 0
1 0 - shutdown 0 - halt 1 - single user 0 - halt 0 - reserved 1
2 1 - single user 1 - single user 2 - multiuser (default) 1 - single users 1 - reserved 2
3 2 - n/a 2 - multiuser (no networking) 3 - same as 2 2 - multiuser (networking) 2 - multiuser mode with NFS 3
4 3 - Multi-user 3 - multiuser (networking) 4 - same as 2 3 - multiuser (networking, NFS, and CDE GUI) (default) 3 - user defined 4
5 4 - n/a 4 - unused 5 - same as 2 4 - multiuser (netwrking, NFS, and VUE GUI) 4 - user defined 5
6 5 - power off 5 - GUI 6 - reboot 5 - n/a 5 - user defined 6
6 - reboot 6 - reboot 6 - n/a 6 - user defined
7-9 - user defined

# change default - change all the telinit # change default - change the initdefault line
# change default # change default # change default - change the initdefault line vi /etc/inittab
vi /etc/event.d/rc-default
vi /etc/inittab vi /etc/inittab vi /etc/inittab

boot <option> single - use grub to edit kernel line single - use grub to edit kernel line interact with IPL? Y Based on 9114-275 workstation
emergency - use grub to edit kernel line emergency - use grub to edit kernel line
# Options linux rescue - use at the boot prompt linux rescue - use at the boot prompt # single user 1. switch off the machine
-s single user ISL> hpux -is
-a interactive single: runlevel1, local fs mounted, no network single: runlevel1, local fs mounted, no network 2. power on and enter the SMS menu
Startup options -x no device drivers (used in emergency: root fs read-only, no init files run emergency: root fs read-only, no init files run # Logical volume maintanence mode Startup options
clustering) rescue: use cd-rom/network, root mounted as rescue: use cd-rom/network, root mounted as ISL> hpux -lm Note: to enter the SMS menu press numeric 1
-r reconfigure devices /mnt/sysimage /mnt/sysimage after the word keyboard but before the word
-m milestone # No quroum check speaker
ISL> hpux -lq

/etc/init.d /etc/init.d /etc/init.d /sbin/init.d


/etc/rc.config.d (startup config files) /etc/rc.d
/etc/rc0.d - /etc/rc6.d /etc/rc0.d - /etc/rc6.d /etc/rc0.d - /etc/rc6.d /etc/rc.d/init.d
/sbin/rc0.d - /sbin/rc6.d
/etc/rc.d/rc2.d - rc9.d
startup scripts startup scripts
/etc/rc.* (config files for auto-starting)

also uses the System Resource Controller

F10 or F12 F10 or F12 interact with IPL? Y


boot Based on a 9114-275 workstation
printenv
setenv 1. switch off the machine
banner
devalias 2. power on and enter the SMS menu
boot prompt show-devs boot prompt
commands show-pci-devs-all Note: to enter the SMS menu press numeric 1 commands
probe-scsi-all after the word keyboard but before the word
probe-fcal-all speaker
probe-pci
watch-net-all
reset-all

Phases: Boot sequence Boot sequence Phases: Phases:

Boot PROM: displays system 1. BIOS 1. BIOS 1. PDC - processor-dependent code; executes and Read Only Storage (ROS): check the
information, run POST, load 2. POST 2. POST performs self-tests system board, perform POST, locate and
bootblk, locate ufsboot 3. Master Boot Record (MBR) - point to the 3. Master Boot Record (MBR) - point to the 2. ISL - initial system loader; loads the secondary load boot image, begin system initialization
Boot Programs: bootblk loads bootloader GRUB or LILO bootloader GRUB or LILO system loader hpux and execute phase 1 of the /etc/rc.boot
and executes the ufsboot 4. GRUB (stage 1) - point to GRUB stage 1_5 4. GRUB (stage 1) - point to GRUB stage 1_5 3. HPUX - is the secondary system loader and loads script
Kernel Initialization: ufsboot 5. GRUB (stage 1_5) - deals with specific 5. GRUB (stage 1_5) - deals with specific the kernel /stand/vmunix, then hands over to the Base Device Configuration: start
Boot process Boot process
loads and executes the core filesystem types look at /boot/grub/*1_5 files filesystem types look at /boot/grub/*1_5 files kernel configuration manager to configue base
kernel, initializes core kernel 6. GRUB (stage 2) – reads /etc/grub.conf and 6. GRUB (stage 2) – reads /boot/grub/menu.lst 4. KERNEL - swapper processes are started by the devices
data structures, loads other displays the grub menu, it specifies the kernel and displays the grub menu, it specifies the kernel then starts the init process System Boot: start init process phase 2,
kernel modules based on the and the initrd files kernel and the initrd files 5. INIT - reads /etc/inittab switch to hard-disk root filesystem, start
/etc/system file, starts /sbin/init 7. KERNEL - control given to the kernel 7. KERNEL - control given to the kernel other processes defined by /etc/inittab and
program 8. INIT - reads /etc/inittab and runs /etc/rc.d 8. INIT - runs the /etc/event.d/rc-default script execute phase 3 of the /etc/rc.boot script
init: starts other processes /rc.sysinit script
based on the /etc/inittab file

bootadm list-archive
bootadm update-archive
bootadm list-menu
bootadm set-menu <option>
Boot Environments
(BE) beadm create
beadm rename
beadm activate
beadm list
beadm destroy
determine the run who -r runlevel runlevel who -r who -r
determine the run level
level who -r who -r
obtain default run cat /etc/inittab cat /etc/inittab /etc/event.d/rc-default /etc/inittab /etc/inittab
obtain default run level
level
list locale locale -a locale -a locale -a locale -a locale -a list locale
n/a startx (shorthand of below) n/a n/a
start xwindows start xwindows
initx (lots of parms)
sys-unconfig set_parms [initial|hostname|ip_address|timezone] install_assist
initialize system initialize system
Note: set_parms is in /sbin
/etc/TIMEZONE /etc/sysconfig/clock /etc/timezone /etc/TIMEZONE /etc/environment
Timezone Timezone
/etc/default/init /usr/share/zoneinfo/zone.tab /usr/share/zoneinfo/zone.tab /etc/profile

8 of 8 04/28/2014 04:32 PM

S-ar putea să vă placă și