Unix Commands On Different OS's

Download as xls, pdf, or txt
Download as xls, pdf, or txt
You are on page 1of 24

Directory Mappings 

AIX FreeBSD HP-UX LINUX(RedHat) SOLARIS

/         
Root filesystem /              {/dev/hd4} /       {/dev/ad0s1a} {/dev/vg00/lvol1} /                  {/dev/sda1} /  {/dev/vx/dsk/rootvol}
/export/home
/home     
Home Directory /home          {/dev/hd1} {/dev/vg00/lvol4}        /dev/vx/dsk/home}
/tmp 

/tmp          
/tmp           {/dev/hd3} {/dev/vg00/lvol6} /dev/vx/dsk/swapvol}
/usr      
/usr           {/dev/hd2} /usr    {/dev/ad0s1f} {/dev/vg00/lvol7} /usr 
/var      
/var        {/dev/hd9var} /var    {/dev/ad0s1e} {/dev/vg00/lvol8} /var
Sample configuration
files - /usr/newconfig
User Accounts AIX FreeBSD HP-UX LINUX(RedHat) Solaris
/etc/passwd /etc/passwd /etc/passwd /etc/passwd /etc/passwd 
Password files /etc/security/passwd /etc/master.passwd /tcb/files/auth/r/root /etc/shadow /etc/shadow
/etc/group /etc/group
Groups file /etc/security/group /etc/group /etc/logingroup /etc/group /etc/group

Maximum # of user ID 4294967295 65535 2147483647 65535 2147483647


/etc/security/user /etc/ttys  /etc/securetty /etc/securetty /etc/default/login
Allow/Deny remote {CONSOLE=/dev/cons
login {rlogin=true} {secure} {console} {ttyp1} ole}
60001 &
User nobody's id # 4294967294 65534 -2 99 65534(nobody4)
60002 &
Group nobody's id # 4294967294 65534 -2(nogroup) 99 65534(nogroup)

boot from CD/Tape ok boot -s >boot {lilo} boot cdrom -s


Installation/Maintenanc
e passwd root Interact with IPL ? Y control-x mkdir /tmp/a

mount /dev/c0t0d0s0
Start Limited Shell ISL>hpux -iS linux S /tmp/a

getrootfs hdisk0 passwd root passwd root vi /tmp/a/etc/shadow

vi /etc/security/passwd
{grub}
c

kernel vmlinuz-2.4.9-
13 single  
ro root=/dev/hda8
initrd /initrd-2.4.9-
13.img
boot
Recover root password passwd root
Create new user mkuser adduser useradd useradd useradd
Delete user rmuser rmuser userdel userdel userdel
List users lsuser -f ALL logins logins
Modify user account chuser -a usermod usermod usermod

General Commands AIX FreeBSD HP-UX LINUX(RedHat) Solaris


Unique host ID hostid uname -i hostid hostid
Administrator smit sam linuxconf admintool
top top
Performance monitor monitor top glance top top

System activity reporter sar sa sar sar {sysstat} sar


Virtual Memory
statistics vmstat vmstat vmstat vmstat vmstat
I/O statistics iostat iostat iostat iostat {sysstat} iostat
alog -o -t boot
Error logs errpt dmesg dmesg dmesg  dmesg
Physical RAM 1TB 4TB 64 GB {>2.3.24} 16TB

Shared Memory 2.75GB 8TB sysctl kernel.shmmax


Process Data Space 2GB 4GB 900 MB

Swap device /dev/hd6 /dev/ad0s1b /dev/vg00/lvol2 /dev/sda2 /dev/vx/dsk/swapvol


Swap file type /etc/swapspaces swap swap partition type 82  swap
Display swap size lsps -a swapinfo swapinfo -a free swap -l
Activate Swap swapon -a swapon -a swapon -a swapon -a swap -a
Printers AIX FreeBSD HP-UX LINUX Solaris
Printer Queues /etc/qconfig /var/spool/print /etc/lp/interface/* /var/spool/lpd/lp/* /etc/lp/interfaces/*
Stop LP  stopsrc -s lpd lpshut /etc/init.d/lpd stop /usr/lib/lp/lpshut
Start LP startsrc -s lpd lpd lpsched /etc/init.d/lpd start /usr/lib/lp/lpsched
enq lp
lp lpr
lpr
Submit print jobs qprt lp lp lpr
enq -A
lpq
lpstat
LP statistics qchk lpq lpstat lpq lpstat
cancel cancel cancel

Remove print jobs cancel lprm


lprm lprm lprm
qcan
Remove print jobs enq -x cancel lprm
Add printer queue smit mkpq lpadmin -p pq printtool lpadmin -p pq

Remove Printer queue smit rmpq lpadmin -x pq lpadmin -x pq

Make default printer export LPDEST="pq" lpadmin -d pq lpadmin -d pq


TCP/IP AIX HP-UX LINUX(RedHat) Solaris
/etc/hostname.*
Network IP /etc/sysconfig/network- /etc/inet/*
configuration lsattr -E -l inet0 /etc/rc.conf /etc/rc.config.d/netconf scripts/  /etc/defaultrouter
Hosts IP addresses /etc/hosts /etc/hosts /etc/hosts /etc/hosts /etc/inet/hosts
Name service switch /etc/netsvc.conf /etc/host.conf /etc/nsswitch.conf /etc/nsswitch.conf /etc/nsswitch.conf
Network parameters no -a sysctl ndd -h sysctl -a | grep net ndd /dev/[tcp|ip] ?
Routing daemon gated routed gated routed in.routed
NIC Configurations ifconfig -a ifconfig -a lanscan -v ifconfig -a ifconfig -a
modprobe ip_alias
Secondary IP Address ifconfig en0 alias IP  ifconfig xl0 alias IP ifconfig lan0:1 IP  ifconfig eth0:1 IP ifconfig hme0:1 IP up
HERALD @ BANNER @

Login prompt /etc/security/login.cfg  telnetd -b /etc/issue  /etc/issue /etc/default/telnetd

odmget -q
"attribute=num and
uniquetype=pty/pty/pty" rebuild your kernel with
PdAt | sed "s/0-64/0- these new values
512/" | NPTY=#  cd /dev {/etc/system}

odmchange -q
"attribute=num and
uniquetype=pty/pty/pty" set pt_cnt = #  
-o PdAt NSTRPY=# ./MAKEDEV -v pty {SYSV}
set npty = #      {BSD}
chdev -l pty0
-anum=256 -P reboot
reboot {/etc/iu.ap}

insf -d ptys -n # ptsl 0 # ldterm ttcompat


insf -d ptym -n #
Increase the # of insf -d pts -s # -e -v halt
pseudo-terminals boot -r

176                {BSD}

Maximum # of ptys 512 {MAXUSERS} 256 3000              {SYSV}


remsh
Remote Shell rsh rsh remsh rsh rsh
/ /
usr/lib/netsvc/yp/ypbind / usr/lib/netsvc/yp/ypbin
YP/NIS service binder   /usr/sbin/ypbind usr/lib/netsvc/yp/ypbind  /sbin/ypbind d
System Files AIX FreeBSD HP-UX LINUX(RedHat) Solaris
/etc/dfs/dfstab
NFS exported /etc/exports /etc/exports /etc/exports /etc/exports /etc/dfs/sharetab
NFS Client mounted
directories /etc/xtab /etc/xtab /var/lib/nfs/xtab /etc/rmtab
1 TB
8000 TB {vxfs}
Max File System 128 GB 128 GB 2 TB 
2 GB     {512B block
size}  1 TB
8192 GB  {8KB block
size}  2 GB {=<2.5.1}
Max File Size 64 GB 128 GB
Max # File Descriptors 64 K 60~ K sysctl fs.file-max 64 K
DISK/LVM
Commands AIX FreeBSD HP-UX:Disk &Filesystem LINUX(RedHat) SOLARIS
Filesystem table /etc/filesystems /etc/fstab /etc/fstab /etc/fstab /etc/vfstab
Free disk blocks df -k df -k bdf df -k df -k
Device listing lsdev -C /sbin/ioscan cat /proc/devices sysdef
format -d c#t#d#
cat
diskinfo /proc/scsi/scsi0/sda/mod format>current
Disk information bootinfo -s hdisk#  fdisk -v ad0 /dev/rdsk/c#t#d# el format>inquiry
pvdisplay -v
Disk Label lspv -l hdisk# disklabel ad0 /dev/dsk/C#t#d# fdisk -l prtvtoc
LVM Concepts Partition  sub disk logical extents logical extents sub disk
Volume Volume logical volume logical volume Volume
Plex Plex
Volume group volume group volume group disk group
ext3
Journal Filesystem type jfs vxfs reiserfs vxfs

Default volume group /dev/rootvg /dev/vg00 /dev/vx/dsk/rootdg

Display volume group lsvg -l rootvg vgdisplay -v vg00 vgdisplay -v vxprint -l -g rootdg

Modify physical volume chpv pvchange pvchange

Prepare physical disk mkdev -c disk -l hdisk# pvcreate pvcreate vxdiskadd


List physical volume lspv vinum ld pvdisplay pvdisplay vxprint -dl
Remove disk from
volume group reducevg vgreduce vgreduce vxdg rmdisk
Move logical volumes
to another physical vinum move -f drive
volumes migratepv object pvmove pvmove vxassist move
Create volume group mkvg vgcreate vgcreate vxdg init

Remove volume group vgremove vgremove


chvg
Volume group varyonvg
availability varyoffvg vgchange vgchange

Restore volume group vgcfgrestore vgcfgrestore

Exports volume group exportvg vgexport vgexport vxdg deport

Imports volume group importvg vgimport vgimport vxdg import


Volume group listing lsvg vgscan vgscan

Change logical volume


characteristics  chlv lvchange lvchange  vxedit set
List logical volume lslv vinum lv lvdisplay lvdisplay vxprint -vl
Make logical volume mklv lvcreate lvcreate vxassist make

Extend logical volume extendlv lvextend lvextend vxassist growto

Reduce logical volume AIX reduce LV lvreduce lvreduce vxassist shrinkto

Remove logical volume rmlv vinum rm vol lvremove lvremove vxedit rm

Prepare boot volumes bootlist -m normal lvlnboot lilo vxbootsetup

Remove boot volumes lvrmboot


extendfs /dev/vg00/lvol8 resize2fs vxva
fsadm -F vxfs -b
Extend File system chfs -a size=# /mt {LE * 1024} /mt resize_reiserfs mkfs -M
Reduce/Split mirrors rmlvcopy lvsplit lvsplit
Merge mirrors lvmerge lvmerge

Create mirrors mklv -c 2 vinum mirror drive lvcreate -m 1 vxassist mirror


Add mirrors mklvcopy lv 2  lvextend -m 1

vxassist make vol


Create striped volumes mklv -u 3 -S 64K vinum stripe drive lvcreate -i 3 -I 64 lvcreate -i 3 -I 64 100mb layout=raid5
/
opt/ignite/bin/make_reco
System recovery tape mksysb -i /dev/rmt0 very
Backup savevg -i rootvg vinum saveconfig fbackup tar cvf /dev/rst0 / ufsdump
Restore restvg  frecover tar xvf /dev/rst0  ufsrestore
MISC AIX FreeBSD HP-UX LINUX(RedHat) SOLARIS
Startup script /etc/rc /etc/rc /sbin/rc /etc/rc.d/rc /etc/init.d
Kernel /usr/lib/boot/unix_up /kernel /stand/vmunix /boot/vmlinuz /kernel/genunix
sysdef
kmtune
Kernel Parameters lsattr -E -l sys0 sysctl -a kmsystem sysctl -a sysdef -i
cd /sys/i386/conf cd /stand/build cd /usr/src/linux  vi /etc/system

/
usr/lbin/sysadm/system_
vi KERNEL prep -v -s system make mrproper  reboot
config KERNEL vi system make menuconfig 

cd ../../compile/KERNEL mk_kernel -s system make dep 


make depend cd /stand make clean 
make mv system system.prev make bzImage

make install mv vmunix vmunix.prev make install


mv dlkm dlkm.prev make modules

mv /stand/build/system
system make modules_install

kmupdate
/stand/build/vmunix_test

cp
arch/i386/boot/bzIm
age /boot/vmlinuz-
2.2.16

mkinitrd /boot/initrd-
2.2.16.img 2.2.16
vi /etc/lilo.conf
lilo
Reconfigure the kernel chdev -l sys0 -a 
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

grep -i Physical
/var/adm/syslog/syslog.l
Physical RAM bootinfo -r sysctl hw.physmem og free prtconf

Kernel Bits bootinfo -K getconf KERNEL_BITS getconf WORD_BIT isainfo -kv


Crash utility crash crash adb lcrash crash
Trace System Calls syscalls truss tusc strace truss
uname -m model
Machine model bootinfo -m uname -m uname -m uname -m uname -imp
OS Level oslevel uname -r uname -r uname -r uname -r
Run Level who -r who -r runlevel who -r

Core dump files /var/adm/ras /var/adm/crash /var/crash/`uname -n`

Key on service mode/F4 >boot {lilo}


Boot from CD/Tape Interact with IPL ? Y control-x
Select Maintenance ISL>hpux -iS linux S

Limited function Shell


{grub}
c

kernel vmlinuz-2.4.9-
13 single  
ro root=/dev/hda8
initrd /initrd-2.4.9-
13.img
Boot single user ok boot -s boot ok boot -s
>boot
Interact with IPL ? Y
Maintenance mode ok boot -as ISL>hpux -lm ok boot -as
Interrupt Key control-B Stop-A
Return to console co ok go
/etc/environment /etc/TIMEZONE
Timezone Management /etc/profile /etc/localtime /etc/TIMEZONE /etc/sysconfig/clock /etc/default/init

/
/etc/rc.conf etc/rc.config.d/netdaemo
/etc/ntp.conf {xntpd_enable="YES"} ns /etc/ntp.conf /etc/inet/ntp.conf
NTP Daemon
NTP Daemon startsrc -s xntpd /etc/rc.network /sbin/init.d/xntpd /etc/rc.d/init.d/xntpd /etc/init.d/xntpd
Software AIX HP-UX LINUX(RedHat) SOLARIS
Install Software installp -a pkg_add swinstall rpm -i package pkgadd
Uninstall software installp -u pkg_delete swremove rpm -e package pkgrm

List installed software lslpp -L all pkg_info -a swlist rpm -qa pkginfo
Verify installed pkginfo -i
software lppchk -v swlist -l fileset -a state rpm -V package pkginfo -p
List all files lslpp -f fileset pkg_info -L package swlist -l file fileset rpm -ql package pkgchk -l package
swlist -l patch
List installed patches instfix -i what /stand/vmunix patchadd -p

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
Devices AIX FreeBSD HP-UX LINUX(RedHat) SOLARIS
Devices /dev /dev /dev /dev /devices
drvconfig
devlinks
disks
Install devices for tapes
attached peripherals cfgmgr -v /dev/MAKEDEV insf -e /dev/MAKEDEV 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
List Terminal lsdev -Cc tty ioscan -fnC tty pmadm -l
/usr/platform/`uname
lspci -m`/
pnpdump sbin/prtdiag
ok test-all

Diagnostics diag pciconf -l stm


/
opt/SUNWvts/bin/sunv
Diagnostics diag pciconf -l stm ts
Whole Disk /dev/hdisk# /dev/ad0s1c /dev/dsk/c#t#d0 /dev/sda /dev/c#t#d0s2
CDROM /dev/cd0 /dev/acd0c /dev/dsk/c#t2d0 /dev/cdrom /dev/dsk/c#t6d0s2
CDROM file type cdrfs cd9660 cdfs iso9660 hsfs
/dev/rst0               { c 9
Rewinding tape drive /dev/rmt0 /dev/rwt0d /dev/rmt/0m 0} /dev/rmt/0
Non-rewinding tape /dev/nrst0           { c 9
drive /dev/rmt0.1 /dev/nrwt0d /dev/rmt/0mn 128 } /dev/rmt/0n
Floppy drive /dev/rfd0 /dev/fd0 - /dev/fd0 /dev/diskette
Links AIX FreeBSD HP-UX LINUX(RedHat) SOLARIS
FAQ AIX-FAQ FreeBSD FAQ HP-UX FAQ LINUX FAQ Solaris 2 FAQ

Online Manual AIX 4.3 Books FreeBSD Hand Book HP-UX 11.00 CollectionLinux Documentation Project
Solaris 7 Documentation

Technical Support RS/6000 TechSupport IT Resource Center Red Hat support SunSolve
Phone Number 1-800-CALL-AIX 1-800-633-3600 1-888-REDHAT1 1-800-USA-4SUN

Free Software Bull FreeBSD Primary Site HP-UX Ports Linux Software Map Sun Freeware
Certification www.ibm.com education.hp.com RHCE suned.sun.com
Tru64

/     {/dev/rz0a}

/usr    {/dev/rz0g}

Tru64

/etc/passwd 

/etc/group

65535
/etc/securettys

{ttyp1}

65534
65534

press the HALT Button


or (Control-P)

>>>boot -fl s

lsmbstartup

/sbin/bcheckrc

passwd root

useradd
userdel

usermod

Tru64
hostid
sysman
top

/usr/opt/svr4/bin/sar

vmstat
iostat

uerf -R -o full
4TB

/dev/rz0b
raw
swapon -s
swapon -a
Tru64
/usr/spool/lpd
/sbin/init.d/lpd stop
/sbin/init.d/lpd start
lp
lpr

lpstat
cancel
lprm

lprsetup

lprsetup

export PRINTER="lp"
Tru64

/etc/rc.config
/etc/hosts
/etc/svc.conf

routed
ifconfig -a

ifconfig ln0 alias

/etc/issue

cd /dev

./MAKEDEV PTY_1
8192

rsh

/usr/sbin/ypbind
Tru64

/etc/exports

/var/adm/mountdtab
128 GB {<= 3.2G}
512 GB {>= 4.0}
16 TB {advfs}

128 GB {<= 3.2G}

512 GB {>= 4.0}


16 TB {advfs}
64 K

Tru64
/etc/fstab
df -k

file /dev/rrz0c

disklabel -p rz0
sub disk
Volume
Plex
disk group

advfs

/dev/vol/rootdg

volprint -l -g rootdg

voldiskadd
volprint -dl

voldg rmdisk
volassist move
voldg init

voldg deport

voldg import

voledit set
volprint -vl
volassist make

volassist growto

volassist shrinkto
voledit -g rootdg -rf rm
vol1
volassist make vol
100mb mirror=true

volassist make vol


100mb layout=stripe

/usr/sys/bin/btcreate
vdump
vrestore
Tru64
/sbin/init.d
/vmunix
sysconfig
dxkerneltuner
doconfig

netsetup

uerf | grep memory

64
kdbx
trace

uname -p
sizer -v
who -r

>>> boot -fl s

control-P

/etc/svid3_tz
timezone

rcmgr set XNTPD_CO
NF YES
/sbin/init.d/xntpd
Tru64
setld -l
setld -d

setld -i

setld -v
setld -i package
dupatch -track -type
patch

/var/adm/smlogs
Tru64
/dev
scu scan edt
scsimgr -scan_all

psrinfo -v
/dev/rz0c
/dev/rz3c
cdfs

/dev/rmt0

/dev/nrmt0
/dev/fd0c
Tru64
Tru64 FAQ

Tru64 Documents

Alpha Systems Support

Tru64 Demos, Shareware & Freeware

You might also like