AIX、HP-UX、Linux常用命令及配置檔案對照表

panpong發表於2016-12-16

AIX、HP-UX、Linux常用命令及配置檔案對照表

Directory Mappings 

AIX

HP-UX

LINUX(RedHat)

Root filesystem

/{/dev/hd4}

/{/dev/vg00/lvol1}

/{/dev/sda1}

Home Directory

/home{/dev/hd1}

/home{/dev/vg00/lvol4}

 

 

/tmp{/dev/hd3}

/tmp{/dev/vg00/lvol6}

 

 

/usr{/dev/hd2}

/usr{/dev/vg00/lvol7}

 

 

/var{/dev/hd9var}

/var{/dev/vg00/lvol8}

 

Sample configuration files

-

/usr/newconfig

 

User Accounts

AIX

HP-UX

LINUX(RedHat)

Password files

/etc/passwd 
/etc/security/passwd

/etc/passwd 
/tcb/files/auth/r/root

/etc/passwd 
/etc/shadow

Groups file

/etc/group 
/etc/security/group

/etc/group 
/etc/logingroup

/etc/group

Maximum # of user ID

4294967295

2147483647

65535

Allow/Deny remote login

/etc/security/user 
{rlogin=true}

/etc/securetty 
{console}

/etc/securetty 
{ttyp1}

User nobody's id #

4294967294

-2

99

Group nobody's id #

4294967294

-2(nogroup)

99

Recover root password

boot from CD/Tape 
Installation/Maintenance
Start Limited Shell 
getrootfs hdisk0 
vi /etc/security/passwd

>boot
Interact with IPL ? Y
ISL>hpux -iS 
passwd root

{lilo}
control-x
linux S
passwd root
{grub}
c
kernel vmlinuz-2.4.9-13 single   ro root=/dev/hda8
initrd /initrd-2.4.9-13.img
boot
passwd root

Create new user

mkuser

useradd

useradd

Delete user

rmuser

userdel

userdel

List users

lsuser -f ALL

logins

 

Modify user account

chuser -a

usermod

usermod

General Commands

AIX

HP-UX

LINUX(RedHat)

Unique host ID

hostid

uname -i

hostid

Administrator

smit

sam

linuxconf

Performance monitor

top 
monitor

top 
glance

top

System activity reporter

sar

sar

sar{sysstat}

Virtual Memory statistics

vmstat

vmstat

vmstat

I/O statistics

iostat

iostat

iostat{sysstat}

Error logs

alog -o -t boot 
errpt

dmesg

dmesg 

Physical RAM

1TB

4TB

64 GB{>2.3.24}

Shared Memory

2.75GB

8TB

sysctl kernel.shmmax

Process Data Space

2GB

4GB

900 MB

Swap device

/dev/hd6

/dev/vg00/lvol2

/dev/sda2

Swap file type

/etc/swapspaces

swap

partition type 82 

Display swap size

lsps -a

swapinfo -a

free

Activate Swap

swapon -a

swapon -a

swapon -a

Printers

AIX

HP-UX

LINUX

Printer Queues

/etc/qconfig

/etc/lp/interface/*

/var/spool/lpd/lp/*

Stop LP 

stopsrc -s lpd

lpshut

/etc/init.d/lpd stop

Start LP

startsrc -s lpd

lpsched

/etc/init.d/lpd start

Submit print jobs

enq 
lp 
lpr 
qprt

lp

lpr

LP statistics

enq -A 
lpq 
lpstat 
qchk

lpstat

lpq

Remove print jobs

cancel 
lprm 
qcan 
enq -x

cancel

lprm

Add printer queue

smit mkpq

lpadmin -p pq

printtool

Remove Printer queue

smit rmpq

lpadmin -x pq

 

Make default printer

export LPDEST="pq"

lpadmin -d pq

 

TCP/IP

AIX

HP-UX

LINUX(RedHat)

Network IP configuration

lsattr -E -l inet0

/etc/rc.config.d/netconf

/etc/sysconfig/network-scripts/ 

Hosts IP addresses

/etc/hosts

/etc/hosts

/etc/hosts

Name service switch

/etc/netsvc.conf

/etc/nsswitch.conf

/etc/nsswitch.conf

Network parameters

no -a

ndd -h

sysctl -a | grep net

Routing daemon

gated

gated

routed

NIC Configurations

ifconfig -a

lanscan -v

ifconfig -a

Secondary IP Address

ifconfig en0 alias IP 

ifconfig lan0:1 IP 

modprobe ip_alias 
ifconfig eth0:1 IP

Login prompt

HERALD @ 
/etc/security/login.cfg 

telnetd -b /etc/issue 

/etc/issue

Increase the # of pseudo-terminals

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

chdev -l pty0 -anum=256 -P
reboot

rebuild your kernel with these new values NPTY=#  
NSTRPY=#

reboot

insf -d ptys -n # 
insf -d ptym -n # 
insf -d pts -s # -e -v 
 

cd /dev 
./MAKEDEV -v pty

Maximum # of ptys

512

{MAXUSERS}

256

Remote Shell

remsh 
rsh

remsh

rsh

YP/NIS service binder

/usr/lib/netsvc/yp/ypbind 

/usr/lib/netsvc/yp/ypbind 

/sbin/ypbind

System Files

AIX

HP-UX

LINUX(RedHat)

NFS exported

/etc/exports

/etc/exports

/etc/exports

NFS Client mounted directories

/etc/xtab

/etc/xtab

/var/lib/nfs/xtab

Max File System

128 GB

128 GB

2 TB 

Max File Size

64 GB

128 GB

2 GB{512B block size}  
8192 GB{8KB block size} 

Max # File Descriptors

64 K

60~ K

sysctl fs.file-max

DISK/LVM Commands

AIX

HP-UX:Disk &Filesystem

LINUX(RedHat)

Filesystem table

/etc/filesystems

/etc/fstab

/etc/fstab

Free disk blocks

df -k

bdf

df -k

Device listing

lsdev -C

/sbin/ioscan

cat /proc/devices

Disk information

bootinfo -s hdisk# 

diskinfo /dev/rdsk/c#t#d#

cat /proc/scsi/scsi0/sda/model

Disk Label

lspv -l hdisk#

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

fdisk -l

LVM Concepts

Partition 

logical extents

logical extents

 

Volume

logical volume

logical volume

 

 

 

 

 

Volume group

volume group

volume group

Journal Filesystem type

jfs

vxfs

ext3
reiserfs

Default volume group

/dev/rootvg

/dev/vg00

 

Display volume group

lsvg -l rootvg

vgdisplay -v vg00

vgdisplay -v

Modify physical volume

chpv

pvchange

pvchange

Prepare physical disk

mkdev -c disk -l hdisk#

pvcreate

pvcreate

List physical volume

lspv

pvdisplay

pvdisplay

Remove disk from volume group

reducevg

vgreduce

vgreduce

Move logical volumes to another physical volumes

migratepv

pvmove

pvmove

Create volume group

mkvg

vgcreate

vgcreate

Remove volume group

 

vgremove

vgremove

Volume group availability

chvg 
varyonvg 
varyoffvg

vgchange

vgchange

Restore volume group

 

vgcfgrestore

vgcfgrestore

Exports volume group

exportvg

vgexport

vgexport

Imports volume group

importvg

vgimport

vgimport

Volume group listing

lsvg

vgscan

vgscan

Change logical volume characteristics 

chlv

lvchange

lvchange 

List logical volume

lslv

lvdisplay

lvdisplay

Make logical volume

mklv

lvcreate

lvcreate

Extend logical volume

extendlv

lvextend

lvextend

Reduce logical volume

AIX reduce LV

lvreduce

lvreduce

Remove logical volume

rmlv

lvremove

lvremove

Prepare boot volumes

bootlist -m normal

lvlnboot

lilo

Remove boot volumes

 

lvrmboot

 

Extend File system

chfs -a size=# /mt

extendfs /dev/vg00/lvol8 
fsadm -F vxfs -b{LE * 1024} /mt

resize2fs
resize_reiserfs

Reduce/Split mirrors

rmlvcopy

lvsplit

lvsplit

Merge mirrors

 

lvmerge

lvmerge

Create mirrors

mklv -c 2

lvcreate -m 1

 

Add mirrors

mklvcopy lv 2 

lvextend -m 1

 

Create striped volumes

mklv -u 3 -S 64K

lvcreate -i 3 -I 64

lvcreate -i 3 -I 64

System recovery tape

mksysb -i /dev/rmt0

/opt/ignite/bin/make_recovery

 

Backup

savevg -i rootvg

fbackup

tar cvf /dev/rst0 /

Restore

restvg 

frecover

tar xvf /dev/rst0 

MISC

AIX

HP-UX

LINUX(RedHat)

Startup script

/etc/rc

/sbin/rc

/etc/rc.d/rc

Kernel

/usr/lib/boot/unix_up

/stand/vmunix

/boot/vmlinuz

Kernel Parameters

lsattr -E -l sys0

sysdef 
kmtune 
kmsystem

sysctl -a

Reconfigure the kernel


chdev -l sys0 -a 

cd /stand/build 
/usr/lbin/sysadm/system_prep -v -s system 
vi system 
mk_kernel -s system 
cd /stand 
mv system system.prev 
mv vmunix vmunix.prev 
mv dlkm dlkm.prev 
mv /stand/build/system system 
kmupdate /stand/build/vmunix_test

cd /usr/src/linux  
make mrproper  
make menuconfig  
make dep  
make clean  
make bzImage 
make install 
make modules 
make modules_install

cp arch/i386/boot/bzImage /boot/vmlinuz-2.2.16 
mkinitrd /boot/initrd-2.2.16.img 2.2.16 
vi /etc/lilo.conf 
lilo

List modules

genkex

kmadmin -s

lsmod

Load module

 

kmadmin -L

insmod

Unload module

 

kmadmin -U

rmmod

Initialize system

install_assist

set_parms initial

netconf

Physical RAM

bootinfo -r

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

free

Kernel Bits

bootinfo -K

getconf KERNEL_BITS

getconf LONG_BIT

Crash utility

crash

adb

lcrash

Trace System Calls

syscalls

tusc

strace

Machine model

uname -m 
bootinfo -m

model 
uname -m

uname -m

OS Level

oslevel

uname -r

uname -r

Run Level

who -r

who -r

runlevel

Core dump files

/var/adm/ras

/var/adm/crash

 

Boot single user

Key on service mode/F4 
Boot from CD/Tape 
Select Maintenance 
Limited function Shell

>boot
Interact with IPL ? Y
ISL>hpux -iS

{lilo}
control-x
linux S
{grub}
c
kernel vmlinuz-2.4.9-13 single   ro root=/dev/hda8
initrd /initrd-2.4.9-13.img
boot

Maintenance mode

 

>boot
Interact with IPL ? Y
ISL>hpux -lm

 

Interrupt Key

 

control-B

 

Return to console

 

co

 

Timezone Management

/etc/environment
/etc/profile

/etc/TIMEZONE

/etc/sysconfig/clock

NTP Daemon

/etc/ntp.conf
startsrc -s xntpd

/etc/rc.config.d/netdaemons
/sbin/init.d/xntpd

/etc/ntp.conf
/etc/rc.d/init.d/xntpd

Software

AIX

HP-UX

LINUX(RedHat)

Install Software

installp -a

swinstall

rpm -i package

Uninstall software

installp -u

swremove

rpm -e package

List installed software

lslpp -L all

swlist

rpm -qa

Verify installed software

lppchk -v

swlist -l fileset -a state

rpm -V package

List all files

lslpp -f fileset

swlist -l file fileset

rpm -ql package

List installed patches

instfix -i

swlist -l patch 
what /stand/vmunix

 

Package owner

lslpp -w path

swlist -l file | grep path

rpm -qf file

SW Directory

/usr/lpp

/var/adm/sw/

/var/lib/rpm

Devices

AIX

HP-UX

LINUX(RedHat)

Devices

/dev

/dev

/dev

Install devices for attached peripherals

cfgmgr -v

insf -e

/dev/MAKEDEV

Remove device

rmdev -l

rmsf

 

Device drivers

lscfg

lsdev

 

CPU

lsdev -Cc processor

ioscan -fnC processor

cat /proc/cpuinfo

List Terminal

lsdev -Cc tty

ioscan -fnC tty

 

Diagnostics

diag

stm

lspci
pnpdump

Whole Disk

/dev/hdisk#

/dev/dsk/c#t#d0

/dev/sda

CDROM

/dev/cd0

/dev/dsk/c#t2d0

/dev/cdrom

CDROM file type

cdrfs

cdfs

iso9660

Rewinding tape drive

/dev/rmt0

/dev/rmt/0m

/dev/rst0{ c 9 0}

Non-rewinding tape drive

/dev/rmt0.1

/dev/rmt/0mn

/dev/nrst0{ c 9 128 }

Floppy drive

/dev/rfd0

-

/dev/fd0

Links

AIX

HP-UX

LINUX(RedHat)

FAQ

AIX-FAQ

HP-UX FAQ

LINUX FAQ

Online Manual

AIX 5.3 Docs

HP-UX Reference Manual

Linux Documentation Project

Technical Support

p5 TechSupport

IT Resource Center

Red Hat support

Phone Number

1-800-CALL-AIX

1-800-633-3600

1-888-REDHAT1

Free Software

Public Domain Software Library

HP-UX Ports

Linux Software Map

Certification

education.hp.com

RHCE

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/16976507/viewspace-2130761/,如需轉載,請註明出處,否則將追究法律責任。

相關文章