Aix Commands
Aix Commands
Maximums
The smallest file extension is 4Kb. If a user creates or extends a file anywhere from 0-4096 bytes, a 4K
block will be allocated from the free list to accommodate that request. When a file system is extended by 1
Physical Partition (4 MB), 1024 inodes are allocated to that file system.
Maximums
of page
Path Definitions/Usage
Directory What's in it
/bin utilities
/sbin files needed to boot the machine and mount the /usr file system
/dev special files (I/O devices)
/etc miscellaneous administrative utilities
/home user directories and files
/lib libraries
/tmp temporary files. Needs to be at least 12 MB
/usr common executables that are shared across the same architecture
/usr/adm administrative commands and files
/usr/bin utilities (overflow for /bin)
/usr/lib archive libraries, text processing macros
/usr/spool/mail Email files
/usr/sbin utilities used in system administration, including smit
/usr/share architecture-independent, shareable text files
/usr/share/man manual pages
/usr/share/dict spelling dictionary and its indexes
/usr/share/info InfoExplorer database files
/usr/share/lib architecture-independent data files, including terminfo
/usr/share/lpp data about optional program products (OPP)
/var/adm system logging and accounting files
/var/preserve preserved data from interrupted edit sessions
/var/spool spool iles for printing
/var/tmp temporary files
cat
top of page
chlv
chlv -x 256 <lv_name> (Where logical volume name is entered without the /dev)
top of page
chfs
Changes attributes of a file system. Block size for this command is 512 byte blocks, where the command df,
returns disk info in 1024 byte blocks. The simplest method of extending a file system is to
Take the target size of the file system in MB's and multiple by 2000.
If the file system size is to be extended to 12MB in size, then 12 * 2000 = 24000.
Remember, when you extend a file system, you extend the logical volume that resides under it. Most
systems have a default Physical Partition size of 4MB (review output of lsvg rootvg command) and
therefore when the file system increases in size, it will increase by a multiple of 4MBs.
top of page
top of page
crfs
Adds a new file system. Block size for this command is 512 byte blocks, where the command df, returns
disk info in 1024 byte blocks.
The above command creates a 50MB journeled file system named /mydata with read/write permissions,
created under the volume group, rootvg
top of page
del
Delete files where system will prompt you to delete the file(s).
del /u/roger/*
If 'y' is entered for yes, all files will be removed.
top of page
df
df -v
top of page
dircmp
Compares two directories and the contents of all files found in both directories.
top of page
du
Display a summary of disk usage for directories (output in 512 byte blocks). Without an argument, du lists
the current directory.
top of page
fsck
Checks and interactively repairs inconsistent file systems. File systems are normally checked everytime the
system is rebooted. If a file system is cleanly unmounted via the umount command, it's unlikely to encounter
any problems when the fsck command is run on the file system again. Fsck can only be run on a file system
that is unmounted (fsck will not make changes to a mounted file-system). If fsck passes without errors, its
safe to mount the file system in question.
If there's a discrepancy between the number of directory references to a file and the link count in
the file and the file contains data (UNCLAIMED BLOCKS), the file is linked into the subdirectory
named lost+found directory.
fsck does not flag a bad block on your Physical Volume.
Bad blocks are only relocated on a write operation.
Fsck performs read operations and therefore is useful for soft errors - not hard errors.
Also updates the JFS log - /dev hd8
dd count=1 bs=4k skip=31 seek=1 Use this command in case the superblock is corrupted. This will
if=/dev/hd4 of=/dev/hd4 restore the BACKUP COPY of the superblock to the CURRENT
fsck /dev/hd4 2>&1 | tee copy.
/tmp/fsck.errors
top of page
fuser
fuser -u /dev/hd3
Sample output: /dev/hd3: 2964(root) 6615c(root) 8465(casado) 11290(bonner)
top of page
istat
top of page
ln
Gives a file more than one name (alias). The symbolic link (-s) allows a user to point to a file and/or a
directory. Symbolic links can link either a file or directory across a file system. Use unlink to remove a link.
ls
top of page
mkfs
Example:
cd /u
find . -print|backup -ivqf/dev/rmt0
cd /
umount /u
mkfs dev/hd1
fsck -p /dev/hd1
mount /u
cd /u
restore -xvf/dev/rmt0
The above procedure is one way of making a file system contiguous again. Over the course of time,
thousands of additions, deletions, creation, and extensions of files and/or records will create a file system
that looks like Swiss cheese. This results in multiple disk accesses that formally may have taken only one.
As a result, the system appears sluggish.
top of page
mount
Displays file system attributes or makes file system available for use.
top of page
mv
top of page
mvdir
Renames a directory.
top of page
rm
top of page
rmfs
rmfs /u
Removes a file system and the logical volume under it. The file system must be unmounted prior to the 'rmfs'
command being executed else you will get a 'BUSY' error message. The '/u' entry in /etc/filesystems will also
be removed.
top of page
sync
Flushes system buffers to disk. There's a sync daemon (/etc/syncd) that flushes buffers automatically every
60 seconds (default).
top of page
umount
umount /u
Unmounts a file system so that files found under that file system will not be able to be accessed. The
'umount' will fail if one or more users are either currently on that file system or somebody has a file opened
on that file system.
top of page
unlink