Unix Linux

Unix Guide

_침묵_ 2006. 12. 7. 20:00

출처 :http://www.unixguide.net/unixguide.shtml

 


 © 2000 UNIXguide.net, All Rights Reserved.Hermelito Go  (Last Update:  Wednesday, 07-Dec-2005 11:11:32 PST )

Directory Mappings 
AIX
FreeBSD
HP-UX
LINUX(RedHat)
SOLARIS
Tru64
Root filesystem/              {/dev/hd4}/       {/dev/ad0s1a}/          {/dev/vg00/lvol1}/                  {/dev/sda1}/  {/dev/vx/dsk/rootvol}/     {/dev/rz0a}
Home Directory/home          {/dev/hd1} /home      {/dev/vg00/lvol4} /export/home
       /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 /usr    {/dev/rz0g}
 /var        {/dev/hd9var}/var    {/dev/ad0s1e}/var       {/dev/vg00/lvol8} /var 
Sample configuration files- /usr/newconfig   
User Accounts
AIX
FreeBSD
HP-UX
LINUX(RedHat)
Solaris
Tru64
Password files/etc/passwd
/etc/security/passwd
/etc/passwd
/etc/master.passwd
/etc/passwd
/tcb/files/auth/r/root
/etc/passwd
/etc/shadow
/etc/passwd 
/etc/shadow
/etc/passwd 
Groups file/etc/group
/etc/security/group
/etc/group/etc/group
/etc/logingroup
/etc/group/etc/group/etc/group
Maximum # of user ID429496729565535214748364765535214748364765535
Allow/Deny remote login/etc/security/user
{rlogin=true}
/etc/ttys 
{secure}
/etc/securetty
{console}
/etc/securetty
{ttyp1}
/etc/default/login
{CONSOLE=/dev/console}
/etc/securettys
{ttyp1}
User nobody's id #429496729465534-29960001 & 65534(nobody4)65534
Group nobody's id #429496729465534-2(nogroup)9960002 & 65534(nogroup)65534
Recover root passwordboot from CD/Tape
Installation/Maintenance
Start Limited Shell
getrootfs hdisk0
vi /etc/security/passwd
ok boot -s
passwd root
>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
boot cdrom -s
mkdir /tmp/a
mount /dev/c0t0d0s0 /tmp/a
vi /tmp/a/etc/shadow
press the HALT Button or (Control-P)
>>>boot -fl s
lsmbstartup
/sbin/bcheckrc
passwd root
Create new usermkuseradduseruseradduseradduseradduseradd
Delete userrmuserrmuseruserdeluserdeluserdeluserdel
List userslsuser -f ALL logins logins 
Modify user accountchuser -a usermodusermodusermodusermod
General Commands
AIX
FreeBSD
HP-UX
LINUX(RedHat)
Solaris
Tru64
Unique host IDhostid uname -ihostidhostidhostid
Administratorsmit samlinuxconfadmintoolsysman
Performance monitortop
monitor
toptop
glance
toptoptop
System activity reportersarsasarsar{sysstat}sar/usr/opt/svr4/bin/sar
Virtual Memory statisticsvmstatvmstatvmstatvmstatvmstatvmstat
I/O statisticsiostatiostatiostatiostat{sysstat}iostatiostat
Error logsalog -o -t boot
errpt
dmesgdmesgdmesg dmesguerf -R -o full
Physical RAM1TB 4TB64 GB {>2.3.24}16TB4TB
Shared 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/rz0b
Swap file type/etc/swapspacesswapswappartition type 82 swapraw
Display swap sizelsps -aswapinfoswapinfo -afreeswap -lswapon -s
Activate Swapswapon -aswapon -aswapon -aswapon -aswap -aswapon -a
Printers
AIX
FreeBSD
HP-UX
LINUX
Solaris
Tru64
Printer Queues/etc/qconfig/var/spool/print/etc/lp/interface/*/var/spool/lpd/lp/*/etc/lp/interfaces/*/usr/spool/lpd
Stop LP stopsrc -s lpd lpshut/etc/init.d/lpd stop/usr/lib/lp/lpshut/sbin/init.d/lpd stop
Start LPstartsrc -s lpdlpdlpsched/etc/init.d/lpd start/usr/lib/lp/lpsched/sbin/init.d/lpd start
Submit print jobsenq
lp
lpr
qprt
lplplprlp
lpr
lp
lpr
LP statisticsenq -A
lpq
lpstat
qchk
lpqlpstatlpqlpstatlpstat
Remove print jobscancel
lprm
qcan
enq -x
cancel
lprm
cancellprmcancel
lprm
cancel
lprm
Add printer queuesmit mkpq lpadmin -p pqprinttoollpadmin -p pqlprsetup
Remove Printer queuesmit rmpq lpadmin -x pq lpadmin -x pqlprsetup
Make default printerexport LPDEST="pq" lpadmin -d pq lpadmin -d pqexport PRINTER="lp"
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.config
Hosts IP addresses/etc/hosts/etc/hosts/etc/hosts/etc/hosts/etc/inet/hosts/etc/hosts
Name service switch/etc/netsvc.conf/etc/host.conf/etc/nsswitch.conf/etc/nsswitch.conf/etc/nsswitch.conf/etc/svc.conf
Network parametersno -asysctlndd -hsysctl -a | grep netndd /dev/[tcp|ip] ? 
Routing daemongatedroutedgatedroutedin.routedrouted
NIC Configurationsifconfig -aifconfig -alanscan -vifconfig -aifconfig -aifconfig -a
Secondary IP Addressifconfig en0 alias IP ifconfig xl0 alias IPifconfig lan0:1 IP modprobe ip_alias
ifconfig eth0:1 IP
ifconfig hme0:1 IP upifconfig ln0 alias
Login promptHERALD @
/etc/security/login.cfg 
 telnetd -b /etc/issue /etc/issueBANNER @
/etc/default/telnetd
/etc/issue
Increase 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_1
Maximum # of ptys512 {MAXUSERS}256176                {BSD}
3000              {SYSV}
8192
Remote Shellremsh
rsh
rshremshrshrshrsh
YP/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/exports
NFS Client mounted directories/etc/xtab /etc/xtab/var/lib/nfs/xtab/etc/rmtab/var/adm/mountdtab
Max 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/fstab
Free disk blocksdf -kdf -kbdfdf -kdf -kdf -k
Device 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>inquiry
file /dev/rrz0c
Disk Labellspv -l hdisk#disklabel ad0pvdisplay -v /dev/dsk/C#t#d#fdisk -lprtvtocdisklabel -p rz0
LVM ConceptsPartition sub disklogical extentslogical extentssub disksub disk
 VolumeVolumelogical volumelogical volumeVolumeVolume
  Plex  PlexPlex
 Volume group volume groupvolume groupdisk groupdisk group
Journal Filesystem typejfs vxfsext3
reiserfs
vxfsadvfs
Default volume group/dev/rootvg /dev/vg00 /dev/vx/dsk/rootdg/dev/vol/rootdg
Display volume grouplsvg -l rootvg vgdisplay -v vg00vgdisplay -vvxprint -l -g rootdgvolprint -l -g rootdg
Modify physical volumechpv pvchangepvchange  
Prepare physical diskmkdev -c disk -l hdisk# pvcreatepvcreatevxdiskaddvoldiskadd
List physical volumelspvvinum ldpvdisplaypvdisplayvxprint -dlvolprint -dl
Remove disk from volume groupreducevg vgreducevgreducevxdg rmdiskvoldg rmdisk
Move logical volumes to another physical volumesmigratepvvinum move -f drive objectpvmovepvmovevxassist movevolassist move
Create volume groupmkvg vgcreatevgcreatevxdg initvoldg init
Remove volume group  vgremovevgremove  
Volume group availabilitychvg
varyonvg
varyoffvg
 vgchangevgchange  
Restore volume group  vgcfgrestorevgcfgrestore  
Exports volume groupexportvg vgexportvgexportvxdg deportvoldg deport
Imports volume groupimportvg vgimportvgimportvxdg importvoldg import
Volume group listinglsvg vgscanvgscan  
Change logical volume characteristics chlv lvchangelvchange vxedit setvoledit set
List logical volumelslvvinum lvlvdisplaylvdisplayvxprint -vlvolprint -vl
Make logical volumemklv lvcreatelvcreatevxassist makevolassist make
Extend logical volumeextendlv lvextendlvextendvxassist growtovolassist growto
Reduce logical volumeAIX reduce LV lvreducelvreducevxassist shrinktovolassist shrinkto
Remove logical volumermlvvinum rm vollvremovelvremovevxedit rmvoledit -g rootdg -rf rm vol1
Prepare 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} /mt
resize2fs
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=true
Add 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=stripe
System recovery tapemksysb -i /dev/rmt0 /opt/ignite/bin/make_recovery  /usr/sys/bin/btcreate
Backupsavevg -i rootvgvinum saveconfigfbackuptar cvf /dev/rst0 /ufsdumpvdump
Restorerestvg  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.d
Kernel/usr/lib/boot/unix_up/kernel/stand/vmunix/boot/vmlinuz/kernel/genunix/vmunix
Kernel Parameterslsattr -E -l sys0sysctl -asysdef
kmtune
kmsystem
sysctl -asysdef -isysconfig
dxkerneltuner
Reconfigure the kernel
chdev -l sys0 -a 
cd /sys/i386/conf
vi KERNEL
config KERNEL
cd ../../compile/KERNEL
make depend
make
make install
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

vi /etc/system
reboot
doconfig
List modulesgenkexkldstatkmadmin -slsmodmodinfo 
Load module kldloadkmadmin -Linsmodmodload 
Unload module kldunloadkmadmin -Urmmodmodunload 
Initialize systeminstall_assist/stand/sysinstallset_parms initialnetconfsys-unconfignetsetup
Physical RAMbootinfo -rsysctl hw.physmemgrep -i Physical /var/adm/syslog/syslog.logfreeprtconfuerf | grep memory
Kernel Bitsbootinfo -K getconf KERNEL_BITSgetconf LONG_BITisainfo -kv64
Crash utilitycrashcrashadblcrashcrashkdbx
Trace System Callssyscallstrusstuscstracetrusstrace
Machine modeluname -m
bootinfo -m
uname -mmodel
uname -m
uname -muname -impuname -p
OS Levelosleveluname -runame -runame -runame -rsizer -v
Run Levelwho -r who -rrunlevelwho -rwho -r
Core 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 Shell
ok 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 s
Maintenance mode ok boot -as>boot
Interact with IPL ?Y
ISL>hpux -lm
 ok boot -as 
Interrupt Key  control-B Stop-Acontrol-P
Return 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
Software
AIX
 
HP-UX
LINUX(RedHat)
SOLARIS
Tru64
Install Softwareinstallp -apkg_addswinstallrpm -i packagepkgaddsetld -l
Uninstall softwareinstallp -upkg_deleteswremoverpm -e packagepkgrmsetld -d
List installed softwarelslpp -L allpkg_info -aswlistrpm -qapkginfosetld -i
Verify installed softwarelppchk -v swlist -l fileset -a staterpm -V packagepkginfo -i
pkginfo -p
setld -v
List all fileslslpp -f filesetpkg_info -L packageswlist -l file filesetrpm -ql packagepkgchk -l packagesetld -i package
List installed patchesinstfix -i swlist -l patch
what /stand/vmunix
 patchadd -pdupatch -track -type patch
Package ownerlslpp -w path swlist -l file | grep pathrpm -qf filepkgchk -l -p path 
SW Directory/usr/lpp/var/db/pkg/var/adm/sw//var/lib/rpm/var/sadm/var/adm/smlogs
Devices
AIX
FreeBSD
HP-UX
LINUX(RedHat)
SOLARIS
Tru64
Devices/dev/dev/dev/dev/devices/dev
Install devices for attached peripheralscfgmgr -v/dev/MAKEDEVinsf -e/dev/MAKEDEVdrvconfig
devlinks
disks
tapes
ports
scu scan edt
scsimgr -scan_all
Remove devicermdev -l rmsf rem_drv 
Device driverslscfg lsdev prtconf -D 
CPUlsdev -Cc processorsysctl hw.modelioscan -fnC processorcat /proc/cpuinfopsrinfo -vpsrinfo -v
List Terminallsdev -Cc tty ioscan -fnC tty pmadm -l 
Diagnosticsdiagpciconf -lstmlspci
pnpdump
/usr/platform/`uname -m`/
sbin/prtdiag
ok test-all
/opt/SUNWvts/bin/sunvts
 
Whole Disk/dev/hdisk#/dev/ad0s1c/dev/dsk/c#t#d0/dev/sda/dev/c#t#d0s2/dev/rz0c
CDROM/dev/cd0/dev/acd0c/dev/dsk/c#t2d0/dev/cdrom/dev/dsk/c#t6d0s2/dev/rz3c
CDROM file typecdrfscd9660cdfsiso9660hsfscdfs
Rewinding tape drive/dev/rmt0/dev/rwt0d/dev/rmt/0m/dev/rst0               { c 9 0}/dev/rmt/0/dev/rmt0
Non-rewinding tape drive/dev/rmt0.1/dev/nrwt0d/dev/rmt/0mn/dev/nrst0           { c 9 128 }/dev/rmt/0n/dev/nrmt0
Floppy drive/dev/rfd0/dev/fd0-/dev/fd0/dev/diskette/dev/fd0c
Links
AIX
FreeBSD
HP-UX
LINUX(RedHat)
SOLARIS
Tru64
FAQAIX-FAQFreeBSD FAQHP-UX FAQLINUX FAQSolaris 2 FAQTru64 FAQ
Online ManualAIX 5.3 DocsFreeBSD Hand BookHP-UX Reference ManualLinux Documentation ProjectSolaris 10 DocumentationTru64 Documents
Technical Supportp5 TechSupport IT Resource CenterRed Hat supportSunSolveAlpha Systems Support
Phone Number1-800-CALL-AIX 1-800-633-36001-888-REDHAT11-800-USA-4SUN1-800-474-6836
Free SoftwarePublic Domain Software LibraryFreeBSD Primary SiteHP-UX PortsLinux Software MapSun FreewareTru64 Demos, Shareware & Freeware
Certificationwww.ibm.com education.hp.comRHCEsuned.sun.comASE Information


'Unix Linux' 카테고리의 다른 글

Vi(m) 사용시 ^M 없애기  (0) 2006.12.14
솔라리스 메모리 관리  (0) 2006.11.10
vim 설정 및 활용  (0) 2006.11.10