home *** CD-ROM | disk | FTP | other *** search
/ The Hacker's Encyclopedia 1998 / hackers_encyclopedia.iso / etc / misc / cdc_014.txt < prev    next >
Encoding:
Text File  |  2003-06-11  |  17.5 KB  |  490 lines

  1.  
  2. _______________________________________________________________________________
  3. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  4.        _   _                                             _   _
  5.       ((___))                                           ((___))
  6.       [ x x ]          cDc communications, inc.         [ x x ]
  7.        \   /                 presents...                 \   /
  8.        (` ')                                             (` ')
  9.         (U)                                               (U)
  10.  
  11.                      Gibe's UNIX COMMAND Bible
  12.         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  13.         The latest file from the Cow's Information Series,
  14.         Franken's UNIX Command Bible is suitable for the UNIX
  15.         dilettante, as well as for the hardcore hack. Provides
  16.         easy reference for those hard-to-remember commands.
  17.             Attractive print-out fits well in any decor.
  18.  
  19.  
  20.             Edited by High Priest and Scribe, F. Gibe
  21.  
  22.        "Smash the State! Have a Nice Day!" ........  1987
  23.  
  24. _______________________________________________________________________________
  25. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  26.  
  27.       Command                           Description
  28.       ~~~~~~~                           ~~~~~~~~~~~
  29.  
  30.         awk             Search for a pattern within a file. Includes
  31.                         a built-in programming language.
  32.  
  33.        bdiff            Compares two large files.
  34.  
  35.         bfs             Scans a large file.
  36.  
  37.         cal             Displays a calendar.
  38.  
  39.         cat             Concatenates and prints files.
  40.  
  41.         cc              C  compiler.
  42.  
  43.         cd              Change directory.
  44.  
  45.       chgrp             Changes a file's group ownership.
  46.  
  47.       chmod             Changes a file's access permissions.
  48.  
  49.       chown             Changes the individual ownership of a file.
  50.  
  51.        cmp              Compares two files; diplays the location (line
  52.                         and byte) of the 1st difference between these.
  53.  
  54.       comm              Compares two files so as to determine which
  55.                         lines are common to both.
  56.  
  57.        cp               Copies a file to another location.
  58.  
  59.        cu               Calls another UNIX system.
  60.  
  61.       date              Returns the date and time.
  62.  
  63.        df               Displays free space in the file system.
  64.  
  65.       diff              Displays the differences between two files
  66.                         or directories.
  67.  
  68.       diff3             Displays the differences between three files
  69.                         or directories.
  70.  
  71.        du               Reports on file system usage.
  72.  
  73.       echo              Displays its argument.
  74.  
  75.        ed               Text editor.
  76.  
  77.        ex               Text editor.
  78.  
  79.       expr              Evaluates its argument which is generally
  80.                         a mathematical formula.
  81.  
  82.        f77              FORTRAN compiler.
  83.  
  84.       find              Locates the files w/ specified characteristics.
  85.  
  86.       format            Initializes a floppy disk.
  87.  
  88.       grep              Searches for a pattern within a file. (see awk)
  89.  
  90.       help              Salvation.
  91.  
  92.       kill              Ends a process.
  93.  
  94.        ln               Used to link files.
  95.  
  96.        lpr              Copies the file to the line printer.
  97.  
  98.        ls               Displays info. about one or more files.
  99.  
  100.        mail             Used to receive or deliver e-mail.
  101.  
  102.       mkdir             Creates a new directory.
  103.  
  104.        more             Displays a long file so that the user
  105.                         can scroll through it.
  106.  
  107.         mv              Used to move or rename files.
  108.  
  109.         nroff           Used to format text.
  110.  
  111.         ps              Display a process's status.
  112.  
  113.         pwd             Display the name of the working directory.
  114.  
  115.         rm              Removes one or more files.
  116.  
  117.         rmdir           Deletes one or more directories.
  118.  
  119.         sleep           Causes a process to become inactive for a
  120.                         specified length of time.
  121.  
  122.         sort            Sort and merge one or more files.
  123.  
  124.         spell           Finds spelling errors in a file.
  125.  
  126.         split           Divides a file.
  127.  
  128.         stty            Display or set terminal parameters.
  129.  
  130.         tail            Displays the end of a file.
  131.  
  132.         troff           Outputs formatted output to a typesetter.
  133.  
  134.         tset            Sets the terminal type.
  135.  
  136.         umask           Allows the user to specify a new creation
  137.                         mask. 
  138.  
  139.         uniq            Compares 2 files. Finds and displays lines
  140.                         in one file that are unique.
  141.  
  142.         uucp            UNIX-to-UNIX execute.
  143.  
  144.          vi             Full screen editor.
  145.  
  146.          wc             Displays details in the file size.
  147.  
  148.         who             Info. on who else be online.
  149.  
  150.         write           Used to send a message to another user.
  151. _______________________________________________________________________________
  152. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  153.   That's the Summary. Now print it out, if you'd like. Good for fast
  154.   referencing. Following the Summary is a more in-depth look at each 
  155.              of the commands already listed.
  156. _______________________________________________________________________________
  157. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  158.  
  159.    awk program filenames
  160.    awk -f programfilenames filenames
  161.    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  162.    The [awk] utility can be used to find any lines in a file which 
  163.    match a certain pattern; once found, these lines can be processed.
  164.    In the first configuration, the program that [awk] is to
  165.    execute is specified in the command line. In the second,
  166.    the program is stored as the file given in programfilename.
  167.    The -f option instructs [awk] to read this file.
  168.  
  169.  
  170.    [bdiff] is used to compare files too large for [diff]. See
  171.    [diff] for the format.
  172.  
  173.  
  174.    bfs filename
  175.    ~~~~~~~~~~~~
  176.    [bfs] is used to scan a large file to determine where to split
  177.    it into smaller files.
  178.  
  179.  
  180.    cal 01-12 (month) 0-9999 (year)
  181.    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  182.    [cal] utility can be used to display a calendar of any year
  183.    from 0 to 9999 AD, and any or all of the twelve months.
  184.  
  185.  
  186.    cat filename
  187.    ~~~~~~~~~~~~
  188.    [cat] can be used to examine a short file. See [more] for 
  189.    lengthier files.
  190.  
  191.  
  192.    number[cc]
  193.    ~~~~~~~~~~
  194.    The [cc] command changes the entire current line, or a group
  195.    of lines starting with the current line. [number] represents
  196.    the number of old lines to be deleted.
  197.  
  198.  
  199.    cd directory name
  200.    ~~~~~~~~~~~~~~~~~
  201.    The [cd] command causes the current working directory to be
  202.    changed. The [directory name] can be either a full or partial
  203.    path name.
  204.  
  205.  
  206.    chgrp groupname filename
  207.    ~~~~~~~~~~~~~~~~~~~~~~~~
  208.    This command changes the group ownership of a file.
  209.  
  210.  
  211.    chmod {ugoa} {+-} {rwx}
  212.    ~~~~~~~~~~~~~~~~~~~~~~~
  213.    The [chmod] utility changes a file's access permissions. [u]
  214.    specifies the user or owner's login name, [g] specifies a group
  215.    and [o] indicates all others. [a] indicates the user, group,
  216.    and all others; c'est the default. [+] adds permission; [-]
  217.    deletes it. [r] indicates read, [w] write, and [x] execute.
  218.  
  219.  
  220.    chown individualname filename
  221.    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  222.    [chown] changes the individual ownership of a file (see chgrp).
  223.  
  224.  
  225.    cmp filename1 filename2
  226.    ~~~~~~~~~~~~~~~~~~~~~~~
  227.    [cmp] is one of the four principle UNIX file comparison utilities.
  228.    It compares 2 files, and returns the positions where they differ.
  229.  
  230.  
  231.    comm -options filename1 filename2
  232.    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  233.    The [comm] utility, in comparing two files, produces three
  234.    columns of output. The first contains lines unique to the
  235.    first file, the second, lines unique to the second, and the
  236.    third column, lines common to both files. By placing the
  237.    numbers [1], [2], and/or [3] in the [options] position, any
  238.    one (or more) of these columns can be suppressed.
  239.  
  240.  
  241.    cp sendingfile receivingfile
  242.    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  243.    The [cp] command copies a file. [sendingfile] is the file to be
  244.    copied, [receivingfile] is the file to which it is copied.
  245.  
  246.  
  247.    diff [options] filename1 filename2
  248.    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  249.    Again, a file comparison utility. However, with [diff], the 
  250.    differences are displayed as instructions that can be used
  251.    to edit the files so that they are identical.
  252.  
  253.  
  254.    diff3 filename1 filename2 filename3
  255.    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  256.    Similar to [diff], [diff3] is unique in that it can compare
  257.    three files. Gee.
  258.  
  259.  
  260.    ed filename
  261.    ~~~~~~~~~~~
  262.    One of the UNIX's three editing utilities, [ed] is a basic line
  263.    editor. I'm sure there are other files that will explain how
  264.    to use [ed]. Thus, I'll confine myself to a rough outline:
  265.    e filename ........... edit a different file
  266.    f filename ........... changes the currently specified file.
  267.    h .................... provides explanation of errors.
  268.    I
  269.    text ................. inserts text before the current line.
  270.    line,linel ........... lists the specified lines.
  271.    line,linen ........... displays specified lines, preceded by
  272.                           their line numbers.
  273.    q .................... exit from [ed]
  274.    w .................... writes buffer to current filename.
  275.    + or - ............... +number of lines closer to end
  276.                           -number of lines closer to beginning.
  277.  
  278.  
  279.    expr formula
  280.    ~~~~~~~~~~~~
  281.    Utility which evaluates an expression.
  282.  
  283.  
  284.    find directory searchcriteria parameter actioncriteria parameter
  285.    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  286.    The [find] utility can be very useful indeed, especially when
  287.    confronted by a UNIX with countless files. Basically, this 
  288.    command finds files which meet certain criteria, and then
  289.    performs an operation (such as printing the files). Search
  290.    criteria consists of the following:
  291.  
  292.  
  293.    Criteria     Parameter       Description
  294.    ~~~~~~~~     ~~~~~~~~~       ~~~~~~~~~~~
  295.    -name       filename        Files whose names match [filename]
  296.                                will meet this criteria.
  297.    -type       filetype        Files whose type matches that specified
  298.             [b] block special                      will meet criteria.
  299.             [c] character spec. file
  300.             [d] directory file
  301.             [f] plain file
  302.    -links      +/- x           Files with # of links indicated by
  303.                                + or - x meet this criteria.
  304.    -user       login name      Files belonging to user with given
  305.             or user ID #       login name or ID # meet criteria.
  306.    -group      group name      Files belonging to group with given
  307.             or group ID #      group name or ID # meet this criteria.
  308.    -size       + or - x        Files greater than +x bytes or less
  309.                                than -x bytes meet this criteria.
  310.    -atime      + or - x        Files not accessed within +x days,
  311.                                accessed within -x days, or acc-
  312.                                essed x days ago meet criteria.
  313.    -mtime      + or - x        Files NOT modified within +x days,
  314.                                modified within -x days, or modified
  315.                                x days ago will meet this criteria.
  316.    -newer      filename        Files modified more recently than
  317.                                [filename] meet this criteria.
  318.   Action Criteria   "                    "
  319.   ~~~~~~~~~~~~~~~   ~                    ~
  320.    -print           -          When search criteria are met, path
  321.                                name of the file is displayed.
  322.    -exec       command{ }\;    Executes given command when search
  323.                                criteria are met. { } indicates file-
  324.                                name, [\;] ends the command.
  325.    -ok         command{ }\;    Exactly like -exec, except user is
  326.                                prompted [y] or [n] before command.
  327.  
  328.  
  329.    grep -options searchstring filenames
  330.    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  331.    Another search command, this for a particular string of chars.
  332.  
  333.  
  334.    ln original new
  335.    ~~~~~~~~~~~~~~~
  336.    [ln] establishes a file link. For this utility, [original] repre-
  337.    sents the filename to be linked, [new] the filename of the new
  338.    link to the original.
  339.  
  340.  
  341.    [ls] provides directory information.  [ls -l/] displays a more
  342.    complete version of the info. list.
  343.  
  344.  
  345.    mail username username
  346.    ~~~~~~~~~~~~~~~~~~~~~~
  347.    This utility allows e-mail to be sent to other system users. 
  348.  
  349.    mail
  350.    ~~~~
  351.    Simply typing [mail] checks the user's own mailbox.
  352.    When sending mail, several items must be set:
  353.    ~s text ............ sets the subject field
  354.    ~c user names ...... sends other users carbon copies of mail
  355.    m user names ....... activates the compose mode, with the
  356.                         specified users as the message's recipients.
  357.    ~h ................. displays and allows editing of all headers.
  358.    ^D ................. ends message editing; sends mail.
  359.    ~r filename ........ places file in body of message (keen command)
  360.  
  361.    Reading One's Own Mail:
  362.    h number or range ....... causes specified headers to be displayed
  363.    p message # ............. displays entire message
  364.    d number or range ....... deletes specified messages
  365.    u number or range ....... undelete specified mail during SAME
  366.                              mail session (messages removed after q)
  367.    q ....................... leave the post office
  368.  
  369.  
  370.    mkdir directoryname
  371.    ~~~~~~~~~~~~~~~~~~~
  372.    [mkdir] allows creation of a subdirectory, for your dining 
  373.    enjoyment.
  374.  
  375.  
  376.    more filename
  377.    ~~~~~~~~~~~~~
  378.    For longer files, [more] is a convenient utility. It will display
  379.    the first screen of file data and then stop, allowing the user 
  380.    to control scrolling henceforth.
  381.  
  382.  
  383.    mv oldfilename newfilename
  384.    ~~~~~~~~~~~~~~~~~~~~~~~~~~
  385.    The [mv] utility can be used simply to rename a file, or...
  386.  
  387.  
  388.    mv filea fileb... directory
  389.    ~~~~~~~~~~~~~~~~~~~~~~~~~~~
  390.    [mv] can also be used to move files to a new directory, provided
  391.    the directory exists, and you have write access to it.
  392.  
  393.  
  394.    ps -options
  395.    ~~~~~~~~~~~
  396.    The [ps] command, by itself, displays the status of each active
  397.    process controlled by your terminal. This status report includes
  398.    the Process Identification Number (PID), the terminal (TTY), the
  399.    time the process has been executing (TIME), and the command line
  400.    used to execute the process (CMD).
  401.    [ps]'s three options include -a (displays info. on active processes
  402.    controlled by any terminal), -x (info. on ALL active processes), and
  403.    -l (an extensive status report on all active processes).
  404.  
  405.  
  406.    pwd
  407.    ~~~
  408.    [pwd] command displays the present working directory.
  409.  
  410.  
  411.    rm filename
  412.    ~~~~~~~~~~~
  413.    [rm] removes a file. More than one file can be specified.
  414.  
  415.  
  416.    rmdir directoryname
  417.    ~~~~~~~~~~~~~~~~~~~
  418.    This utility removes a directory, an EMPTY directory (save the
  419.    hidden files). 
  420.  
  421.  
  422.    sleep seconds
  423.    ~~~~~~~~~~~~~
  424.    The [sleep] utility causes a process to become inactive for a
  425.    certain period of time. Max. seconds is 65,536 (about 18 hrs).
  426.  
  427.  
  428.    sort -options filenames
  429.    ~~~~~~~~~~~~~~~~~~~~~~~
  430.    [sort] merges and sorts files. Without options, [sort] orders
  431.    files by the ASCII codes of the characters at the beginning
  432.    of each line. Options include -b (leading blanks ignored), -d
  433.    (only letters, digs, and blanks considered; "dictionary sort"),
  434.    -f (case ignored), -n (numerical sort [for numerical data]), and
  435.    -r (a reverse sort).
  436.  
  437.  
  438.    split -size original resulting
  439.    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  440.    [split] divides a large file into smaller ones. [size] refers to
  441.    the number of lines the resulting files contain, [original] is
  442.    the name of the orig. file, and [resulting] represents the 
  443.    prefix name assigned to the newly created files.
  444.  
  445.  
  446.    umask ugo
  447.    ~~~~~~~~~
  448.    [umask] changes the file CREATION mask (see [chmod] for already
  449.    existing files). Here, [u] represents the owner's access 
  450.    permission, [g] the group's a.p., and [o] the a.p. for all others.
  451.  
  452.  
  453.    [uucp] (UNIX to UNIX copy) can be used to send files to a 
  454.    remote UNIX, or retrieve files from the remote system.
  455.    Other UNIX comm commands include [cu] (which establishes contact
  456.    with another system), and [uux] (UNIX to UNIX execute; allows
  457.    commands to be executed on a remote system).
  458.  
  459.  
  460.    wc -options filenames
  461.    ~~~~~~~~~~~~~~~~~~~~~
  462.    The [wc] utility displays file-size information. This includes
  463.    the number of lines, words, and characters. By chosing the 
  464.    -l, -w, or -c options, the information can be limited to only
  465.    line, word, or character number.
  466.  
  467.  
  468.    who
  469.    ~~~
  470.    A very useful command (which some systems respond to even before 
  471.    a user is actually logged on), [who] displays a list of users
  472.    currently online. This list includes the user's name, terminal
  473.    device # (tty), and the log-in time.  [who am i] displays info.
  474.    only on the user who executed the command.
  475.  
  476.  
  477. _______________________________________________________________________________
  478. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  479.    Alright. You may have noticed that this isn't EXACTLY a Bible. I
  480.    took the liberty of omitting some of the command explanations.
  481.    But, if anyone REALLY wants to know more about [vi], or [stty],
  482.    or (perhaps more justifiably) have a more comprehensive guide
  483.    to the mail system, I'll be glad to write some 'by request'
  484.                          text files.
  485. _______________________________________________________________________________
  486. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  487.  (c)1987  cDc communications  by Franken Gibe                         0/0/87-14
  488.  All Rights Smeared Across The Wall
  489.  
  490.