0% found this document useful (0 votes)
68 views

Commands For UNIX System Administration

This document provides summaries of various UNIX system administration commands. It describes commands for displaying microcode levels, software package levels, users and groups, and async port status. It also provides instructions for increasing the size of paging spaces and file systems, making backups with mksysb, and mounting/unmounting file systems. Many commands require root privileges.

Uploaded by

sudhir2312
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
68 views

Commands For UNIX System Administration

This document provides summaries of various UNIX system administration commands. It describes commands for displaying microcode levels, software package levels, users and groups, and async port status. It also provides instructions for increasing the size of paging spaces and file systems, making backups with mksysb, and mounting/unmounting file systems. Many commands require root privileges.

Uploaded by

sudhir2312
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Commands for UNIX System Administration

Commands for UNIX System Administration


Many of the commands in this section require root authority.

This is an automatically-generated printer-friendly PDF version of the HTML web page at Commands for UNIX System Administration CLICK HERE to get the standard HTML version of this document. This is an automatically-generated printer-friendly PDF version of the HTML web pages at Commands for UNIX System Administration CLICK HERE to get the standard HTML version of this document.

How to display the microcode maintenance level


lsmcode -c

This is an automatically-generated printer-friendly PDF version of the HTML web pages at Microcode Levels CLICK HERE to get the standard HTML version of this document.

How to display the maintenance level of a file or fileset


The lslpp command can be used to determine the maintenance level of a file or fileset. The -w option shows which fileset owns a file. lslpp -w /filepath Once you know which fileset is the relevant one, you can find out what level it is at: lslpp -f file.set.name | head -4 lslpp -l file.set.name lslpp -la file.set.name lslpp -ha file.set.name -f shows the earliest level of the fileset, along with all of the files in it (unless the output is piped to head). -l shows the latest level of the fileset. -la shows all updates of the fileset and -ha shows the entire history of the fileset.

This is an automatically-generated printer-friendly PDF version of the HTML web pages at Software Package Filesets CLICK HERE to get the standard HTML version of this document.

Display users and groups


A question arose about how to display users and groups in the same format as the following commands, but sort them in alphabetical order: lsuser -fa id groups gecos admin account_locked maxage unsuccessful_login_count ALL lsgroup -fa id admin users ALL The problem is that with the -f option, each attribute is displayed on a line by itself, separate from the username. The answer, as with solving many such problems in UNIX, simply involves stringing together the right combination of UNIX commands: lsuser -fa id groups gecos admin account_locked maxage unsuccessful_login_count `lsuser -a ALL | sort | paste -s -d ',' -` lsgroup -fa id admin users `lsgroup -a ALL | sort | paste -s -d ',' -` lsuser -a ALL and lsgroup -a ALL list all of the users or groups, with one on each line. sort sorts the list in alphabetical order, and paste -s -d ',' - concatenates it into one line to create a comma-delimited list, which is passed as a parameter to the command using back-quotes `...` (aka grave accents). -fa displays each of the named attributes on a separate line. The list of attributes in the examples above are some of the ones that are useful for Sarbanes-Oxley audits.

This is an automatically-generated printer-friendly PDF version of the HTML web pages at Users and Groups CLICK HERE to get the standard HTML version of this document.

Display Async Port Status and Settings


/usr/lib/tty/stty-cxma -a /dev/tty0 Displays the status and settings of the first async port. For example, the first line of output will show DSR+ if a modem is connected and ready, or DSR- if not.

This is an automatically-generated printer-friendly PDF version of the HTML web pages at How To Manage Terminals and Async Ports CLICK HERE to get the standard HTML version of
Page 1 of 4 1

Commands for UNIX System Administration


this document.

Commands for UNIX File System Administration How to find the amount of free space available
Display the number of free physical partitions
Determine the logical volume associated with the paging space or file system: 1 For a paging space: lsps -t lv For non-paging file systems: df -k Determine the volume group associated with the logical volume: 2 lslv hd# Don't include the /dev/ prefix. The number of 1024-blocks will be the number of LPs times the PP SIZE times 1024. Determine if there are enough free physical partitions in the volume group to increase space. 3 lsvg vgname For mirrored drives, the number of FREE PPs must be at least the number of logical partitions to be added times the number of COPIES in the lslv command. The number of USED PPs in the lsvg output will be 4 more than the sum of the allocated PPs shown in the output of the lslv commands for all of the logical volumes allocated from the volume group.

How to increase the size of a paging space


To change the size of a paging space, use the chps command or the smit pgsp FastPath.

Increase the size of a paging space


chps -snn pagingnn chps -snn hdn Increases the size by nn logical paritions.

Decrease the size of a paging space


chps -dnn pagingnn chps -dnn hdn Decreases the size by nn logical paritions.

How to increase the size of a file system


To change the size of a file system, use the chfs command or the smit manfs FastPath.

Increase or decrease the size of a file system by one logical partition


chfs -a size=+1 fsname chfs -a size=-lpsizeM fsname Although size=+1 says to increase the size by one 512-byte block, the size will be rounded up to the actual size of a logical partition.

Increase the size by a given amount


chfs -a size=+nM fsname

Change the size to match another file system


df fs1name chfs -a size=nnnnnn fs2name The df command will display the number of 512-byte blocks in the first file system. Using that number in the chfs command will change the second file system to the same size.

This is an automatically-generated printer-friendly PDF version of the HTML web pages at Commands for UNIX File System Administration CLICK HERE to get the standard HTML version of this document.

Other Commands Create a backup of the root volume group (rootvg) on tape
mksysb -iXV /dev/rmt0 i creates an /image.data file with some important information needed for rebuilding other volumes and file systems. X
2 Page 2 of 4

Commands for UNIX System Administration


makes room in the /tmp file system for the boot image, if necessary. V verifies that the tape is readable.

mount command
To access the data on a CD-ROM, use the smit mountfs FastPath or issue the mount command: mount -rv cdrfs /dev/cd0 /cdrom cd /cdrom where /cdrom is the mount point where the CD-ROM is to be accessed.

umount command
A file system can be unmounted using the smit umountfs FastPath or by issuing the umount command with either the device name: umount /dev/cd0 or with the mount point: umount /cdrom The file system to be unmounted cannot be active, so you may need to ensure that there are no users accessing it.

This is an automatically-generated printer-friendly PDF version of the HTML web pages at UNIX mksysb command CLICK HERE to get the standard HTML version of this document.

Page 3 of 4

Index

Page 4 of 4

You might also like