Unix Commands on Different OS's (Doc ID 293561.1)

来源:互联网 发布:php后端管理源码 编辑:程序博客网 时间:2024/06/08 13:13

Unix Commands on Different OS's

 
General Commands
AIX
FreeBSD
HP-UX
LINUX(RedHat)
Solaris
Tru64
Unique host IDhostid uname -ihostidhostidhostidAdministratorsmit samlinuxconfadmintoolsysmanPerformance monitortop 
monitortoptop 
glancetoptoptopSystem activity reportersarsasarsar {sysstat}sar/usr/opt/svr4/bin/sarVirtual Memory statisticsvmstatvmstatvmstatvmstatvmstatvmstatI/O statisticsiostatiostatiostatiostat {sysstat}iostatiostatError logsalog -o -t boot 
errptdmesgdmesgdmesg dmesguerf -R -o fullPhysical RAM1TB 4TB64 GB {>2.3.24}16TB4TBShared Memory2.75GB 8TBsysctl kernel.shmmax  Process Data Space2GB 4GB900 MB  Swap device/dev/hd6/dev/ad0s1b/dev/vg00/lvol2/dev/sda2/dev/vx/dsk/swapvol/dev/rz0bSwap file type/etc/swapspacesswapswappartition type 82 swaprawDisplay swap sizelsps -aswapinfoswapinfo -afreeswap -lswapon -sActivate Swapswapon -aswapon -aswapon -aswapon -aswap -aswapon -a
TCP/IP
AIX
 
HP-UX
LINUX(RedHat)
Solaris
Tru64
Network IP configurationlsattr -E -l inet0/etc/rc.conf/etc/rc.config.d/netconf/etc/sysconfig/network-scripts/ /etc/hostname.* 
/etc/inet/* 
/etc/defaultrouter/etc/rc.configHosts IP addresses/etc/hosts/etc/hosts/etc/hosts/etc/hosts/etc/inet/hosts/etc/hostsName service switch/etc/netsvc.conf/etc/host.conf/etc/nsswitch.conf/etc/nsswitch.conf/etc/nsswitch.conf/etc/svc.confNetwork parametersno -asysctlndd -hsysctl -a | grep netndd /dev/[tcp|ip] ? Routing daemongatedroutedgatedroutedin.routedroutedNIC Configurationsifconfig -aifconfig -alanscan -vifconfig -aifconfig -aifconfig -aSecondary IP Addressifconfig en0 alias IP ifconfig xl0 alias IPifconfig lan0:1 IP modprobe ip_alias 
ifconfig eth0:1 IPifconfig hme0:1 IP upifconfig ln0 aliasLogin promptHERALD @ 
/etc/security/login.cfg  telnetd -b /etc/issue /etc/issueBANNER @ 
/etc/default/telnetd/etc/issueIncrease the # of pseudo-terminalsodmget -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{/etc/system} 
set pt_cnt = #   {SYSV} 
set npty = #      {BSD}

{/etc/iu.ap} 
ptsl 0 # ldterm ttcompat

halt 
boot -r

cd /dev 
./MAKEDEV PTY_1Maximum # of ptys512 {MAXUSERS}256176                {BSD} 
3000              {SYSV}8192Remote Shellremsh 
rshrshremshrshrshrshYP/NIS service binder/usr/lib/netsvc/yp/ypbind /usr/sbin/ypbind/usr/lib/netsvc/yp/ypbind /sbin/ypbind/usr/lib/netsvc/yp/ypbind/usr/sbin/ypbind
System Files
AIX
FreeBSD
HP-UX
LINUX(RedHat)
Solaris
Tru64
NFS exported/etc/exports/etc/exports/etc/exports/etc/exports/etc/dfs/dfstab 
/etc/dfs/sharetab/etc/exportsNFS Client mounted directories/etc/xtab /etc/xtab/var/lib/nfs/xtab/etc/rmtab/var/adm/mountdtabMax File System128 GB 128 GB2 TB 1 TB
8000 TB {vxfs}
128 GB {<= 3.2G} 
512 GB {>= 4.0} 
16 TB {advfs}Max File Size64 GB 128 GB2 GB     {512B block size}  
8192 GB  {8KB block size} 1 TB
2 GB {=<2.5.1}
128 GB {<= 3.2G} 
512 GB {>= 4.0} 
16 TB {advfs}Max # File Descriptors64 K 60~ Ksysctl fs.file-max64 K64 K
DISK/LVM Commands
AIX
FreeBSD
HP-UX:Disk &Filesystem
LINUX(RedHat)
SOLARIS
Tru64
Filesystem table/etc/filesystems/etc/fstab/etc/fstab/etc/fstab/etc/vfstab/etc/fstabFree disk blocksdf -kdf -kbdfdf -kdf -kdf -kDevice listinglsdev -C /sbin/ioscancat /proc/devicessysdef Disk informationbootinfo -s hdisk# fdisk -v ad0diskinfo /dev/rdsk/c#t#d#cat /proc/scsi/scsi0/sda/modelformat -d c#t#d# 
format>current 
format>inquiryfile /dev/rrz0cDisk Labellspv -l hdisk#disklabel ad0pvdisplay -v /dev/dsk/C#t#d#fdisk -lprtvtocdisklabel -p rz0LVM ConceptsPartition sub disklogical extentslogical extentssub disksub disk VolumeVolumelogical volumelogical volumeVolumeVolume  Plex  PlexPlex Volume group volume groupvolume groupdisk groupdisk groupJournal Filesystem typejfs vxfsext3
reiserfs
vxfsadvfsDefault volume group/dev/rootvg /dev/vg00 /dev/vx/dsk/rootdg/dev/vol/rootdgDisplay volume grouplsvg -l rootvg vgdisplay -v vg00vgdisplay -vvxprint -l -g rootdgvolprint -l -g rootdgModify physical volumechpv pvchangepvchange  Prepare physical diskmkdev -c disk -l hdisk# pvcreatepvcreatevxdiskaddvoldiskaddList physical volumelspvvinum ldpvdisplaypvdisplayvxprint -dlvolprint -dlRemove disk from volume groupreducevg vgreducevgreducevxdg rmdiskvoldg rmdiskMove logical volumes to another physical volumesmigratepvvinum move -f drive objectpvmovepvmovevxassist movevolassist moveCreate volume groupmkvg vgcreatevgcreatevxdg initvoldg initRemove volume group  vgremovevgremove  Volume group availabilitychvg 
varyonvg 
varyoffvg vgchangevgchange  Restore volume group  vgcfgrestorevgcfgrestore  Exports volume groupexportvg vgexportvgexportvxdg deportvoldg deportImports volume groupimportvg vgimportvgimportvxdg importvoldg importVolume group listinglsvg vgscanvgscan  Change logical volume characteristics chlv lvchangelvchange vxedit setvoledit setList logical volumelslvvinum lvlvdisplaylvdisplayvxprint -vlvolprint -vlMake logical volumemklv lvcreatelvcreatevxassist makevolassist makeExtend logical volumeextendlv lvextendlvextendvxassist growtovolassist growtoReduce logical volumeAIX reduce LV lvreducelvreducevxassist shrinktovolassist shrinktoRemove logical volumermlvvinum rm vollvremovelvremovevxedit rmvoledit -g rootdg -rf rm vol1Prepare boot volumesbootlist -m normal lvlnbootlilovxbootsetup Remove boot volumes  lvrmboot   Extend File systemchfs -a size=# /mt extendfs /dev/vg00/lvol8 
fsadm -F vxfs -b {LE * 1024} /mtresize2fs
resize_reiserfs
vxva 
mkfs -M Reduce/Split mirrorsrmlvcopy lvsplitlvsplit  Merge mirrors  lvmergelvmerge  Create mirrorsmklv -c 2vinum mirror drivelvcreate -m 1 vxassist mirrorvolassist make vol 100mb mirror=trueAdd mirrorsmklvcopy lv 2  lvextend -m 1   Create striped volumesmklv -u 3 -S 64Kvinum stripe drivelvcreate -i 3 -I 64lvcreate -i 3 -I 64vxassist make vol 100mb layout=raid5volassist make vol 100mb layout=stripeSystem recovery tapemksysb -i /dev/rmt0 /opt/ignite/bin/make_recovery  /usr/sys/bin/btcreateBackupsavevg -i rootvgvinum saveconfigfbackuptar cvf /dev/rst0 /ufsdumpvdumpRestorerestvg  frecovertar xvf /dev/rst0 ufsrestorevrestore
MISC
AIX
FreeBSD
HP-UX
LINUX(RedHat)
SOLARIS
Tru64
Startup script/etc/rc/etc/rc/sbin/rc/etc/rc.d/rc/etc/init.d/sbin/init.dKernel/usr/lib/boot/unix_up/kernel/stand/vmunix/boot/vmlinuz/kernel/genunix/vmunixKernel Parameterslsattr -E -l sys0sysctl -asysdef 
kmtune 
kmsystem
sysctl -asysdef -isysconfig 
dxkerneltunerReconfigure the kernel
chdev -l sys0 -a cd /sys/i386/conf 
vi KERNEL 
config KERNEL 
cd ../../compile/KERNEL
make depend 
make 
make installcd /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_testcd /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

vi /etc/system 
rebootdoconfigList modulesgenkexkldstatkmadmin -slsmodmodinfo Load module kldloadkmadmin -Linsmodmodload Unload module kldunloadkmadmin -Urmmodmodunload Initialize systeminstall_assist/stand/sysinstallset_parms initialnetconfsys-unconfignetsetupPhysical RAMbootinfo -rsysctl hw.physmemgrep -i Physical /var/adm/syslog/syslog.logfreeprtconfuerf | grep memoryKernel Bitsbootinfo -K getconf KERNEL_BITSgetconf WORD_BITisainfo -kv64Crash utilitycrashcrashadblcrashcrashkdbxTrace System CallssyscallstrusstuscstracetrusstraceMachine modeluname -m 
bootinfo -muname -mmodel 
uname -muname -muname -impuname -pOS Levelosleveluname -runame -runame -runame -rsizer -vRun Levelwho -r who -rrunlevelwho -rwho -rCore dump files/var/adm/ras /var/adm/crash /var/crash/`uname -n` Boot single userKey on service mode/F4 
Boot from CD/Tape 
Select Maintenance 
Limited function Shellok boot -s>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
ok boot -s>>> boot -fl sMaintenance mode ok boot -as>boot
Interact with IPL ? Y
ISL>hpux -lm
 ok boot -as Interrupt Key  control-B Stop-Acontrol-PReturn to console  co ok go Timezone Management/etc/environment
/etc/profile
/etc/localtime/etc/TIMEZONE/etc/sysconfig/clock/etc/TIMEZONE
/etc/default/init
/etc/svid3_tz
timezone
NTP Daemon/etc/ntp.conf
startsrc -s xntpd
/etc/rc.conf {xntpd_enable="YES"}
/etc/rc.network
/etc/rc.config.d/netdaemons
/sbin/init.d/xntpd
/etc/ntp.conf
/etc/rc.d/init.d/xntpd
/etc/inet/ntp.conf
/etc/init.d/xntpd
rcmgr set XNTPD_CONF YES
/sbin/init.d/xntpd
0 0
原创粉丝点击