aix command guide

Upload: munna17

Post on 06-Apr-2018

238 views

Category:

Documents


4 download

TRANSCRIPT

  • 8/3/2019 Aix Command Guide

    1/22

    Build your own FREE website at Tripod.comShare: Facebook| Twitter|Digg | reddit

    BigCalm AIX UNIX Handy AIX Commands Search

    AIX COMMAND GUIDE

    Making files is easy under the UNIX operating system. Therefore, users tend to create numerous files using

    large amounts of file space. It has been said that the only standard thing about all UNIX systems is the

    message-of-the-day telling users to clean up their files. -- System V.2 administrator's guide

    Quick Alphabetic Look-Up

    Basic File HandlingInputs, Outputs and

    WildcardsOther File Handling

    CommandsExtremely Useful

    CommandsGeneral InformationCommands

    System Commands Connectivity Tapes and Disks

    ScreenCommunication

    Source Code ControlSystem (SCCS)

    Miscellaneous Shell Scripts

    INTRODUCTION

    This is my unix command help file which has been built up over the years. This file wasbuilt primarily for my own reference and is notintended to be an authoratative guide toall commands for AIX - often if there is a very short description for a command, you cantake this as RTFM. I am nota systems administrator, but have been called on to do thejob occasionally (and install a box or two) - this helpfile should be ideal for people whouse AIX, but aren't responsible for the deep magic required for hardware configuration.

    You may find this file helpful despite the numerous omissions nonetheless. This file wasoriginally a plain text file but I have converted to HTML usingLemmy (Avi clone forWindows).

    Because it has been hand-converted from the original text document, there's a fewhangovers from it that I just can't be bothered to remove such as the caps headings.Additionally, some browsers may not render certain characters.

    I've tried (and quite probably failed) to keep several conventions within this document -any command, if mentioned in the description of another command should have abookmark link to the description of that command; all examples are in blue text -

    http://www.tripod.lycos.com/http://www.tripod.lycos.com/http://www.facebook.com/http://www.twitter.com/http://www.digg.com/http://www.digg.com/http://reddit.com/http://bigcalm.tripod.com/http://bigcalm.tripod.com/aix/http://bigcalm.tripod.com/aix/quickh.htmhttp://bigcalm.tripod.com/aix/handycommands.htm#BASIC%20FILE%20HANDLINGhttp://bigcalm.tripod.com/aix/handycommands.htm#INPUTS,%20OUTPUTS%20AND%20WILDCARDShttp://bigcalm.tripod.com/aix/handycommands.htm#INPUTS,%20OUTPUTS%20AND%20WILDCARDShttp://bigcalm.tripod.com/aix/handycommands.htm#OTHER%20FILE%20HANDLING%20COMMANDShttp://bigcalm.tripod.com/aix/handycommands.htm#OTHER%20FILE%20HANDLING%20COMMANDShttp://bigcalm.tripod.com/aix/handycommands.htm#EXTREMELY%20USEFUL%20COMMANDShttp://bigcalm.tripod.com/aix/handycommands.htm#EXTREMELY%20USEFUL%20COMMANDShttp://bigcalm.tripod.com/aix/handycommands.htm#GENERAL%20INFORMATION%20COMMANDShttp://bigcalm.tripod.com/aix/handycommands.htm#GENERAL%20INFORMATION%20COMMANDShttp://bigcalm.tripod.com/aix/handycommands.htm#SYSTEM%20COMMANDShttp://bigcalm.tripod.com/aix/handycommands.htm#CONNECTIVITYhttp://bigcalm.tripod.com/aix/handycommands.htm#TAPES%20AND%20DISKShttp://bigcalm.tripod.com/aix/handycommands.htm#SCREEN%20COMMUNICATIONhttp://bigcalm.tripod.com/aix/handycommands.htm#SCREEN%20COMMUNICATIONhttp://bigcalm.tripod.com/aix/handycommands.htm#SOURCE%20CODE%20CONTROL%20SYSTEM%20(SCCS)http://bigcalm.tripod.com/aix/handycommands.htm#SOURCE%20CODE%20CONTROL%20SYSTEM%20(SCCS)http://bigcalm.tripod.com/aix/handycommands.htm#MISCELLANEOUShttp://bigcalm.tripod.com/aix/handycommands.htm#SHELL%20SCRIPT%20COMMANDShttp://www.softwareonline.org/http://www.softwareonline.org/http://bigcalm.tripod.com/aix/handycommands.htm#vihttp://bigcalm.tripod.com/aix/handycommands.htm#vihttp://www.tripod.lycos.com/http://www.facebook.com/http://www.twitter.com/http://www.digg.com/http://reddit.com/http://bigcalm.tripod.com/http://bigcalm.tripod.com/aix/http://bigcalm.tripod.com/aix/quickh.htmhttp://bigcalm.tripod.com/aix/handycommands.htm#BASIC%20FILE%20HANDLINGhttp://bigcalm.tripod.com/aix/handycommands.htm#INPUTS,%20OUTPUTS%20AND%20WILDCARDShttp://bigcalm.tripod.com/aix/handycommands.htm#INPUTS,%20OUTPUTS%20AND%20WILDCARDShttp://bigcalm.tripod.com/aix/handycommands.htm#OTHER%20FILE%20HANDLING%20COMMANDShttp://bigcalm.tripod.com/aix/handycommands.htm#OTHER%20FILE%20HANDLING%20COMMANDShttp://bigcalm.tripod.com/aix/handycommands.htm#EXTREMELY%20USEFUL%20COMMANDShttp://bigcalm.tripod.com/aix/handycommands.htm#EXTREMELY%20USEFUL%20COMMANDShttp://bigcalm.tripod.com/aix/handycommands.htm#GENERAL%20INFORMATION%20COMMANDShttp://bigcalm.tripod.com/aix/handycommands.htm#GENERAL%20INFORMATION%20COMMANDShttp://bigcalm.tripod.com/aix/handycommands.htm#SYSTEM%20COMMANDShttp://bigcalm.tripod.com/aix/handycommands.htm#CONNECTIVITYhttp://bigcalm.tripod.com/aix/handycommands.htm#TAPES%20AND%20DISKShttp://bigcalm.tripod.com/aix/handycommands.htm#SCREEN%20COMMUNICATIONhttp://bigcalm.tripod.com/aix/handycommands.htm#SCREEN%20COMMUNICATIONhttp://bigcalm.tripod.com/aix/handycommands.htm#SOURCE%20CODE%20CONTROL%20SYSTEM%20(SCCS)http://bigcalm.tripod.com/aix/handycommands.htm#SOURCE%20CODE%20CONTROL%20SYSTEM%20(SCCS)http://bigcalm.tripod.com/aix/handycommands.htm#MISCELLANEOUShttp://bigcalm.tripod.com/aix/handycommands.htm#SHELL%20SCRIPT%20COMMANDShttp://www.softwareonline.org/http://bigcalm.tripod.com/aix/handycommands.htm#vi
  • 8/3/2019 Aix Command Guide

    2/22

    apologies to lynx users, but examples should be written so that they're recognisableanyway (and if you're using lynx, you probably know unix quite well anyway so I don'treally know why I'm apologising ;-). If a command has more than one useful option, I'vetried to put them into Unordered list tags.

    If a command stands almost alone, or is complex within itself, it doesn't appear in this filebut in it's own separate file (with a link if I've converted it to html. Examples are vi andawk.

    BASIC FILE HANDLING

    ls

    - list files in directory; use with options

    -l (long format) -a (list . files too) -r (reverse order) -t (newest appears first) -d (do not go beyond current directory) -i (show inodes)

    For a more detailed description of ls see ls -lmore

    - used to control input by pages - like the dos /p argument with dir. e.g.$ more /etc/motd

    ******************************************************************************** ** ** Welcome to AIX Version 4.1! ** ** ** Please see the README file in /usr/lpp/bos for information pertinent to ** this release of the AIX Operating System. ** ** *

    *******************************************************************************motd: END

    Useful keys for use with more:

    b (back a page) ' (go to top)

    http://lynx.browser.org/http://bigcalm.tripod.com/aix/handycommands.htm#vihttp://bigcalm.tripod.com/aix/handycommands.htm#vihttp://bigcalm.tripod.com/aix/handycommands.htm#awkhttp://bigcalm.tripod.com/aix/handycommands.htm#ls%20-lhttp://lynx.browser.org/http://bigcalm.tripod.com/aix/handycommands.htm#vihttp://bigcalm.tripod.com/aix/handycommands.htm#awkhttp://bigcalm.tripod.com/aix/handycommands.htm#ls%20-l
  • 8/3/2019 Aix Command Guide

    3/22

    v (vi the file) / (Search) q (quit) ' ' (down a page) Control-G (View current line number

    (down a line)

    See alsopg which is extremely similarpg

    - used to control input by pages - like the dos /p argument. pg performs the samefunction as the morecommand but has different control, as it is based on exHelpful keys for pg:

    1 (go to top) $ (go to bottom) h (help)

    / (Search) ? (Search back) q (quit) -1 (back a page)

    pwd

    - show present working directory. e.g.$ pwd/usr/live/data/epx/vss2

    To change the current working directory use cd

    cd - change directory (without arguments, this is the same as $ cd $HOME or$ cd ~)cp

    - copies a file from one location to another. e.g.$ cp /etc/hosts /etc/hosts.backup # make a backup of the hosts file$ cp /etc/motd /tmp/jon/ # Copy file /etc/motd to directory /tmp/jon/Options

    -f (to force the copy to occur) -r (to recursively copy a directory) -p (to attempt to preserve permissions when copying)

    synonym: copymv

    - move a file from one location to another. e.g.$ mv /tmp/jon/handycommands.txt . # move handycommands in /tmp/jon tocurrent directory$ mv -f vihelp vihelp.txt # Move file vihelp to vihelp.txt (forced)Options

    http://bigcalm.tripod.com/aix/handycommands.htm#pghttp://bigcalm.tripod.com/aix/handycommands.htm#morehttp://bigcalm.tripod.com/aix/handycommands.htm#morehttp://bigcalm.tripod.com/aix/handycommands.htm#exhttp://bigcalm.tripod.com/aix/handycommands.htm#cdhttp://bigcalm.tripod.com/aix/handycommands.htm#pghttp://bigcalm.tripod.com/aix/handycommands.htm#morehttp://bigcalm.tripod.com/aix/handycommands.htm#exhttp://bigcalm.tripod.com/aix/handycommands.htm#cd
  • 8/3/2019 Aix Command Guide

    4/22

    -f (to force the move to occur) -r (to recursively move a directory) -p (to attempt to preserve permissions when moving)

    synonym: move

    .rm - removes a file. e.g.$ rm /tmp/jon/*.unl # remove all *.unl files in /tmp/jon$ rm -r /tmp/jon/usr # remove all files recursively Options

    -f (to force the removal of the file) -r (to recursively remove a directory)

    du

    Recursively lists directories and their sizes. e.g.

    $ du /etc # list recursively all directories off /etc712 /etc/objrepos64 /etc/security/audit536 /etc/security104 /etc/uucp8 /etc/vg232 /etc/lpp/diagnostics/data240 /etc/lpp/diagnostics248 /etc/lpp16 /etc/aliasesDB16 /etc/acct

    8 /etc/ncs8 /etc/sm8 /etc/sm.bak4384 /etcThe sizes displayed are in 512K blocks. To view this in 1024K blocks use theoption -k

    lp -d send file to printer. e.g. $ lp -dhplas14 /etc/motd # send file /etc/motd to printerhplas14$ lp /etc/motd # send file /etc/motd to default printer

    cat

    - print a file to stdout (screen). e.g.$ cat /etc/motd # display file /etc/motd to screen******************************************************************************** ** ** Welcome to AIX Version 4.1! ** *

  • 8/3/2019 Aix Command Guide

    5/22

    * ** Please see the README file in /usr/lpp/bos for information pertinent to ** this release of the AIX Operating System. ** ** *

    *******************************************************************************cat is also useful for concatenating several files. e.g.$ cat fontfile IN* > newfile # appends fontfile and all files beginning with IN tonewfileThough this might seem an essentially useless command, because most unixcommands always take a filename argument, it does in fact come in extremelyuseful at more advanced levels. Awardsare given out occasionally for the mostuseless usage of cat. If an option of '-' is specified, cat will take its input fromstdin.

    INPUTS, OUTPUTS AND WILDCARDS

    Unix commands generally get their information from the screen, and output to it.There are three main 'streams' which unix uses to get/place it's information on.These streams are called:

    stdin (Standard Input) - normally, what you type into the screen stdout (Standard Output) - normally, what is output to the screen stderr (Standard Error) - normally, error messages which go to thescreen

    any of these may be redirected by the following symbols:

    < take input from rather than the screen.e.g.$ ksh < x # will read all commands from the file x and execute them usingthe Korn shell. > take output from the command and place it in. e.g.$ ls > x will place the output of the command 'ls' in the file x

    >> take output from the command and append it to. e.g.$ ls /tmp >> x will place the output of the command 'ls' and append it tothe file x 2> take any error messages from the command and putit in . e.g.$ ls /tmp 2>/dev/null would throw away any error messages that are

    http://www.ling.helsinki.fi/~reriksso/unix/award.html#cathttp://www.ling.helsinki.fi/~reriksso/unix/award.html#cathttp://www.ling.helsinki.fi/~reriksso/unix/award.html#cat
  • 8/3/2019 Aix Command Guide

    6/22

    produced by ls (sorry, /dev/null is a file that, if written to, the informationdisappears never to be seen again). command1 | command2 Pipe - Takes the standard output of thefirst command, and turns it into the standard input of the secondcommand. The output of the second command will then be put on the

    standard output (which, again, may be a pipe) e.g.$ ls | more will send the output of 'ls' into the command 'more', thusproducing a directory listing which stops after every page. This method iscalled piping.

    command1 & - the ampersand (&) forces command1 to run in the background. sothat you may continue to type other commands in the shell, while command1executes. It is not advisable to run a command in the background if it outputs tothe screen, or takes it's input from the screen

    See also tee which allows splitting of the input stream and output to severaldifferent places at once.

    Wildcards

    B Bib Baby Fox Fib

    There are various wildcards which you may use. One is '*' which means 0 or morecharacters. e.g. 'B*' will match 'B,Bib and Baby' from the list above, anotherwildcard is '?' which matches 1 character, e.g. '?ib' will match 'Bib and Fib'.Wildcards differ depending on the program in use: awkderivatives

    (awk,sed,grep,ex,vi,exprand others) have the following special characters:

    ^ beginning of the line $ end of the line . any character * one or more of the preceding character .* any number of characters \n Carriage return \t Tab character \ Treat as is (so, \$ would try to match a '$')

    Given the following four lines:

    Chargeable calls in bundle: $47.50Chargeable calls out of bundle: $20.50Other bundle charges: $0.00Total Charge: $20.50

    $ grep "^Charg.*bundle.*\$.*"

    http://bigcalm.tripod.com/aix/handycommands.htm#teehttp://bigcalm.tripod.com/aix/handycommands.htm#awkhttp://bigcalm.tripod.com/aix/handycommands.htm#awkhttp://bigcalm.tripod.com/aix/handycommands.htm#sedhttp://bigcalm.tripod.com/aix/handycommands.htm#grephttp://bigcalm.tripod.com/aix/handycommands.htm#exhttp://bigcalm.tripod.com/aix/handycommands.htm#exhttp://bigcalm.tripod.com/aix/handycommands.htm#vihttp://bigcalm.tripod.com/aix/handycommands.htm#exprhttp://bigcalm.tripod.com/aix/handycommands.htm#teehttp://bigcalm.tripod.com/aix/handycommands.htm#awkhttp://bigcalm.tripod.com/aix/handycommands.htm#awkhttp://bigcalm.tripod.com/aix/handycommands.htm#sedhttp://bigcalm.tripod.com/aix/handycommands.htm#grephttp://bigcalm.tripod.com/aix/handycommands.htm#exhttp://bigcalm.tripod.com/aix/handycommands.htm#vihttp://bigcalm.tripod.com/aix/handycommands.htm#expr
  • 8/3/2019 Aix Command Guide

    7/22

    would match the first two lines.In english - match all lines which start with 'Charg', then have any number ofcharacters and then the word 'bundle', then have any number of characters, andthen a dollar symbol, and then have any number of characters following to the endof the line

    OTHER FILE HANDLING COMMANDS

    type - show where the source of a command is: e.g.$ type sendmailsendmail is /usr/sbin/sendmailThis command is merely an alias for'whence -v'

    whence - show where the source of a command is: shell builtin command. See type

    Use option: -v for verbose modewhich

    - show where the source of a command is held. Almost the same as typeandwhence

    chmod - change file permissions. e.g.$ chmod 666 handycommandschanges the permissions (seen by ls -l) of the file handycommands to -rw-rw-rw-r = 4, w = 2, x = 1. In the above example if we wanted read and write permissionfor a particular file then we would use r + w = 6. If we then wanted to have thefile have read-write permissions for User, Group and All, then we would have

    permissions of 666. Therefore the command to change is that above.$ chmod 711 a.outChanges permissions to: -rwx--x--xAdditional explanation of file permissions and user/group/all meaning are givenin the description ofls -lYou may specify chmod differently - by expressing it in terms of + and -variables. For example$ chmod u+s /usr/bin/suwill modify the "sticky bit" on su, which allows it to gain the same access on thefile as the owner of it. What it means is "add s permission to user". So a file thatstarted off with permissions of "-rwxr-xr-x" will change to "rwsr-xr-x" when the

    above command is executed. You may use "u" for owner permissions, "g" forgroup permissions and "a" for all.chown

    - Change ownership of a file. Must be done as root. e.g.chown informix *.dat # change all files ending .dat to be owned by informix

    chgrp - Change group ownership of a file. Must be done as root. e.g.chgrp sys /.netrc # change file /.netrc to be owned by the group sys

    http://bigcalm.tripod.com/aix/handycommands.htm#whencehttp://bigcalm.tripod.com/aix/handycommands.htm#whencehttp://bigcalm.tripod.com/aix/handycommands.htm#typehttp://bigcalm.tripod.com/aix/handycommands.htm#typehttp://bigcalm.tripod.com/aix/handycommands.htm#typehttp://bigcalm.tripod.com/aix/handycommands.htm#typehttp://bigcalm.tripod.com/aix/handycommands.htm#whencehttp://bigcalm.tripod.com/aix/handycommands.htm#ls%20-lhttp://bigcalm.tripod.com/aix/handycommands.htm#ls%20-lhttp://bigcalm.tripod.com/aix/handycommands.htm#whencehttp://bigcalm.tripod.com/aix/handycommands.htm#typehttp://bigcalm.tripod.com/aix/handycommands.htm#typehttp://bigcalm.tripod.com/aix/handycommands.htm#whencehttp://bigcalm.tripod.com/aix/handycommands.htm#ls%20-lhttp://bigcalm.tripod.com/aix/handycommands.htm#ls%20-l
  • 8/3/2019 Aix Command Guide

    8/22

    mvdir - move a directory - can only be done within a volume group. To move a directorybetween volume groups you need to usemv -rorfind -print | cpio -pdumv ;rm -r

    cpdir

    - copy a directory. See mvdirrmdir - this is crap - use rm -rinstead

    mkdir - Creates a directory. e.g.$ mkdir /tmp/jon/ # create directory called /tmp/jon/

    find -name "searchkey" -print- search for files - e.g.$ find . -name "system.log" -print # will find all files (with full path names) calledsystem.log - Wildcards are allowed, e.g.$ find /tmp -name "sl.*" -atime +0 -print # will print out all files in /tmp/ that start

    sl. and which haven't been accessed for a day. Helpful for finding lost files, orfinding stuff in enormous directories. Other useful options include:

    -atime + - finds files that haven't been accessed for 1+daysalso, ctime (creation time) and mtime (modify time) -prune - stay in current directory - don't look in dirs off thedirectory specified in path names - e.g.$ find /tmp -user "compgnc" -prune -print # will find all files in /tmpwhich user compgnc owns and will not search lower directories (e.g./tmp/usr) -size + - finds files that are bigger than

    -exec rm {} \; - remove all files found...dangerous command - e.g.$ find /tmp -name "sl.*" -atime +0 -prune -print -exec rm {} \; # willremove all files in /tmp starting 'sl.' that haven't been accessed for a day.Spacing of this command is important! Most exec commands are possible:$ find /usr2/calltest -name "*.4gl" -print -exec grep "CHECK" {} \; |pg -ok - like exec only it prompts for confirmation after eachoccurence. e.g.$ find /tmp/disk7 -name "*" -print -okdoswrite -a {} {} \; # Please notethat you MUST end any exec or ok option with an escaped semicolon (\;). -user - finds all files owned by -group - finds all files with a group of

    ln -s - create a symbolic link to a different directory from current directory: e.g.$ ln -s /usr/uniplex/compgnc /u/compgnc/uni # would create a link called 'uni' inthe directory /u/compgnc. From then on, typing cd uni would cd to/usr/uniplex/compgnc. You can also give two files the same name. e.g.$ ln make.e_enquiry makefile # would link the two files so that they are identical,and when you change one, you change the other. You may also create a symbolic

    http://bigcalm.tripod.com/aix/handycommands.htm#mvhttp://bigcalm.tripod.com/aix/handycommands.htm#mvhttp://bigcalm.tripod.com/aix/handycommands.htm#findhttp://bigcalm.tripod.com/aix/handycommands.htm#cpiohttp://bigcalm.tripod.com/aix/handycommands.htm#rmhttp://bigcalm.tripod.com/aix/handycommands.htm#rmhttp://bigcalm.tripod.com/aix/handycommands.htm#mvdirhttp://bigcalm.tripod.com/aix/handycommands.htm#rmhttp://bigcalm.tripod.com/aix/handycommands.htm#grephttp://bigcalm.tripod.com/aix/handycommands.htm#pghttp://bigcalm.tripod.com/aix/handycommands.htm#doswritehttp://bigcalm.tripod.com/aix/handycommands.htm#mvhttp://bigcalm.tripod.com/aix/handycommands.htm#findhttp://bigcalm.tripod.com/aix/handycommands.htm#cpiohttp://bigcalm.tripod.com/aix/handycommands.htm#rmhttp://bigcalm.tripod.com/aix/handycommands.htm#mvdirhttp://bigcalm.tripod.com/aix/handycommands.htm#rmhttp://bigcalm.tripod.com/aix/handycommands.htm#grephttp://bigcalm.tripod.com/aix/handycommands.htm#pghttp://bigcalm.tripod.com/aix/handycommands.htm#doswrite
  • 8/3/2019 Aix Command Guide

    9/22

    link to a host(!). Instead of typing 'rlogin hpserver' every time, by typing$ ln -s /usr/bin/rsh hpserver# will create a link so that whenever you type'hpserver' it will execute a remote shell on the machine.Option -f forces the link to occur

    head -

    - prints out the first few line of a file to screen. Specify number to indicate howmany lines (default is 10). e.g. If you sent something to a labels printer and itwasn't lined up, then you could print the first few labels again using:$ head -45 label1.out | lp -dlocal1

    tail - - prints out the end of a file. Very similar toheadbut with a very useful option '-f'which allows you to follow the end of a file as it is being created.e.g.$ tail -f vlink.log # follow end of vlink.log file as it is created.

    wc - - Word Count (wc) program. Counts the number of chars, words, and lines in afile or in a pipe. Options:

    -l (lines) -c (chars) -w (words)

    To find out how many files there are in a directory dols | wc -lsplit -

    - Splits a file into several files.e.g.$ split -5000 CALLS1 # will split file CALLS1 into smaller files of 5000 lineseach called xaa, xab, xac, etc.

    tr

    - translates characters. e.g.$ cat handycommands | tr "\t" " " # will take the file handycommands andtranslate all tabs into spaces. Useful when messing about with awk or you need toconvert some input (e.g. that from tty) to a unique filename that does not containspecial characters. e.g.$ tty | tr "/" "." # produces for example .dev.pts.7

    od - od converts nasty (binary save) files into character representations. Useful whenback-compiling, examining raw .dat files,etc. Use with option '-c' for characterdisplay (recommended).

    script

    - starts recording everything in the shell to a file by default 'typescript'. Press ^Dto finish the script. Provides a log of everything used. Has almost the same effectas $ ksh | tee typescriptUsed for debugging shells, seeing error messages which flash off the screen tooquickly, etc.

    cut

    http://bigcalm.tripod.com/aix/handycommands.htm#lphttp://bigcalm.tripod.com/aix/handycommands.htm#headhttp://bigcalm.tripod.com/aix/handycommands.htm#headhttp://bigcalm.tripod.com/aix/handycommands.htm#headhttp://bigcalm.tripod.com/aix/handycommands.htm#lshttp://bigcalm.tripod.com/aix/handycommands.htm#lshttp://bigcalm.tripod.com/aix/handycommands.htm#cathttp://bigcalm.tripod.com/aix/handycommands.htm#ttyhttp://bigcalm.tripod.com/aix/handycommands.htm#ttyhttp://bigcalm.tripod.com/aix/handycommands.htm#kshhttp://bigcalm.tripod.com/aix/handycommands.htm#teehttp://bigcalm.tripod.com/aix/handycommands.htm#lphttp://bigcalm.tripod.com/aix/handycommands.htm#headhttp://bigcalm.tripod.com/aix/handycommands.htm#lshttp://bigcalm.tripod.com/aix/handycommands.htm#cathttp://bigcalm.tripod.com/aix/handycommands.htm#ttyhttp://bigcalm.tripod.com/aix/handycommands.htm#ttyhttp://bigcalm.tripod.com/aix/handycommands.htm#kshhttp://bigcalm.tripod.com/aix/handycommands.htm#tee
  • 8/3/2019 Aix Command Guide

    10/22

    - cut's the file or pipe into various fields. e.g.$ cut -d "|" -f1,2,3 active.unl # will take the file active.unl which is delimited bypipe symbols and print the first 3 fields options:

    -d

    -f

    Not too useful as you can't specify the delimiter as merely white space (defaults totab) Alternatively, you can 'cut' up files by character positioning (useful with afixed width file). e.g.$ cut -c8-28 "barcode.txt" # would cut columns 8 to 28 out of the barcode.txt file.

    paste

    - paste will join two files together horizontally rather than just tacking one on tothe end of the other. e.g. If you had one file with two lines:Name:

    Employee Number:

    and another file with the lines:Fred BloggsE666

    then by doing:$ paste file1 file2 > file3 # this would then produce (in file3).Name: Fred Bloggs

    Employee Number: E666

    Note that paste puts horizontal tabs between the files, so you may need ased's/ //g' command to get rid of these.

    sort - sorts the information from the file and displays the result on standard output

    (stdout). e.g.$ sort /tmp/list_of_names # will sort the file into alphabetical order, and display itto the screen. Useful with option '-u' to filter out duplicates.

    uniq - filters out all duplicate lines from a file or input stream (file or stream must besorted!). Useful with option -c which merely produces a count of unique lines.

    ex - ex is an old line editor, and almost never used now (similar to DOS edlin if youremember that - me, I've repressed it). You are most likely to come across exwithin the vi editor - all commands beginning with a colon (:) are ex commands

    EXTREMELY USEFUL COMMANDS

    ls -l

    - lists files in a directory in long format. You cannot do without this. Here's amore detailed explanation. e.g.$ ls -l

    Part 1 Part 2 Part 3 Part 4 Part 5 Part 6 Part 7

    -rw-rw-rw- 1 root staff 28 Jan 16 09:52 README

    http://bigcalm.tripod.com/aix/handycommands.htm#sedhttp://bigcalm.tripod.com/aix/handycommands.htm#sedhttp://bigcalm.tripod.com/aix/handycommands.htm#vihttp://bigcalm.tripod.com/aix/handycommands.htm#sedhttp://bigcalm.tripod.com/aix/handycommands.htm#vi
  • 8/3/2019 Aix Command Guide

    11/22

    -rw------- 1 compjmd staff 4304 Jun 24 12:21 tabledict

    drwxrwxrwx 2 compjmd staff 512 Jul 1 16:30 testdir

    -rwxrwx--- 1 compjmd system 0 Jul 1 16:30 a.out

    ... is a sample listing.

    Part 1: Permissions - see chmod for explanation of these. If thefirst field is set, then the file in question is not really a file at all, butsomething else, key:

    o -: normal file

    o d: directory

    o l: symbolic link created by 'ln'

    o c or b: device of some sort

    You may sometimes see an 's' where the 'x' should be in the permissions -this is normally on executable files which change other files. e.g.

    Permissions of 'sqlexec' the file that executes all informix queries shouldbe '-rwsr-sr-x' - this then accesses tables with permissions of '-rw-rw----'.where the table files are owned by informix (group informix). the 's' flagsallows changing of the database tables on a program level, but not on aunix level. (can change contents via sqlexec but not use 'rm' command ondb file).

    Part 2: Number of links to this file (directories always have 2+). Part 3: The owner of the file - e.g. If the owner is 'compjmd' andpermissions are set to -rw------- then only the user 'compjmd' may read orwrite to that file. Again, if owner is "compjmd" and permissions are -r-

    x------ then only the user compjmd may read or execute that file. Only theowner of a file or root may chmod it. Part 4: The group ownership of the file - (bloody hell, this isgetting complicated). On a unix system there are certain 'groups' whichusers can belong to, held in the file '/etc/group'. You will notice that in thisfile there will be a main group, e.g. 'staff' which contains every user.Which means that any user listed under staff is in thatgroup.....right...every file has a group attached to it. Which means that if afile had permissions ----rw---- and a group reference of 'system', then onlyusers who were part of the group system could modify that file. To seewhich groups the current user belongs to do id. Sorry if this wasn't

    comprehensible but you should never need to use this anyway(!). Part 5: Size of the file in bytes Part 6: Time of last modification Part 7: The name of the file

    Useful options (and there are loads more). All may be combined except wherespecified:

    http://bigcalm.tripod.com/aix/handycommands.htm#chmodhttp://bigcalm.tripod.com/aix/handycommands.htm#chmodhttp://bigcalm.tripod.com/aix/handycommands.htm#idhttp://bigcalm.tripod.com/aix/handycommands.htm#chmodhttp://bigcalm.tripod.com/aix/handycommands.htm#chmodhttp://bigcalm.tripod.com/aix/handycommands.htm#id
  • 8/3/2019 Aix Command Guide

    12/22

    ls -a show files starting with '.' too ls -A show files starting with '.' but not '.' or '..' ls -c must be used with either option l and/or t - displays/sorts bymodification time ls -d do not show subdirectory listings

    ls -i display the i-node number of each file ls -t Put the listing in time order (see options u and c) ls -r Put the listing in reverse order - usually used with a -t ls -u must be used with either options l and/or t - displays/sorts bylast-access time

    vi - love it or loathe it - the standard operating system text-file editor. See Relatedhelp file. Vi You can also use 'view' which forces Read only (-R opt). vi+ enters the file at the specified line no. Also, vi +/will enter the file and move to the first occurrence of . e.g.

    $ vi +/"love it or loathe it" handycommandsUsers new to vi hate it. I personally managed to get through University withoutusing it ever (I used Joe's own editor instead). If I accidentally went into vi, I hadto ^Z and kill the job. Sigh. Five years of using vi means that I'm getting a littlebetter at it now... (I'm actually typing this now in a vi-clone for Windows).

    grep - a phenomenally useful command which matches strings within files - e.g.$ grep D7523 mcall_reps.out # will find all the lines in mcall_reps.out that havethe string "D7523" in it. Also incredibly useful for things like pipes,e.g.$ du | grep cred # (in /home directory will show all users that have 'cred' in theirtitle). You may use regular expression matching - e.g.

    $ grep "main.*{" x.c # would match any line containing 'main' and an open curlybrackets at any point in the line afterwards. There are two variations to grep -fgrep and egrep which do virtually the same things as grep, but are either faster(having less options) or more complex (but slower). See also section onWildcardsOptions:

    -v : show all lines that do not contain pattern. -y : don't bother matching case -i : don't bother matching case -c : show count of matching lines rather than the lines themselves -l : show filename's instead of matching lines.

    ksh -o vi- The Korn Shell - pros might notice that I don't mention using the C-Shell at all -I've never used it, so that's why it doesn't appear. A Shell is a program that yourun your commands in. Typing exit will end the current shell. The -o vi option ofthe korn shell allows vi commands to work at the shell prompt after pressing

    http://bigcalm.tripod.com/aix/vihelp.htmhttp://bigcalm.tripod.com/aix/vihelp.htmhttp://bigcalm.tripod.com/aix/handycommands.htm#duhttp://bigcalm.tripod.com/aix/handycommands.htm#Wildcardshttp://bigcalm.tripod.com/aix/handycommands.htm#exithttp://bigcalm.tripod.com/aix/vihelp.htmhttp://bigcalm.tripod.com/aix/vihelp.htmhttp://bigcalm.tripod.com/aix/handycommands.htm#duhttp://bigcalm.tripod.com/aix/handycommands.htm#Wildcardshttp://bigcalm.tripod.com/aix/handycommands.htm#exit
  • 8/3/2019 Aix Command Guide

    13/22

    escape. For example, pressing escape and then 'k' will bring up the last commandused in the shell.

    awk

    - this would be a damn useful command if I knew how to use it properly. seealternative page awkhelp

    man - look at the manual, e.g.$ man ps # will list the manual page for the command ps

    GENERAL INFORMATION COMMANDS

    smon

    - monitor's system usage - F5 shows processes which are hogging the machine.Not available on AIX 4.1 and above sadly.

    uptime

    - shows how long the system has been up and how hard it is being hammered. The

    load average fields show how many jobs on average are waiting. 10 the machine is beingseriously hammered.

    who

    - list users who are currently logged on (useful with option 'am i' - i.e. 'who am i'or 'whoami')

    w

    - list users and what they are doing, including idle time. The first line is the outputfrom uptime

    id

    - similar to whoamiexcept that it does a direct check to see who you are - who

    only checks /etc/utmp so any su commands will be ignored.ps- list processes currently running, by default on the current shell. Useful withoptions:

    -t - show all processes running on a terminal -ef - show all processes -u - show all processes owned by a user -flp - show as much information as you can about aprocess number -aux - show processes in order of usage of the processors. Useful

    to see what processes are hogging system resources.

    fuser -u - show who is using a file.(system hogging command). Useful when trying towork out who has locked a row or table in an informix database for example.

    lpstat -p - show the current status of a printer and any jobs in the queue. lpstat withoutarguments prints all of them.

    http://bigcalm.tripod.com/aix/awkhelp.htmhttp://bigcalm.tripod.com/aix/handycommands.htm#uptimehttp://bigcalm.tripod.com/aix/handycommands.htm#whohttp://bigcalm.tripod.com/aix/handycommands.htm#whohttp://bigcalm.tripod.com/aix/handycommands.htm#whohttp://bigcalm.tripod.com/aix/handycommands.htm#suhttp://bigcalm.tripod.com/aix/awkhelp.htmhttp://bigcalm.tripod.com/aix/handycommands.htm#uptimehttp://bigcalm.tripod.com/aix/handycommands.htm#whohttp://bigcalm.tripod.com/aix/handycommands.htm#whohttp://bigcalm.tripod.com/aix/handycommands.htm#su
  • 8/3/2019 Aix Command Guide

    14/22

    enable - enable a printer queue. You must be root or a member of the printq group to runthis command.

    disable - disable a printer queue. You must be root or a member of the printq group to run

    this command.enq - examine spool queue for printers.

    uname -a- will show you what machine you're currently on.

    ipcs

    - list semaphores and shared memory.ipcrm -s

    - remove semaphore or shared memory.crontab

    - use -l to list all regular scheduled jobs. To alter them, use option -e

    at - perform a job at a specified time. (Useful for running something at a later date).at retains the current environment. e.g.$ at now + 5 minutesecho "Phone Julie McNally" > /dev/tty616^Djob compjmd.389748732 will be run at ???Will echo to tty616 the message "Phone Julie McNally" in 5 minutes. e.g.2$ at 0331235930echo "April fools day!" > /dev/console^Dwill echo "April fools day!" to the console at 11:59 and 30 seconds, on the 31st ofmarch. Format for this is: [YYYY]MMDDhhmmss. at jobs are sometimes used inthe place of crontab's because if the machine is off when the crontab is meant totake place, the job never happens. at jobs automatically start when the machine isswitched on if the machine was down at the time. typing at -l will show you allthe at jobs you have queued, at -r will remove an at job (only the owneror root is allowed to do this).

    date

    - show current date and time. This command may also be used to set the systemclock (ONLY WHEN EVERYONE IS LOGGED OFF) with a root user id. A datechange is never simple, even when adjusting things by an hour. The safest way todo it is to change the date then reboot the machine because otherwise thecrontabdaemon may start doing jobs at odd times. I believe there might be a 'go slow/fast'option to set the clock, and the clock will then run 'slower/quicker' until it catchesup with the required time.

    last - shows a list of recent logins. It looks at /var/adm/wtmp so it only shows initiallogins, and not whether those users have been su'd to.

    fileplace -pv

    http://bigcalm.tripod.com/aix/handycommands.htm#crontabhttp://bigcalm.tripod.com/aix/handycommands.htm#crontabhttp://bigcalm.tripod.com/aix/handycommands.htm#suhttp://bigcalm.tripod.com/aix/handycommands.htm#suhttp://bigcalm.tripod.com/aix/handycommands.htm#crontabhttp://bigcalm.tripod.com/aix/handycommands.htm#su
  • 8/3/2019 Aix Command Guide

    15/22

    - show the physical (as in disk location) location of a file. Useful for tracinginformix files, and perhaps for working out whether defragmentation copying isrequired.

    SYSTEM COMMANDS

    kill - - sends a signal (normally a kill) to a process. kill -9 terminates the job noquestions asked, kill -15 tries to clear up as much as possible - e.g. removesemaphores and such-like. Other signals may be sent as well, see manual and/usr/include/sys/signal.h to see what signals you can send to a process.

    renice - make a process not hog the system so much by setting its nice value.

    smit

    - system admin program for AIXdf

    - list volume groups + usage. see also lsvg. Usually used with the -k flag so thenumber of blocks is displayed in 1024-blocks.

    cu -l - log on to device such as a pad or a modem. See related files /etc/uucp/* and/etc/locks and /etc/services

    stty sane

    - Changes terminal settings back to normal. If a tetra module for example crashesyour screen so that no keys function except ^C which doesn't even do very muchthen typing ^Jstty sane^J should cure the problem. To fully cure the problem youalso need to type stty tab3 (and stty -ixon if you're feeling a little overzealous)

    stty

    - allows you to change terminal settings such as the interrupt key, quit key, etc.e.g.$ stty intr ^A # would change the interrupt key to being control-A$ stty quit ^L #would set the quit key (normally ^\) to control-L. other keychanges are:

    erase (normally ^H) xon (normally ^Q) xoff (normally ^S) eof (normally ^D)

    To really annoy a systems administrator, change interrupt to 't' and quit to '^D' .hehehehehehelscfg

    - show all connected deviceslsvg

    - list volume groups (see related file diskhelp)lspv

    http://bigcalm.tripod.com/aix/handycommands.htm#lsvghttp://bigcalm.tripod.com/aix/handycommands.htm#lsvg
  • 8/3/2019 Aix Command Guide

    16/22

    - list physical disks (and see related file diskhelp)lspv without arguments will produce a list of all the hard-disks used. lspv will produce a list of information about the hard disk. lspv -l will show any logical volumes which are mapped on to that drive.

    lsdev

    - list devices. Options:

    -C list Configured devices -P list Possible devices

    produces different output when you are root.mkdev

    - make devices. e.g. To make a tty:# Script to add a tty. Options that need amending are:# -l name of tty to be created - e.g '-l tty600' wil create# a tty called 'tty600'

    # -p RAN name# -w Port number on RAN# -a Attributes (e.g. to set up auto login, etc.)mkdev -c tty -t 'tty' -s 'rs232' -l tty433 -p sa2 -w 2 -a term='wyse50' -aforcedcd='enable' -a login='enable' -a speed='19200'e.g. To create a printer (raw device):mkdev -c printer -t 'osp' -s 'rs232' -p 'sa3' -w '10' -l label2 -a xon='yes' -a dtr='no'-a col=500It is highly recommended that you make and change devices usingsmit

    chdev

    - change devices. See mkdev

    cc - c compiler, use with

    -o to specify a target instead of a.out -O optimise -w or -W all warning flags.

    shutdown

    - shutdown the system so that it may be switched off. Rather obviously, this mayonly be run by root. Options:

    -f shuts the system down immediately (rather than waiting for aminute) -R reboot the system immediately after halt

    oslevel

    - show the current revision of the operating system.

    CONNECTIVITY

    http://bigcalm.tripod.com/aix/handycommands.htm#smithttp://bigcalm.tripod.com/aix/handycommands.htm#smithttp://bigcalm.tripod.com/aix/handycommands.htm#smithttp://bigcalm.tripod.com/aix/handycommands.htm#mkdevhttp://bigcalm.tripod.com/aix/handycommands.htm#smithttp://bigcalm.tripod.com/aix/handycommands.htm#mkdev
  • 8/3/2019 Aix Command Guide

    17/22

    exit

    - end current shell process. If you log in, then type this command, it will returnyou to login. ^D (control-D) and logout (in some shells) does the same.

    rlogin

    - login to a remote machine, e.g.

    $ rlogin hollandrs # log in to machine called hollandrsUseful with -l option to specify username - e.g.$ rlogin cityrs -l ismsdev # log in to machine cityrs as user ismsdev For furtherinfo about trust network see .rhosts file and /etc/resolv.conf (I think).

    telnet

    - very similar to rlogin except that it is more flexible (just type telnet with noarguments and then '?' to see the options). Useful because you can specify a telnetto a different port.

    ftp

    - File Transfer Protocol - a quick and easy method for transferring files betweenmachines. The .netrc file in your $HOME directory holds initial commands. type

    ftp without arguments and then '?' to see options)rcp- Remote copy. Copies a file from one unix box to another, as long as they trusteach other (see .rhosts file or /etc/resolv.conf I think). Options

    -f (to force the copy to occur) -r (to recursively copy a directory) -p (to attempt to preserve permissions when copying)

    su - - switch user, option '-' means that the users .profile is run, without option you

    merely assume the id and permissions of the user, without (for example) changingPATH and DBPATH, e.g.$ su - root # become root$ su root # gain permissions of root but don't change the current environmentvariables$ su - vlink# switch to user vlinkIf you are root, you may su to any other user without being prompted for apassword. su without arguments is the same as 'su root'. Note that the 'su' option isnot available on all UNIX machines as it can crash some of them.

    ping - check that is alive and well (do not expect an immediate responsefrom a machine that is linked over an ISDN line). Firewalls often block pingpackets after thePing of Deathso quite often you'll find you can't ping internetsites either. Options include:

    -q ping quietly -i wait no of seconds between each packet sending. Thedefault is 1 second. If you are using ping to keep an ISDN line up thenusing something like $ ping -i 5 -q hollandrs is ideal.

    http://www.elsewhere.org/jargon/html/entry/Ping-O'-Death.htmlhttp://www.elsewhere.org/jargon/html/entry/Ping-O'-Death.htmlhttp://www.elsewhere.org/jargon/html/entry/Ping-O'-Death.htmlhttp://www.elsewhere.org/jargon/html/entry/Ping-O'-Death.html
  • 8/3/2019 Aix Command Guide

    18/22

    -f Never use this! Sends as many packets as it possibly can as fastas possible, used for network debugging and is likely to slow networkshorribly when used. Known as 'flood' pinging. -c send no of packets before giving up

    To check that your machine can ping, try pinging 127.0.0.1 - this acts as afeedback loop, checking the network card's ability to ping.rsh

    - remote shell - e.g.$ rsh altos more /tmp/chk# will run the command more the file /tmp/chk on themachine called altos. Useful in pipes for example. rsh on its own will execute alogin. Use option '-l' to specify logon name. You can also use rcmd and remsh onother flavours of unix.

    host - lookup the ip address in the /etc/hosts file and give its name

    TAPES AND DISKS

    Please see this page for more information on disks in AIX

    dd if= of= bs= conv=sync- direct (and I mean DIRECT) copy, normally to tape. Archaic syntax and veryrarely used. flags:

    if - input filename or device of - output filename bs - block size

    conv - ??

    e.g. To write a file to tape use$ dd if=/etc/hosts of=/dev/rmt0 bs=1024 conv=sync # write hosts file to tapeusing dd

    cpio

    stands for copy in-out, and is extremely powerful if you can cope with theinnumerable flags that you have to use(!)$ cpio -iBcvumd "etc/hosts" /dev/rmt0 # Write the contents of the /etc directoryto tape$ find /etc -print | cpio -pdumv /usr2/etcbackup/ # copy directory /etc to/usr2/etcbackup and retain all permissions.meaning of the flags:

    i - input o - output B - Block size of 5120 bytes c - read/write header info

    http://bigcalm.tripod.com/aix/aixdisks.htmhttp://bigcalm.tripod.com/aix/handycommands.htm#findhttp://bigcalm.tripod.com/aix/handycommands.htm#findhttp://bigcalm.tripod.com/aix/aixdisks.htmhttp://bigcalm.tripod.com/aix/handycommands.htm#findhttp://bigcalm.tripod.com/aix/handycommands.htm#find
  • 8/3/2019 Aix Command Guide

    19/22

    v - list file names u - unconditional copy - overwrites existing file. m - keep modification dates d - creates directories as needed. t - generate listing of what is on the tape.

    p - preserve permissions.

    tapeutil -f - A program which came with the tape library to control it's working. Calledwithout arguments gives a menu. Is useful for doing things like moving tapesfrom the slot to the drive. e.g.$ tapeutil -f /dev/smc0 move -s 10 -d 23 # which moves the tape in slot 10 to thedrive (obviously, this will depend on your own individual tape library, may Isuggest the manual?).

    doswrite -a - copy unixfile to rs6000's floppy disk drive in DOS format. -a option expands

    certain characters, for certain ascii conversions.dosdir - show list of files on a dos floppy disk. Useful with option -l (long format). Likedos command 'dir'

    dosread -a - copy dos file in floppy disk drive to unix - if UNIXFILE is omitted, it outputs tothe screen.

    dosdel - delete dos file on floppy disk.

    dosformat

    - format dos floppy disk (High Density)

    tar - Read/Write stuff to archive.tar cvf /dev/rmt0 # will write files to tapetar xvf /dev/rmt0 will read files from tapetar tvf /dev/rmt0 will give a listing of what's on the tape. If you're using an archivefile then replace /dev/rmt0 in the examples above with the name of the archivefile.

    SCREEN COMMUNICATION

    echo

    - a command mainly used in shell scripts. Examples:$ echo "Hello" # will print Hello on your screen$ echo "Hello" > /dev/tty616 # will print Hello on someone elses screen (warning- can crash their screen!)$ echo $DESTF10 # will print the value of the environment variable DESTF10$ echo "\033Fdemo demo" # will echo demo to the status bar at the top of a wyseterminalSee also file shellscripts

  • 8/3/2019 Aix Command Guide

    20/22

    read

    - will read text from standard input and place it in the variable name specified.See file shellscripts

    line

    - waits until the user presses return before carrying on (writes what is typed to

    standard output). If used in a crontab/at job this instruction is ignored. See fileshellscriptstalk

    - set up an interactive communication dialogue box between two users. Looksgood but isn't really that useful.

    write - writes a message to someone elses screen. Try typing 'write root' and then type amessage, finishing with control-D.

    banner - writes in huge letters across your screen! (max: 10 chars per word)

    wall

    - send a message to all people on a system. Can only be executed by root (I think).tput - tty type independent attribute setting (requires TERM variable and TERMCAPto be set). I only know these few bits:

    tput cnorm - turns the screen cursor on tput civis - turns the screen cursor off tput clear - clears the screen tput smso - turns all new text to bold tput rmso - turns all bold text off

    tee (-a) - command used in pipes to take a copy of the standard output. e.g.$ ls | tee /tmp/x # would output ls normally and put a copy in /tmp/x. The option '-a' is used to append rather than replace files.

    SOURCE CODE CONTROL SYSTEM (SCCS)

    SCCS Overview

    The source code control system allows versions of a program to be stored in a specialfile, so that any version may be retrieved. There are a few commands involved (not all ofthem listed here). All source code files start with 's.'

    get -r - get a program out of source code to read only. Missing out the -r flag gets themost recent version. e.g.$ get $SCUK/s.parser.c # extracts file parser.c from source code file$SCUK/s.parser.c as read only. See get -e for editing.

    get -e - get a piece of code out for edit, so that the code may be modified and a newversion created using 'delta'. e.g.

    http://bigcalm.tripod.com/aix/handycommands.htm#lshttp://bigcalm.tripod.com/aix/handycommands.htm#lshttp://bigcalm.tripod.com/aix/handycommands.htm#get%20-ehttp://bigcalm.tripod.com/aix/handycommands.htm#lshttp://bigcalm.tripod.com/aix/handycommands.htm#lshttp://bigcalm.tripod.com/aix/handycommands.htm#get%20-e
  • 8/3/2019 Aix Command Guide

    21/22

    $ get -e $SCUK/s.parser.c # extracts file parser.c from source code file$SCUK/s.parser.c for editing. See get for read-only.

    delta - you must be in the directory with the modified piece of code when you executethis command. This adds the latest version to the source code file. e.g.

    $ delta $SCUK/s.parser.c # writes file parser.c to the source code file$SCUK/s.parser.c . See get -e for information on how to extract the file fromsource code.

    prs - show comments/details on source code file.

    admin -r -i - create a new source code file with progam. -r specifies the initial revision of theprogram and may be missed out (default is 1.1 I think). Must be spaced correctly!admin is also used for sccs administration, but it gets to fear and loathing timepretty fast. e.g.admin -iparser.c $SCUK/s.parser.c # creates a new source code file called

    $SCUK/s.parser.c from the file parser.cunget - cancels a get -e

    MISCELLANEOUS

    strip - Removes all linking information within a compiled program - basically a way ofcutting down the size of an executable.

    yes - yes outputs the word 'yes' as fast as its' little legs can go. Never called on it's

    own. Always used in pipes. For example:$ yes | rm *.o # would confirm 'yes' wheneverrm prompts for confirmation. Youcan also use it to output a different word e.g.$ yes please # would output 'please' to the screen until you kill it (prob.immediately).

    SHELL SCRIPT COMMANDS

    Are all held on a separate page now. Commands covered are export,if,for, shift, test,while, case, and a few others.

    sed ''- used by myself for quick substitutions when trdoesn't seem to be doing its jobproperly. The syntax of the pattern is similar to viex command line. E.g. Tosubstitute all spaces with colon symbols the command issed 's/ /:/g' file1 # substitute all occurrences of spaces with colons in file1 andoutput to stdout.

    http://bigcalm.tripod.com/aix/handycommands.htm#gethttp://bigcalm.tripod.com/aix/handycommands.htm#get%20-ehttp://bigcalm.tripod.com/aix/handycommands.htm#get%20-ehttp://bigcalm.tripod.com/aix/handycommands.htm#rmhttp://bigcalm.tripod.com/aix/handycommands.htm#rmhttp://bigcalm.tripod.com/aix/shellscripthelp.htmhttp://bigcalm.tripod.com/aix/handycommands.htm#trhttp://bigcalm.tripod.com/aix/handycommands.htm#trhttp://bigcalm.tripod.com/aix/handycommands.htm#vihttp://bigcalm.tripod.com/aix/handycommands.htm#exhttp://bigcalm.tripod.com/aix/handycommands.htm#gethttp://bigcalm.tripod.com/aix/handycommands.htm#get%20-ehttp://bigcalm.tripod.com/aix/handycommands.htm#get%20-ehttp://bigcalm.tripod.com/aix/handycommands.htm#rmhttp://bigcalm.tripod.com/aix/handycommands.htm#rmhttp://bigcalm.tripod.com/aix/shellscripthelp.htmhttp://bigcalm.tripod.com/aix/handycommands.htm#trhttp://bigcalm.tripod.com/aix/handycommands.htm#vihttp://bigcalm.tripod.com/aix/handycommands.htm#ex
  • 8/3/2019 Aix Command Guide

    22/22

    -------------- End of HandyCommands File ------------

    28th September 2001 Copyright Jonathan Daniel 2001

    http://validator.w3.org/check/referer