24
AIX FreeBSD HP-UX LINUX(RedHat) SOLARIS Root filesystem Home Directory /export/home /var - /usr/newconfig User Accounts AIX FreeBSD HP-UX LINUX(RedHat) Solaris Password files /etc/passwd /etc/passwd /etc/passwd /etc/master.passwd /etc/shadow /etc/shadow Groups file /etc/group /etc/group /etc/group /etc/group /etc/group /etc/logingroup 4294967295 65535 2147483647 65535 2147483647 /etc/securetty /etc/securetty {rlogin=true} {secure} {console} {ttyp1} 4294967294 65534 -2 99 Directory Mappings / {/dev/hd4} / {/dev/ad0s1a} / {/dev/vg00/lvol1} / {/dev/sda1} / {/dev/vx/dsk/root vol} /home {/dev/hd1} /home {/dev/vg00/lvol4} /dev/vx/dsk/home} /tmp {/dev/hd3} /tmp {/dev/vg00/lvol6} /tmp /dev/vx/dsk/swapv ol} /usr {/dev/hd2} /usr {/dev/ad0s1f} /usr {/dev/vg00/lvol7} /usr /var {/dev/hd9var} /var {/dev/ad0s1e} /var {/dev/vg00/lvol8} Sample configuration files /etc/passwd /etc/passwd passwd r/root group Maximum # of user ID Allow/Deny remote login user /etc/ttys login {CONSOLE=/dev/ console} User nobody's id # 60001 & 65534(nobody4)

Unix Commands on Different OS's

  • Upload
    trrllr

  • View
    205

  • Download
    5

Embed Size (px)

Citation preview

Page 1: Unix Commands on Different OS's

AIX FreeBSD HP-UX LINUX(RedHat) SOLARIS

Root filesystem

Home Directory

/export/home

/var

- /usr/newconfig

User Accounts AIX FreeBSD HP-UX LINUX(RedHat) Solaris

Password files

/etc/passwd /etc/passwd /etc/passwd

/etc/master.passwd /tcb/files/auth/r/root /etc/shadow /etc/shadow

Groups file

/etc/group

/etc/group

/etc/group

/etc/group /etc/group/etc/security/group /etc/logingroup

4294967295 65535 2147483647 65535 2147483647

/etc/security/user /etc/securetty /etc/securetty /etc/default/login

{rlogin=true} {secure} {console} {ttyp1}

User nobody's id # 4294967294 65534 -2 99

Directory Mappings 

/              {/dev/hd4} /       {/dev/ad0s1a}

/          {/dev/vg00/lvol1}

/                  {/dev/sda1}

/  {/dev/vx/dsk/rootvol}

/home          {/dev/hd1}

/home      {/dev/vg00/lvol4}

       /dev/vx/dsk/home}

/tmp           {/dev/hd3}

/tmp       {/dev/vg00/lvol6}

/tmp 

    /dev/vx/dsk/swapvol}

/usr           {/dev/hd2}

/usr    {/dev/ad0s1f}

/usr       {/dev/vg00/lvol7} /usr 

/var        {/dev/hd9var}

/var    {/dev/ad0s1e}

/var       {/dev/vg00/lvol8}

Sample configuration files

/etc/passwd /etc/passwd /etc/security/passwd

Maximum # of user ID

Allow/Deny remote login

/etc/ttys 

{CONSOLE=/dev/console}

60001 & 65534(nobody4)

Page 2: Unix Commands on Different OS's

4294967294 65534 -2(nogroup) 99

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

passwd root control-x mkdir /tmp/a

Start Limited Shell ISL>hpux -iS linux S

getrootfs hdisk0 passwd root passwd root

{grub}

c

boot

passwd root

Create new user mkuser adduser useradd useradd useradd

Delete user rmuser rmuser userdel userdel userdel

List users lsuser -f ALL logins logins

chuser -a usermod usermod usermod

AIX FreeBSD HP-UX LINUX(RedHat) Solaris

Unique host ID hostid uname -i hostid hostid

Administrator smit sam linuxconf admintool

Group nobody's id #

60002 & 65534(nogroup)

Recover root password

Installation/Maintenance Interact with IPL ? Y

mount /dev/c0t0d0s0 /tmp/a

vi /tmp/a/etc/shadow

vi /etc/security/passwd

kernel vmlinuz-2.4.9-13 single   ro root=/dev/hda8

initrd /initrd-2.4.9-13.img

Modify user account

General Commands

Page 3: Unix Commands on Different OS's

top

top

top

top topmonitor glance

sar sa sar sar

vmstat vmstat vmstat vmstat vmstat

I/O statistics iostat iostat iostat iostat

Error logs

alog -o -t boot

dmesg dmesg dmesgerrpt

Physical RAM 1TB 4TB 64 GB {>2.3.24} 16TB

Shared Memory 2.75GB 8TB

Process Data Space 2GB 4GB 900 MB

Swap device /dev/hd6 /dev/vg00/lvol2 /dev/sda2

Swap file type /etc/swapspaces swap swap 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/*

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

Submit print jobs

enq

lp lp lpr

lp

lp lpr

lpr

qprt

LP statistics

enq -A

lpq lpstat lpq lpstat

lpq

lpstat

qchk

Remove print jobs

cancel cancel

cancel lprm

cancel

Performance monitor

System activity reporter sar {sysstat}

Virtual Memory statistics

iostat {sysstat}

dmesg 

sysctl kernel.shmmax

/dev/ad0s1b/dev/vx/dsk/swapvol

partition type 82 

Stop LP 

Page 4: Unix Commands on Different OS's

Remove print jobs

lprm lprm

cancel lprm

lprm

qcan

enq -x

Add printer queue smit mkpq lpadmin -p pq printtool lpadmin -p pq

smit rmpq lpadmin -x pq lpadmin -x pq

lpadmin -d pq lpadmin -d pq

TCP/IP AIX HP-UX LINUX(RedHat) Solaris

lsattr -E -l inet0 /etc/rc.conf

/etc/hostname.*

/etc/inet/*

/etc/defaultrouter

Hosts IP addresses /etc/hosts /etc/hosts /etc/hosts /etc/hosts /etc/inet/hosts

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

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

ifconfig xl0 alias IP

modprobe ip_alias

ifconfig eth0:1 IP

Login prompt

HERALD @

/etc/issue

BANNER @

cd /dev {/etc/system}

NSTRPY=# ./MAKEDEV -v pty

Remove Printer queue

Make default printer

export LPDEST="pq"

Network IP configuration

/etc/rc.config.d/netconf

/etc/sysconfig/network-scripts/ 

Name service switchNetwork parameters

Secondary IP Address

ifconfig en0 alias IP  ifconfig lan0:1 IP 

ifconfig hme0:1 IP up

telnetd -b /etc/issue 

/etc/security/login.cfg 

/etc/default/telnetd

Increase the # of pseudo-terminals

odmget -q "attribute=num and uniquetype=pty/pty/pty" PdAt | sed "s/0-64/0-512/" |

rebuild your kernel with these new values NPTY=# 

odmchange -q "attribute=num and uniquetype=pty/pty/pty" -o PdAt

set pt_cnt = #   {SYSV}

Page 5: Unix Commands on Different OS's

reboot

reboot {/etc/iu.ap}

insf -d ptys -n #

insf -d ptym -n #

insf -d pts -s # -e -v halt

boot -r

Maximum # of ptys 512 {MAXUSERS} 256

Remote Shell

remsh

rsh remsh rsh rshrsh

/usr/sbin/ypbind /sbin/ypbind

System Files AIX FreeBSD HP-UX LINUX(RedHat) Solaris

NFS exported /etc/exports /etc/exports /etc/exports /etc/exports

/etc/dfs/dfstab

/etc/dfs/sharetab

/etc/xtab /etc/xtab /var/lib/nfs/xtab /etc/rmtab

Max File System 128 GB 128 GB

1 TB

8000 TB {vxfs}

Max File Size 64 GB 128 GB

1 TB

2 GB {=<2.5.1}

Increase the # of pseudo-terminals

set npty = #      {BSD}

chdev -l pty0 -anum=256 -P

ptsl 0 # ldterm ttcompat

176                {BSD}

3000              {SYSV}

YP/NIS service binder

/usr/lib/netsvc/yp/ypbind 

/usr/lib/netsvc/yp/ypbind 

/usr/lib/netsvc/yp/ypbind

NFS Client mounted directories

2 TB 

2 GB     {512B block size} 

8192 GB  {8KB block size} 

Page 6: Unix Commands on Different OS's

64 K 60~ K sysctl fs.file-max 64 K

AIX FreeBSD 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

Disk information fdisk -v ad0

format -d c#t#d#

format>current

format>inquiry

Disk Label lspv -l hdisk# disklabel ad0 fdisk -l prtvtoc

LVM Concepts 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

jfs vxfs

ext3

vxfsreiserfs

/dev/rootvg /dev/vg00 /dev/vx/dsk/rootdg

lsvg -l rootvg vgdisplay -v vg00 vgdisplay -v vxprint -l -g rootdg

chpv pvchange pvchange

pvcreate pvcreate vxdiskadd

lspv vinum ld pvdisplay pvdisplay vxprint -dl

reducevg vgreduce vgreduce vxdg rmdisk

Max # File Descriptors

DISK/LVM Commands HP-UX:Disk &Filesystem

bootinfo -s hdisk# diskinfo /dev/rdsk/c#t#d#

cat /proc/scsi/scsi0/sda/model

pvdisplay -v /dev/dsk/C#t#d#

Partition 

Journal Filesystem type

Default volume group

Display volume group

Modify physical volume

Prepare physical disk

mkdev -c disk -l hdisk#List physical

volume

Remove disk from volume group

Page 7: Unix Commands on Different OS's

migratepv pvmove pvmove vxassist move

mkvg vgcreate vgcreate vxdg init

vgremove vgremove

chvg

vgchange vgchange

varyonvg

varyoffvg

vgcfgrestore vgcfgrestore

exportvg vgexport vgexport vxdg deport

importvg vgimport vgimport vxdg import

lsvg vgscan vgscan

chlv lvchange vxedit set

List logical volume lslv vinum lv lvdisplay lvdisplay vxprint -vl

mklv lvcreate lvcreate vxassist make

extendlv lvextend lvextend vxassist growto

lvreduce lvreduce vxassist shrinkto

rmlv vinum rm vol lvremove lvremove vxedit rm

bootlist -m normal lvlnboot lilo vxbootsetup

lvrmboot

Move logical volumes to another physical volumes

vinum move -f drive objectCreate volume

group

Remove volume group

Volume group availability

Restore volume group

Exports volume group

Imports volume groupVolume group listing

Change logical volume characteristics  lvchange 

Make logical volume

Extend logical volume

Reduce logical volume AIX reduce LV

Remove logical volume

Prepare boot volumes

Remove boot volumes

Page 8: Unix Commands on Different OS's

Extend File system

resize2fs vxva

resize_reiserfs mkfs -M

rmlvcopy lvsplit lvsplit

Merge mirrors lvmerge lvmerge

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

Add mirrors lvextend -m 1

mklv -u 3 -S 64K vinum stripe drive lvcreate -i 3 -I 64 lvcreate -i 3 -I 64

Backup savevg -i rootvg vinum saveconfig fbackup tar cvf /dev/rst0 / ufsdump

Restore frecover ufsrestore

MISC AIX FreeBSD HP-UX LINUX(RedHat) SOLARIS

Startup script /etc/rc /sbin/rc /etc/rc.d/rc /etc/init.d

Kernel /kernel /stand/vmunix /boot/vmlinuz /kernel/genunix

Kernel Parameters lsattr -E -l sys0 sysctl -a

sysdef

sysctl -a sysdef -i

kmtune

kmsystem

cd /sys/i386/conf cd /stand/build vi /etc/system

vi KERNEL reboot

config KERNEL vi system

make depend cd /stand

chfs -a size=# /mt

extendfs /dev/vg00/lvol8

fsadm -F vxfs -b {LE * 1024} /mtReduce/Split

mirrors

mklvcopy lv 2 

Create striped volumes

vxassist make vol 100mb layout=raid5

System recovery tape

mksysb -i /dev/rmt0

/opt/ignite/bin/make_recovery

restvg  tar xvf /dev/rst0 

/etc/rc/usr/lib/boot/unix_up

Reconfigure the kernel chdev -l sys0 -a 

cd /usr/src/linux 

/usr/lbin/sysadm/system_prep -v -s system make mrproper 

make menuconfig 

cd ../../compile/KERNEL

mk_kernel -s system make dep 

make clean 

Page 9: Unix Commands on Different OS's

make make bzImage

make install make install

mv dlkm dlkm.prev make modules

make modules_install

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

Physical RAM bootinfo -r sysctl hw.physmem free prtconf

Kernel Bits bootinfo -K getconf WORD_BIT isainfo -kv

Crash utility crash crash adb crash

Reconfigure the kernel chdev -l sys0 -a 

mv system system.prev

mv vmunix vmunix.prev

mv /stand/build/system system

kmupdate /stand/build/vmunix_test

cp arch/i386/boot/bzImage /boot/vmlinuz-2.2.16

mkinitrd /boot/initrd-2.2.16.img 2.2.16

grep -i Physical /var/adm/syslog/syslog.log

getconf KERNEL_BITS

lcrash

Page 10: Unix Commands on Different OS's

Trace System Calls syscalls truss strace truss

Machine model

uname -m

uname -m

model

uname -m uname -impbootinfo -m uname -m

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

Boot single user ok boot -s

>boot {lilo}

ok boot -s

Boot from CD/Tape control-x

ISL>hpux -iS linux S

{grub}

c

boot

Maintenance mode ok boot -as

>boot

ok boot -asISL>hpux -lm

Interrupt Key control-B Stop-A

Return to console co ok go

/etc/environment

/etc/localtime /etc/TIMEZONE /etc/sysconfig/clock

/etc/TIMEZONE

/etc/profile /etc/default/init

NTP Daemon

/etc/ntp.conf /etc/ntp.conf /etc/inet/ntp.conf

tusc

/var/crash/`uname -n`

Key on service mode/F4

Interact with IPL ? YSelect Maintenance

Limited function Shell

kernel vmlinuz-2.4.9-13 single   ro root=/dev/hda8

initrd /initrd-2.4.9-13.img

Interact with IPL ? Y

Timezone Management

/etc/rc.conf {xntpd_enable="YES"}

/etc/rc.config.d/netdaemons

Page 11: Unix Commands on Different OS's

NTP Daemon startsrc -s xntpd /etc/rc.network /sbin/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

lslpp -L all pkg_info -a swlist rpm -qa pkginfo

lppchk -v rpm -V package

pkginfo -i

pkginfo -p

List all files lslpp -f fileset pkg_info -L package swlist -l file fileset rpm -ql package pkgchk -l package

instfix -i

swlist -l patch

patchadd -pwhat /stand/vmunix

Package owner lslpp -w 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

cfgmgr -v /dev/MAKEDEV insf -e /dev/MAKEDEV

drvconfig

devlinks

disks

tapes

ports

Remove device rmdev -l rmsf rem_drv

Device drivers lscfg lsdev prtconf -D

CPU lsdev -Cc processor sysctl hw.model cat /proc/cpuinfo psrinfo -v

List Terminal lsdev -Cc tty ioscan -fnC tty pmadm -l

Diagnostics diag pciconf -l stm

lspci

pnpdump sbin/prtdiag

ok test-all

/etc/rc.d/init.d/xntpd

List installed software

Verify installed software

swlist -l fileset -a state

List installed patches

swlist -l file | grep path

Install devices for attached peripherals

ioscan -fnC processor

/usr/platform/`uname -m`/

Page 12: Unix Commands on Different OS's

Diagnostics diag pciconf -l stm

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/rmt0 /dev/rwt0d /dev/rmt/0m /dev/rmt/0

/dev/rmt0.1 /dev/nrwt0d /dev/rmt/0mn /dev/rmt/0n

Floppy drive /dev/rfd0 /dev/fd0 - /dev/fd0 /dev/diskette

Links AIX FreeBSD HP-UX LINUX(RedHat) SOLARIS

FAQ

Online Manual

Technical Support

Phone Number 1-800-CALL-AIX 1-800-633-3600 1-888-REDHAT1 1-800-USA-4SUN

Free Software

Certification

/opt/SUNWvts/bin/sunvts

Rewinding tape drive

/dev/rst0               { c 9 0}

Non-rewinding tape drive

/dev/nrst0           { c 9 128 }

AIX-FAQ FreeBSD FAQ HP-UX FAQ LINUX FAQ Solaris 2 FAQ

AIX 4.3 Books FreeBSD Hand Book HP-UX 11.00 CollectionLinux Documentation ProjectSolaris 7 Documentation

RS/6000 TechSupport IT Resource Center Red Hat support SunSolve

Bull FreeBSD Primary Site HP-UX Ports Linux Software Map Sun Freeware

www.ibm.com education.hp.com RHCE suned.sun.com

Page 13: Unix Commands on Different OS's

Tru64

Tru64

/etc/group

65535

/etc/securettys

{ttyp1}

65534

/     {/dev/rz0a}

/usr    {/dev/rz0g}

/etc/passwd 

Page 14: Unix Commands on Different OS's

65534

>>>boot -fl s

lsmbstartup

/sbin/bcheckrc

passwd root

useradd

userdel

usermod

Tru64

hostid

sysman

press the HALT Button or (Control-P)

Page 15: Unix Commands on Different OS's

top

vmstat

iostat

uerf -R -o full

4TB

/dev/rz0b

raw

swapon -s

swapon -a

Tru64

/usr/spool/lpd

lp

lpr

lpstat

cancel

/usr/opt/svr4/bin/sar

/sbin/init.d/lpd stop/sbin/init.d/lpd start

Page 16: Unix Commands on Different OS's

lprm

lprsetup

lprsetup

Tru64

/etc/rc.config

/etc/hosts

/etc/svc.conf

routed

ifconfig -a

ifconfig ln0 alias

/etc/issue

cd /dev

./MAKEDEV PTY_1

export PRINTER="lp"

Page 17: Unix Commands on Different OS's

8192

rsh

/usr/sbin/ypbind

Tru64

/etc/exports

512 GB {>= 4.0}

16 TB {advfs}

512 GB {>= 4.0}

16 TB {advfs}

/var/adm/mountdtab128 GB {<= 3.2G}

128 GB {<= 3.2G}

Page 18: Unix Commands on Different OS's

64 K

Tru64

/etc/fstab

df -k

file /dev/rrz0c

disklabel -p rz0

sub disk

Volume

Plex

disk group

advfs

/dev/vol/rootdg

voldiskadd

volprint -dl

voldg rmdisk

volprint -l -g rootdg

Page 19: Unix Commands on Different OS's

volassist move

voldg init

voldg deport

voldg import

voledit set

volprint -vl

volassist make

volassist growto

volassist shrinkto

voledit -g rootdg -rf rm vol1

Page 20: Unix Commands on Different OS's

vdump

vrestore

Tru64

/sbin/init.d

/vmunix

sysconfig

dxkerneltuner

doconfig

volassist make vol 100mb mirror=true

volassist make vol 100mb layout=stripe

/usr/sys/bin/btcreate

Page 21: Unix Commands on Different OS's

doconfig

netsetup

64

kdbx

uerf | grep memory

Page 22: Unix Commands on Different OS's

uname -p

sizer -v

who -r

>>> boot -fl s

control-P

/etc/svid3_tz

timezone

trace

rcmgr set XNTPD_CONF YES

Page 23: Unix Commands on Different OS's

/sbin/init.d/xntpd

Tru64

setld -l

setld -d

setld -i

setld -v

setld -i package

/var/adm/smlogs

Tru64

/dev

scu scan edt

scsimgr -scan_all

psrinfo -v

dupatch -track -type patch

Page 24: Unix Commands on Different OS's

/dev/rz0c

/dev/rz3c

cdfs

/dev/rmt0

/dev/nrmt0

/dev/fd0c

Tru64

Tru64 FAQ

Tru64 Documents

Alpha Systems Support

Tru64 Demos, Shareware & Freeware