Sie sind auf Seite 1von 15

AIX KNOWLEDGE BASE

IMPORTANT FILES
/etc/hosts

- provides a list of server names or aliases and their IP


addresses.

/etc/resolv.conf

- DNS Informations like DNS Server & IP.

/etc/security/limits

- contains stanzas that specify the process resource limits


for each user

/etc/security/environ

- Contains the environment attributes for users.

/etc/security/lastlog

- Contains the last login attributes for users.

/etc/security/limits

- Contains process resource limits for users.

/etc/security/user

- Contains extended attributes for users.

/usr/lib/security/mkuser.default

- Contains the default attributes for new users.

/usr/lib/security/mkuser.sys

- Customizes new user accounts.

/etc/passwd

- Contains the basic attributes of users.

/etc/security/passwd

- Contains password information.

/etc/security/login.cfg

- Contains system default login parameters.

/etc/utmp

- Contains a record of users logged into the system.

/var/adm/wtmp

- Contains connect-time accounting records.

/etc/security/failedlogin

- Records all failed login attempts.

/etc/motd
/etc/environment

- Contains the message to be displayed every time


a user logs in to the system.
- Specifies the basic environment for all processes.

/etc/profile

- Specifies additional environment settings for all users.

$HOME/.profile

- Specifies environment settings for a specific user.

/etc/group

- Contains the basic attributes of groups.

/etc/security/group

- Contains the extended attributes of groups.

/etc/nologin

- If the file exists, the system prevents the user from

logging in.
/var/adm/cron/cron.allow and
/var/adm/cron/cron.deny

- control which users can use the crontab command

/var/adm/cron/at.allow and
/var/adm/cron/at.deny

- that control which users can use the at command.

/var/spool/mqueue/log

- Log file for sendmail.

/var/spool/mail

- System mailbox

$HOME/mbox

- Personal mailbox

$HOME/dead.letter

- incomplete message

ADMIN COMMANDS
# /usr/bin/tcbck

- To check if TCB is enabled on your system

# installp

- Used to install and update software products.


[ # smitty installp]

# oslevel -r

- To determine the current maintenance level

# installp -L -d /dev/cd0

- To list the software that is on your CD-ROM

# smitty install_latest

- Install and update from latest avbl S/W products

# lslpp

- Displays information about installed filesets.

# instfix -T -d /dev/cd0

- To list fixes that are on a CD-ROM in /dev/cd0,

# smitty bffcreate

- To create installation images on your hard disk

# lppchk -v

- used to verify whether the software installed on your


system is in a consistent state.

# bootlist -m normal -o

- to display a boot list (AIX Version 4.2 or later).

# bootlist -m normal -f filename

- Change the bootlist as per listed in the file.

# bootinfo -y

- identify the type of system H/W, eg: 32-bit or 64-bit.

# lsitab init

- to find what the default run level is on your system.

# smit mkroute

- to add a route to the private network through the


gateway between two networks.

# smit mktcpip

- Add /Change IP address.

# ifconfig en0 up

- To activate a network interface named en0.


[ eg: # ifconfig en0 10.1.2.3 netmask 255.255.255.0 up]

# smitty chgenet

- Change Link Speed.

# lsps -a

- To display the usage of the paging space,

# chps -s LPno LVname

- to dynamically increase the size of a paging space.


[ eg: chps -s 3 hd6 - to increase the size of hd6 with 3 LP ]

# chps -d LPno LVname

- to dynamically decrease the size of a paging space


[eg: chps -d 1 hd6 - to decrease the size of hd6 with 1 LP]

# migratepv -l hd6 hdisk0 hdisk1

- to move the default (hd6) paging space from hdisk0 to


hdisk1

# swapoff /dev/paging03 (not hd6)

- to deactivate paging space paging03.

# rmps paging03

- To remove the paging space paging03

# telinit M

- Changes Runlevel ( M = Maintenance MOde).

# odmget -q name=hdisk0 CuAt

- to list ODM class CuAt about all attrib of the obj.


hdisk0.

# mknfs -N

- to start the NFS daemons immediately.

# startsrc -s nfsd

- to start the nfsd daemon.

# startsrc -g group

- to start all of the NFS daemons.

# lssrc -g nfs

- List all the daemons in the nfs service currently


running.

# showmount -e MyServer

- Shows remotely mounted filesystems.

# exportfs -i /dirname

- to export a filesystem temporarily


[ the -i option will skip checking /etc/exports ]

# smitty rmnfsexp

- to unexport an NFS.

# exportfs -u dirname

- to unexport an NFS.

# ifconfig en0

- To check IP address and Link Status

# lsattr -El lo0

- To check IP address

# netstat -nr

- Shows the routing table.

DEVICES
# lscfg -v -p -l rmt0

- Displays te details about a device rmt0


[ -v =Vital Product Data, -p =Platform, -l =Device ]

# lsdev -Cc deivce {disk,tape,adapter}

- To show the disk drives on the system.


[ -C =Cust. DB, -c =Class ]
[ eg: # lsdev -Cc processor ]

# lsattr -El proc0

- To learn more about a particular processor.

# lsattr -El sys0 | grep realmem

- To discover how much memory is installed.

# rmdev -l rmt0

- Remove dev. from Avlble to Defined State

# rmdev -dl rmt0

- Delete the dev from ODM.

# smitty chdev

[ chdev -l ]

- Modify device attributes.


[ # chdev -l rmt0 -a block_size=512 ]

LVM
# lspv

- to display physical volume Information

# lspv -l hdisk0

- display the names of all the LVs that have at least one
partition located on the physical volume
[-p to display the allocation of PPs to logical volumes]
[-M command to display the layout of a physical

volume]
# chdev -l hdisk7 -a pv=yes

- changes an available disk device to a physical volume


by assigning a PVID

# chdev -l hdisk7 -a pv=clear

- clears the PVID from the physical volume

# chpv -an hdisk2

- disable the ability to allocate new free physical


partitions from hdisk2 to any logical volume.
-an = allocatable no
-ay = allocatable yes

# chpv -vr hdisk3

- makes hdisk3 unavailable.

# chpv -va hdisk3

- makes hdisk3 available again.

# chpv -c hdisk1
hdisk1.

- To clear the boot record located on physical volume

# chpv -hy hdisk3


-hn hdisk3
group.

- To define hdisk3 as a hot spare


- remove hdisk3 from the hot spare pool of its volume

# migratepv hdisk1 hdisk5

- migrates the data from hdisk1 to hdisk5.

# migratepv -l testlv hdisk1 hdisk5

- To migrate only physical partitions that belong to LV


testlv from hdisk1 to hdisk5.

# mkvg -y vg1 -s64 -V99 hdisk4

- to create an original volume group named vg1, with a


physical partition size of 64 MB, having major number
99 andusing the physical volumes hdisk4.

# mkvg -S -y testvg -s 128 -f hdisk3


[ -S = Scalable]

- to force the creation of a scalable volume group named


testvg, with a physical partition size of 128 MB, and
using physical volumes from hdisk3 and hdisk4.

# lsattr -El hdisk3|grep -i size_in_mb - To list the size of the disk in MB


# lsvg -o VGName

- Lists all VGs which are varied on (Active).

# lsvg -l VGName

- to display all logical volumes inside a VG

# lsvg -p test1vg

- to display all physical volumes contained in a VG.

# chvg -ay newvg [ chvg -an newvg ]

- Activates /Deactivates newvg

# chvg -Qy newvg [ chvg -Qn newvg ] - To turn off /ON the quorum.
# chvg -t 16 newvg

- Changing the max no. of PP per PV


[ which is called Factor ]

# chvg -G newvg

- To change the format of the VG newvg from original to


scalable.

# chvg -hy test1vg

- changes the hot spare policy of the volume group to


migrate data from a failing disk to one spare disk.

# chvg -hY test1vg

- changes the hot spare policy of the VG to migrate data


from a failing disk to the entire pool of spare disks.

# chvg -sy test1vg

- Changing synchronization policy of a VG


[ AUTO SYNC=yes ]

# chvg -L 128 newvg

- change the LTG size for the newvg

# chvg -v 4096 testvg

- to change the maximum number of LV within a VG.

# chvg -u

- remove the VG lock after an abnormal termination


of an LVM command

# lquerypv -M hdisk0

- to find the LTG size for a physical disk.

# extendvg -f test1vg hdisk4

- forcibly adds hdisk4 to volume group test1vg

# varyonvg testvg [ -f = force varying ] - Activate the volume group,


# varyoffvg testvg

- Dctivate the volume group,

# reducevg testvg hdisk7

- to delete physical volume hdisk7.

# reducevg -d testvg hdisk7

- to forcibly delete physical volume hdisk7.

# reducevg -f testvg hdisk7

- prompts the user for confirmation, deletes the


data located on PV hdisk7,and removes the
disk definition from the testvg volume group.

# synclvodm testvg

- To synchronize ODM to contain the latest


LVM information for VG testvg.

# exportvg testvg

- To export the volume group testvg.

# importvg -y testvg hdisk7

- To export the volume group testvg.

# importvg -y test2vg hdisk5

- To import the volume group from hdisk5


using the name test2vg.

# reorgvg test1vg

- To reorganize all logical volumes under test1vg.

# reorgvg testvg lv1 lv2

- To reorganize only LVs lv1 and lv1 from VG testvg.

# syncvg -p hdisk4 hdisk5

- To synchronize the copies located on PVs


hdisk6 and hdisk7.

# syncvg -v testvg

- To synchronize the all physical partitions from testvg.

# mirrorvg rootvg

- to mirror rootvg volume group

# bosboot -ad /dev/hdisk1

- Makes hdisk1 Bootable

# bootlist -m normal hdisk0 hdisk1

- Makes hdisk0 as primary and hdisk1 as


secondary bootable devices.

# splitvg -y newvg -c 1 test1vg

- splits test1vg and creates a snapshot VG named newvg.

# joinvg test1vg

- To rejoin the two copies of the volume group test1vg.

# mklv -y lv3 -t jfs2 -a im test1vg 10 hdisk5


- to create, within volume group test1vg,
a logical volume named lv3, of type jfs2,
having 10 logical partitions, located on hdisk5.
# mklv -y lv4 -t sysdump -a c -e x -c3
-L demo-label -x5 test1vg 2 hdisk5

- create, within volume group test1vg, a LV named


lv4, of type sysdump, having two LPs, each having
three copies, located on the center of three different
disks(hdisk5, hdisk6 and hdisk7), being labeled demolabel and having a maximum of five logical partitions.

# rmlv lv7

- prompts for user confirmation and then deletes lv7.

# rmlv -p hdisk7 lv1


prompts

- tries to delete partitions of lv1 located on hdisk7,


for uses confirmation.

# lslv -l lv1
volume lv1.

- percentage of logical partitions that belong to logical

# lslv -m lv1

- to display LPs and PPs number

# lslv -n hdisk6 testlv

- displays information about logical volume testlv read


from VGDA located on hdisk6.

# getlvcb -AT lv1

- display the LVCB of a logical volume.

# cplv -v dumpvg -y lv9 lv1

- copy lv1 to the dumpvg under the name of lv9.

# mklvcopy -k lv1 3 hdisk7 &

- to create and synchronize extra copies of LPs.

# chlv -x 1000 -d pr lv1

- change, for logicalvolume lv1, the maximum number of


logical partitions to 1000 and the scheduling policy for
I/O operations to parallel/round-robin.

# splitlvcopy -y copylv testlv 2

- splits the LV, prompts for user confirmation.

# crfs -v jfs2 -d /dev/copylv -m /copy

- creates the file system structure for copylv.

# rmlvcopy testlv 2 hdisk6

- removes copies located on hdisk6 and leaves

two mirror copies.

FILESYSTEMS
# rmfs /test

- to remove a file system /test

# defragfs /home

- To defragment the file system /home.

# istat /etc/passwd

- to display information regarding a particular inode.

# fuser -cu /test

- Lists the users/process using the directory

# fuser -ku /test

- kill all the users and process accessing the directory

# chfs -a "quota = userquota" /home

- to enable user quotas on the /home file system.

# cp /dev/null /etc/sandeep.txt

- To empty a file

DIAGONISATION COMMANDS
# /usr/lib/errdemon

- To start the error logging daemon.

# /usr/lib/errstop

- To stop the daemon.

# /usr/lib/errdemon -l

- To determine the path to your system's error log file.

# errpt -a

- To display a complete summary rep of the errors that


have been recorded.

# errpt -j 8527F6F4

- To display all the errors which have a


specific error ID.

# errpt -s 1122164405 -e 1123100405

- To display all the errors logged in a specific


period of time.

# errclear 0

- To delete all the entries from the error log

# errclear -d S 0

- To delete all entries in the error log classified


as S/W errors.

# errlogger "This is a test"

- allows you to log operator messages to the


system error log.

# errinstall

- Installs messages in the error logging message sets.

# errupdate

- Updates the error record template repository.

# errmsg

- Adds a message to the error log message catalog.

# errupdate

- Updates the error record template repository.

# ras_logger

- Provides a way to log any error from the command


line. It can be used to test newly created error templates
and provides a way to log an error from a shell script.

# sar 2 5

- To reprt current activity for each 2 sec. for the next 5 sec.

# topas

- reports vital stats abt the activity of the local system on


a character terminal with a default interval of 2 seconds.

# netstat -i

- to find both the MAC add and IP add for the interfaces.

# iostat -T -d 1 60

- command to monitor disk activity for 60 seconds.

# procmon [ GUI ]
system.

- allows to view and manage the processes running on a

# lscfg -vp|grep -ip cabinet

- display stanzas that contain the system


M/C type and Sl.No.

# prtconf
the system.

- to display relevant information about the H/W & S/W of

# lsrsrc

- To display the classes available on the machine.

# diag

- a tool having a wide choice of tasks and service aids.

# sysdumpdev -l

- To list the current dump destination.

# sysdumpdev -L

- To show statistical info about the previous dump.

# sysdumpdev -e

- To determine the minimum size for the dump space.

# sysdumpdev -P -p /dev/dumpdev

- to change the prim. dump dev. frm /dev/hd6


to LV /dev/dumpdev.

# snap -gfkD -o /dev/rmt0

- to copy general system information, including file


system, kernel params and dump info to rmt0.

# kdb /var/adm/ras/vmcore.0 /unix

- to invoke the kdb command using a dump file named


/var/adm/ras/vmcore.0 and the kernel file named /unix.

# alog -t boot -o|more

- To display the boot log, use the command.

# usrck -n ALL

- To verify that all the users exist in the user database,


and have any errors reported (but not fixed).

# usrck -y ALL

- To delete, from the user definitions, those users


who are not in the user database files, and have any
errors reported.

# grpck -n ALL

- To verify that all the group members and administrators


exist in the user database, and have any errors reported.

# grpck -p ALL

- To verify that all the group members and admins exist


in the user database and to have errors fixed.

# grpck -t install

- To verify the uniqueness of the group name and group


ID defined 3 for the install group.

# pwdck -y ALL

- To verify that all local users have valid passwords.

# pwdck -y gpsilva

- To ensure that user ariel has a valid stanza


in the /etc/security/passwd file.

# sysck

- checks file definitions against the extracted files from


the installation and update media and updates the
Software Vital Product Data (SWVPD) database.

# sysck -i -f smart.rte.inventory smart.rte


- To add the definitions to the inventory database and
check permissions, links, checksums, and so on.
# sysck -u -f smart.rte.inventory smart.rte
- To remove any links to files for a product that has been
removed from the system and remove the files from the
inventory database.
# lsslot -c pci

- To display the number, location, and capabilities


of hot plug PCI slots.

# ping -c 5 server2

- To check the N/W conn to a host and specify


5 echo requests to send.

# arp -a

- Displays and modifies the Internet-to-physical address


(MAC address) translation tables used by the ARP.

BACKUP & RESTORE


# mksysb

- to back up a root volume group only, not user VGs.

# mksysb -e /dev/rmt0

- to exclude the contents of the exclude.rootvg

# cat /etc/exclude.rootvg

- to exclude some data file systems from the system,


you need to edit the /etc/exclude.rootvg file.

# smitty mksysb

- to create a bootable system backup

# smitty lsmksysb

- to verify the content of an mksysb image

# smitty restmksysb

- to restore the system image (mksysb)onto target systems

# savevg -r -f /vg_
bkup/sandeep_vg sandeep

# restvg -d /vg_bkup/sandeep_vg
hdisk2

- to back up only the a user VG's (sandeep) structure


information to the /vg_bkup/sandeep_vg file.

- to restore a backedup image from a file to a disk hdisk2.

# backup -0 -u -f /dev/rmt0 /

- To back up the / (root) file system.


-0 = Level of backup.
-u = Updates the /etc/dumpdates file with the raw
device name of the file system and the time,
date, and level of the backup.
You must spec the -u flag if you r making
incremental bakups.
-f = Specifies the output device.

# restore -xdvqf /dev/rmt0 /sandeep

- To restore a specific directory and the contents of that


directory from a file-name archive.

# restore -rvqf /dev/rmt0

- To restore an entire file-system archive

# tar -c file1 file2

- To write the files to a new archive on the


default tape drive.

# tar -xm -f/dev/rmt2 /tmp

- To extract all files in the /tmp directory from the archive


file on the /dev/rmt2 tape device and use the time of
extraction as the modification time.

# tar -cvf fl.tar -L fl_list

- To archive a list of all files that is listed in the file


through the InputList argument of the -L option.

# cpio -ov <filenames >/dev/fd0

- To copy files onto diskette

# pax -wf /dev/rmt0

- To copy the contents of the current directory to the


tape drive

# pax -x pax -wvf /dev/rmt0


/var/adm/a.log /var/adm/b.log

- To create a pax comma archive on tape that cont. 2 files.

# pax -rw run.pax /tmp

- To copy the file run.pax to the /tmp directory.

# mkcd -d /dev/cd1

- To generate a bootable system backup to the


CD-R dev /dev/cd1.

# mkcd -d /dev/cd1 -L

- To generate a system backup to the


DVD-R dev /dev/cd1.

# mkcd -d /dev/cd1 -v myvg

- To generate a non-bootable VG backup of the


myvg to /dev/cd1

# gzip -c sandeep

- To compress a file.

# gzip -d sandeep.gz

- To decompress a file.

# gzip -t sandeep.gz

- To test a compressed a file.

# tcopy /dev/rmt0

- The tcopy command verfies / confirms the layout


of the mksysb image:

DAILY MANAGEMENT
# smitty users

- For User Management.

# lsuser ALL

- To display all the attributes of all the users

# lsuser -f -a id pgrp home root

- To display the user ID and group-related information


for the root account in stanza form.

# who
system.

- to disp info abt all the users who are logged on to the

# who am i

- to display information about your user name.

# who -r

- to display the run-level of the local system node.

# who -p

- to display any active process that was spawned by init.

# ps -f -l -ujim,jane,su

- To list processes owned by specific users

# ps -M

- To list all the 64-bit processes.

# kill -9 -1

- To stop all processes that you own

# nice [ renice ]

- To change the priority of a process.

# fuser -u /etc/filesystems
processes

- To list the process numbers and user login names of


using the /etc/filesystems file.

# fuser -k -x -u -c /dev/hd1
system

- To terminate all of the processes using a given file

# topas -i5 -n0 -p10


any

- to view the top 10 processes in use while not displaying


network interface statistics, in five second intervals.

# at -f filename -t CCYYMMDDhhmmSS Increment - CC-1st 2 digi of Year, YY-2nd 2 digi, MMMonth, DD-day of d month
hh-Hour, mm- Min, SS-Sec, Increment-a + sign
followed by a no.
# atq

- Shows / Verifies the sheduled job name


[ Reads the /var/spool/cron/atjobs directory ]

# crontab -l

- Lists the contents in /var/spool/cron/crontabs directory.

# crontab minute hour date month day command


- makes ashedule for a command to run
# crontab 0,15,30,45 8-17 * * 1-5 /home/script1
- To execute a command called script1 every 15 min b/w
8 AM and 5 PM, Monday through Friday.
# crontab -e

- to create and update the crontab file.


The crontab command invokes the editor.

# crontab -v

- to check the crontab submission time

# crontab -r sandeep

- removes the /var/spool/cron/crontabs/sandeep file

# telinit option

- switches runlevels.

# CommandName&

- To run a process in the background

# fg 589934

- To bring the process [589934]in to the foreground.

# nohup find / -type f &

- To run the find command and leave it running


after you log off.

# john: /dev/null

- To automatically delete mail for user john


eg: for users who do not need to actively check their

mail.
# mailq

- Prints the contents of the mail queue.

PRINTER ADMIN
# lpstat

- displays info about the current status of the line printer.

# qchk

- displays the current status of the specified print jobs,


print queues, or users.

# lpq
associated

- Reports the status of the specified job or all jobs


with the specified UserName and JobNumber variables.

# lpr /etc/passwd

- To print the file when facilities become available.

# enq -D -P 'lpforu:lp0'

- Disable the print queue lpforu having a device lp0.

# enq -U -P 'lpforu:lp0'
# enable lpforu:lp0

|
|

- To restart the print queue.

#
#
#
#

|
|
|
|

- To Cancel the print job.

qcan -P lpforu -x 3
cancel 3
lprm -P lpforu 3
enq -P lpforu -x 3

Das könnte Ihnen auch gefallen