AIX 常用命令及功能一览表.docx
《AIX 常用命令及功能一览表.docx》由会员分享,可在线阅读,更多相关《AIX 常用命令及功能一览表.docx(21页珍藏版)》请在冰豆网上搜索。
AIX常用命令及功能一览表
AIX常用命令及功能一览表
下面是常用的一些命令的语法以及功能描述:
oslevelReturnsoperatingsystemlevel
whence(program)Returnsfullpathofprogram
whereis(program)Returmsfullpathofprogram
lslpp-Lalllistallinstalledsoftware
lslpp-L(programsetname)Checkifsoftwareinstalled
lslpp-fListsfilesetsvspackages
instfix-ik(fixnumberegIX66617)Checksidfixisinstalled
compress-cfile.txt>file.ZCreateacompressedfile.
uuencode(infile)(extract-file-name)>(outputfile)
ConvertsabinaryfiletoanASCIIfilefortransferbymodemoremail
uudecode(encodedfile)
Extractsabinaryfilefromencodedfileandcallsittheextract-file-name
examples:
-
uuencodemaymapmaymap>maymap.enc
uuencodemaymap.enc
od-c/tmpDisplayscontentsofthe/tmpdirectoryfile
ls-iListsfileswiththeirinodenumbers
echo*Listsfiles,canbeusediflsiscorrupt/missing
alog-o-tbootViewthebootlog
chtz(timezoneegGMT0BST)Changesthetimezonein/etc/environmentfile
chlang(languageegEn_GB)Changesthelanguagein/etc/environmentfile
ar-v-t/usr/lib/libC-r.aListsallobjectsinlibC_r.alibrary
--------------------------------------------------------------------------------
TERMINALS
--------------------------------------------------------------------------------
ttyDisplayswhatthetty/ptynumberoftheterminalis.
termdefreportsthetermtypesetupinsmitforthettyport
thattermdefisrunon.
chdev-l(deviceegtty1)-aterm=vt100Setsttytoavt100terminaltype
penabletty0addsgettylineinto/etc/inittabfortty0andstartsgetty
pdisabletty0disablesthegettylineanddisablesgetty
penable/pdisable-aoptionisforall
sttyerase^?
Setbackspacekeyforvt100terminals
sttyerase^HSetbackspacekeyforwyse50terminals
lsconsDisplaystheconsoledevice
chcons-alogin=enable(deviceeg/dev/tty1)Changestheconsoledevice
Createttysonports0to7onadaptersa2:
-
foriin01234567
do
mkdev-ctty1-ttty-srs232-psa2-w$i-alogin=enable-aterm=vt100
done
--------------------------------------------------------------------------------
NETWORK
--------------------------------------------------------------------------------
host(iporhostname)Resolvesahostname/ipaddress
hostnameDisplayshostname
hostname(hostname)Setsthehostnameuntilnextreboot
chdev-l(devicename)-ahostname=(hostname)Changeshostnamepermanently
chdev-linet0-ahostname=thomas
ifconfig(devicename)Displaysnetworkcardsettings
ifconfig(devicename)upTurnsonnetworkcard
ifconfig(devicename)downTurnsoffnetworkcard
ifconfig(devicename)detachRemovesthenetworkcardfromthe
networkinterfacelist
ifconfigen0inet194.35.52.1netmask255.255.255.0up
ifconfiglo0alias195.60.60.1Createaliasipaddressforloopback
route(add/delete)(-net/-host)(destination)(gateway)
Addsordeletesroutestoothernetworksorhosts,doesnotupdate
theODMdatabaseandwillbelostatreboot.
routeadd-net194.60.89.0194.60.90.4
netstat-iDisplaysinterfacestatistics
entstat-d(ethernetadapteregen0)Displaysethernetstatistics
arp-aDisplaysiptomacaddresstablefromarpcache
no-aDisplaysnetworkoptionsuse-otosetindividualoptionsor
-dtosetindividualoptionstodefault.
no-ooption=value(thisvalueisresetatreboot)
no-o"ipforwarding=1"
traceroute(nameoripaddress)Displaysallthehopsfromsourceto
destinationsupplied.
ping-R(nameoripaddress)Sameastracerouteexceptrepeats.
--------------------------------------------------------------------------------
N.F.S.
--------------------------------------------------------------------------------
exportfsListsallexportedfilesystems
exportfs-aExportsallfs'sin/etc/exportsfile
exportfs-u(filesystem)Un-exportsafilesystem
mknfsConfiguresandstartsNFSservices
rmnfsStopsandun-configuresNFSservices
--------------------------------------------------------------------------------
BACKUPS
--------------------------------------------------------------------------------
MKSYSB
------
mkszfile-fCreates/image.datafile(4.xonwards)
mkszfile-XCreates/fs.sizefile(3.x)
mksysb(deviceeg/dev/rmt0)
CPIOARCHIVE
------------
find(filesystem)-print?
cpio-ocv>(filenameordevice)
egfind./usr/-print?
cpio-ocv>/dev/rmt0
CPIORESTORE
------------
cpio-ict<(filenameordevice)?
moreListsarchive
cpio-icdv<(filenameordevice)
cpio-icdv<(filenameordevice)("filesordirectoriestorestore")
egcpio-icdv
cpio-icdv
TARARCHIVE
-----------
tar-cvf(filenameordevice)("filesordirectoriestoarchive")
egtar-cvf/dev/rmt0"/usr/*"
TARRESTORE
-----------
tar-tvf(filenameordevice)Listsarchive
tar-xvf(filenameordevice)Restoreall
tar-xvf(filenameordevice)("filesordirectoriestorestore")
use-poptionforrestoringwithorginalpermissions
egtar-xvf/dev/rmt0"tcpip"Restoredirectoryandcontents
tar-xvf/dev/rmt0"tcpip/resolve.conf"Restoreanamedfile
AIXARCHIVE
-----------
find(filesystem)-print?
backup-iqvf(filenameordevice)
Backupbyfilename.
egfind/usr/-print?
backup-iqvf/dev/rmt0
backup-(backuplevel0to9)-f(filenameordevice)("filesystem")
Backupbyinode.
egbackup-0-f/dev/rmt0"/usr"-uoptionupdates/etc/dumpdatesfile
AIXRESTORE
-----------
restore-qTvf(filenameordevice)Listsarchive
restore-qvxf(filenameordevice)Restoresall
restore-qvxf(filenameordevice)("filesordirectoriestorestore")
(use-dforrestoredirectories)
--------------------------------------------------------------------------------
Copyingdiskettesandtape
--------------------------------------------------------------------------------
COPYINGDISKETTES
-----------------
ddif=/dev/fd0of=(filename)bs=36b
ddif=(filename)of=/dev/fd0bs=36bconv=syncorflcopy
COPYINGTAPES
-------------
ddif=/dev/rmt0of=(filename)
ddif=(filename)of=/dev/rmt0ortcopy
--------------------------------------------------------------------------------
VICommands
--------------------------------------------------------------------------------
:
g/xxx/s//yyy/globalchangewherexxxistobechangedbyyyy
sed's(ctrlvctrlm)g//g'old.filename>new.filename
Stripsout^Mcharactersfromasciifilesthathavebeentransferredasbinary.
Toentercrontrolcharacterstypectrlvthenctrl?
where?
iswhatever
ctrlcharacteryouneed.
--------------------------------------------------------------------------------
DEVICES
--------------------------------------------------------------------------------
lscfglistsallinstalleddevices
lscfg-vlistsallinstalleddevicesindetail
lscfg-vl(devicename)listsdevicedetails
bootinfo-Treportstypeofmachineierspc
bootinfo-rreportsamountofmemory(/by1024)
bootinfo-s(diskdevice)reportssizeofdiskdrive
mknod(device)c(majorno)(minorno)Createsa/dev/devicefile.
mknod/dev/null1c23
lsdev-Clistsallcustomiseddevicesieinstalled
lsdev-Plistsallpre-defineddevicesiesupported
lsdev-(CorP)-c(class)-t(type)-s(subtype)
chdev-l(device)-a(attribute)=(newvalue)Changeadeviceattribute
chdev-lsys0-amaxuproc=80
lsattr-EH-l(device)-DListsthedefaultsinthepre-defineddb
lsattr-EH-lsys0-amodelname
rmdev-l(device)Changedevicestatefromavailabletodefined
rmdev-l(device)-dDeletethedevice
rmdev-l(device)-SRSstopsdevice,Runconfigureschilddevices
lsresource-l(device)Displaysbusresourceattributesofadevice.
PowerManagement(PCImachines)
-------------------------------
pmctrl-aDisplaysthePowerManagementstate
rmdev-lpmc0UnconfigurePowerManagement
mkdev-lpmc0ConfiguterPowerManagement
--------------------------------------------------------------------------------
TAPEDRIVES
--------------------------------------------------------------------------------
rmt0.xwherex=A+B+C
A=density0=high4=low
B=retension0=no2=yes
C=rewind0=no1=yes
tctl-f(tapedevice)fsf(No)Skipsforward(No)tapemarkers
tctl-f(tapedevice)bsf(No)Skipsback(No)tapemarkers
tctl-f(tapedevice)rewindRewindthetape
tctl-f(tapedevice)offlineEjectthetape
tctl-f(tapedevice)statusShowstatusoftapedrive
chdev-lrmt0-ablock_size=512changesblocksizeto512bytes
(4mm=1024,8mm=variablebut
1024recommended)
bootinfo-eanswerof1=machinecanbootfromatapedrive
answerof0=machineCANNOTbootfromtapedrive
diag-c-d(tapedevice)Hardwareresetatapedrive.
--------------------------------------------------------------------------------
PRINTQUEUES
--------------------------------------------------------------------------------
export$LPDEST="pqname"Setdefaultprinterqueueforloginsession
lsvirprtLists/changesvirtualprinterattributes.
qpri-#(jobNo)-a(newpriority)Changeaqueuejobpriority.
qhld-#(jobNo)Putaholdonhold
qhld-r#(jobNo)Releaseaheldjob
qchk-AStatusofjobsinqueues
lpstat
qcan-x(jobNo)Cancelajobfromaqueue
cancel(jobNo)
enq-U-P(queue)Enableaqueue
enable(queue)
enq-D-P(queue)Disableaqueue
disable(queue)
qmov-m(newqueue)-#(jobNo)Moveajobtoanotherqueue