home *** CD-ROM | disk | FTP | other *** search
/ The Hacker's Encyclopedia 1998 / hackers_encyclopedia.iso / zines / uxu / uxu_014.txt < prev    next >
Encoding:
Text File  |  2003-06-11  |  39.0 KB  |  875 lines

  1. ftp> get uxu-014.txt -
  2.  
  3. <><><><><><><><><><><><><><><><><><><>!<><><><><><><><><><><><><><><><><><><><>
  4. #%       ..uXu..                                                   1991      %#
  5. %#                       Underground eXperts United                          #%
  6. #%                                presents...                                %#
  7. %#                                  -=*=-                                    #%
  8. #%                 The European Digest Series Vol.1 Issue #5                 %#
  9. %#        1991                  By THE CHIEF                      ..uXu..    #%
  10. <><><><><><><><><><><><><><><><><><><>!<><><><><><><><><><><><><><><><><><><><>
  11.  
  12.        SPECIAL MANUAL ISSUE    -   SCO XENIX System V TUTORIAL CHAPTER #2
  13.  
  14.                                   Contents...
  15.  
  16.                           01.............Introduction
  17.                           02.............Contents In Chapter Two
  18.                           03.............Xenix Tutorial Chapter Two
  19.                           04.............Recommended
  20.                           05.............End Comments
  21.  
  22.  
  23.  
  24.  
  25.  1. INTRODUCTION
  26.  ---------------
  27.  Welcome to TED Vol.1 Issue #5 - The uXu File #14!
  28.  The second part of the SCO XENIX V Tutorial manual is ready for TED, and
  29.  here it is for you. This section will cover the Basic concepts in XENIX
  30.  like some usual commands, some names/directories to know, and things the
  31.  beginner must know, for starters. Like before, if you're an unix/xenix
  32.  guru, or just if you have some basic knowledge of unix/xenix, you can
  33.  skip this chapter, and just keep it as a reference. This is, still, for
  34.  the beginner. The next chapter in the Xenix Tutorial Manual will cover
  35.  how to login to the system, some security tips, and more commands.
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  2. CONTENTS IN CHAPTER TWO
  42.  --------------------------
  43.  
  44.                  2.0 BASIC CONCEPTS
  45.                      2.1...Introduction
  46.                      2.2...Accounts
  47.                            2.2.1.....User Accounts
  48.                            2.2.2.....Super User Account
  49.  
  50.                      2.3...Files
  51.                            2.3.1.....Ordinary Files
  52.                            2.3.2.....Special Device Files
  53.                            2.3.3.....Directory Files
  54.                            2.3.4.....Directory Structure
  55.  
  56.                      2.4...Naming Conventions
  57.                            2.4.1.....Filenames
  58.                            2.4.2.....Pathnames
  59.                            2.4.3.....Sample Names
  60.                            2.4.4.....Special Characters
  61.  
  62.                      2.5...Commands
  63.                            2.5.1.....Command Line
  64.                            2.5.2.....Syntax
  65.  
  66.                      2.6...Input And Output
  67.                            2.6.1.....Redirection
  68.                            2.6.2.....Pipes
  69.  
  70.  
  71.  
  72.  3. XENIX TUTORIAL CHAPTER TWO
  73.  -----------------------------
  74.  
  75.  
  76. 2.0                            BASIC CONCEPTS                               2.0
  77. ===============================================================================
  78. 2.1 Introduction                                               2.1 Introduction
  79. ===============================================================================
  80.  
  81.    This chapter explains the basic concepts that you need to understand to
  82. work effectively in the XENIX environment. After reading this chapter, you
  83. should understand the fundamentals of user accounts, as well as how the 
  84. system's files and directories are organized and named, how commands are
  85. entered, and how a command's input and output can be redirected. It is important
  86. to read this chapter before proceeding to the tutorial chapters that follow.
  87.  
  88. 2.2                               ACCOUNTS                                  2.2
  89. ===============================================================================
  90. 2.2.1 User Accounts                                         2.2.1 User Accounts
  91. ===============================================================================
  92.  
  93.    An account must be created for you before you can log on to a XENIX system.
  94. Your account contains the following information:
  95.  
  96.      *   Your login name. This is the name by which you are known in the
  97.          system. It is the name you enter at the login prompt.
  98.  
  99.      *   Your password. To increase system security, each user may be
  100.          given a password. This password is entered when you log on to the
  101.          system.
  102.  
  103.      *   Your group identification. Each user is known to the system as an
  104.          individual and as a member of a group. Group membership is important
  105.          for system security reasons. As a member of a group, you may be
  106.          permitted to access files and directories that you cannot access
  107.          as an individual.
  108.  
  109.      *   Your "home directory." This is the place in the filesystem where
  110.          you can keep personal files. When you first log on in to the system,
  111.          you are placed in your home directory.
  112.  
  113.      *   Your "login shell." This is the program that reads and executes the
  114.          XENIX commands you input. In most cases, your login shell will be the
  115.          "Bourne Shell." The Bourne Shell uses the dollar sign ($) as a prompt.
  116.          However, you may be configured to use the "C-Shell," which uses the
  117.          percent sign (%) as a prompt, or the "Visual Shell," which is a menu-
  118.          driven interface. Throughout this tutorial, the expression "XENIX 
  119.          prompt" is used to refer to your shell prompt, wether it is the
  120.          percent sign or the dollar sign.
  121.  
  122.    Once an account has been established for you, you can manipulate the files,
  123. directories, and commands that make up the XENIX system.
  124.  
  125. ===============================================================================
  126. 2.2.2 Super User Account                               2.2.2 Super User Account
  127. ===============================================================================
  128.  
  129.    In addition to each user's individual account, every XENIX system has a
  130. "super user" account. (The super user is also referred to as "root.") In
  131. order to perform certain system administration tasks, the system administrator
  132. must log in as the super user. The super user has free rein over the system.
  133. The super user can read and edit any file on the system, as well as execute
  134. any program.
  135.  
  136. ===============================================================================
  137. 2.3 Files                                                             2.3 Files
  138. ===============================================================================
  139.  
  140.    The file is the fundamental unit of the XENIX filesystem. There are three
  141. different types of XENIX files: ordinary files (what we usually mean when we
  142. say "file"), special device files, and directories. Each of these is described
  143. in the sections that follow.
  144.  
  145. ===============================================================================
  146. 2.3.1 Ordinary Files                                       2.3.1 Ordinary Files
  147. ===============================================================================
  148.  
  149.    An ordinary file is simply a collection of 8-bit bytes. Ordinary files are
  150. usually documents, program source code, or program data. Executable binary
  151. files, or computer programs, are also considered ordinary files. The bytes
  152. of an ordinary file are interpreted as text characters, binary instructions,
  153. or program statements, by the programs that examine them.
  154.  
  155.    Every ordinary file has the following attributes:
  156.  
  157.      *   a filename (not necessarily unique),
  158.  
  159.      *   a unique filesystem number called an inode number,
  160.  
  161.      *   a size in bytes,
  162.  
  163.      *   a time of last change,
  164.  
  165.      *   a set of access permissions,
  166.  
  167.      *   an owner and a group.
  168.  
  169.    File Protection
  170.  
  171.    On a multi-user system, it is often necessary to "protect" certain files,
  172. denying some users access to the files while allowing access to others. Files
  173. are protected by assigning appropriate "access permissions" to them. XENIX
  174. provides three levels of access permissions:
  175.  
  176.       read        Having read permission on a file allows a user to view
  177.                   the contents of the file with such commands as <cat> and
  178.                   <more>. A user with read-only permission cannot edit a file.
  179.  
  180.       write       Having write permission on a file allows a user to edit
  181.                   the file.
  182.  
  183.       execute     If the file is a program, having execute permission on the
  184.                   file allows a user to run the program. You cannot run a
  185.                   program for which you do not have execute permission.
  186.  
  187.    Access permissions are assigned by a file's owner. (By default, the owner
  188. of a file is its creator.) Any combination of the three levels is permitted.
  189. This allows the file's owner to determine which users can read, write and/or
  190. execute the file. Note that the super user has @readm write and execute
  191. permissions on all files on the system.
  192.  
  193.    The file security mechanism implemented under XENIX is very flexible. It
  194. allows separate access permissions to be set for a file's owner, a file's
  195. group, and for all other users. In a typical case the, owner of a file might
  196. have read and write permissions, the group read-only permission, and all other
  197. users no access permissions at all.
  198.  
  199. ===============================================================================
  200. 2.3.2 Special Device Files                           2.3.2 Special Device Files
  201. ===============================================================================
  202.  
  203.    Each physical device on the system, such as hard and floppy disks, line-
  204. printers, terminals, and system memory, is assigned to a "special file."
  205. These files are also called "special device files." Special device files are
  206. not discussed in this tutorial. (For more information on special device files,
  207. see the XENIX System Administrator's Guide, also published by Swedish Hackers
  208. Association.)
  209.  
  210. ===============================================================================
  211. 2.3.3 Directory Files                                     2.3.3 Directory Files
  212. ===============================================================================
  213.  
  214.    Directory files are more like file drawers than files. They are places
  215. where files are stored (conceptually, not physically). Directory files are
  216. usually referred to as "directories."
  217.  
  218.    A directory contains the names and inode numbers of the files "within it."
  219. These inode numbers point to "inodes." XENIX uses inodes internally to
  220. organize filesystems. There is one inode per file. Inodes contain information
  221. about files. This information includes the file type, the number of links to
  222. the file, the location of the file on the disk, the size of the file, the
  223. identity of the file's owner and group, the file's access permissions, and
  224. the time the file was last modified.
  225.  
  226.    Like ordinary files, directories can be protected by assigning appropriate
  227. access permissions. These are read, write and execute. In order to do
  228. anything useful in a @directorym a user must have execute permission on that
  229. directory, Execute and write permissions determine whether files can be added
  230. to or removed from a directory. Execute and read permissions determine whether
  231. the contents of a directory can be listed. Access permissions are assigned to
  232. a directory by its owner. By default, the owner of a directory is its creator.
  233.  
  234. ===============================================================================
  235. 2.3.4 Directory Structure                             2.3.4 Directory Structure
  236. ===============================================================================
  237.  
  238.    With multiple users working on multiple projects, the number of files
  239. in a filesystem can proliferate rapidly, creating an organizational nightmare.
  240. The inverted "tree-structured" directory hierarchy that is a feature of the
  241. XENIX system allows users to organize large numbers of files efficiently.
  242. Related files, a directory can contain other directories, sometimes called
  243. "subdirectories." Subdirectories themselves can contain ordinary files and
  244. more subdirectories, and so on. The <cd> command is used to move from one
  245. directory to another.
  246.  
  247.    In this typical tree of files, the root of the tree is at the top and the
  248. branches of the tree grow downward. Directories correspond to "nodes" in the
  249. tree, while ordinary files correspond to "leaves." Figure 2-1 represent this
  250. inverted tree-structured directory hierarchy.
  251.  
  252.  
  253.                                 / (root)
  254.                                     |
  255.                  ---------------------------------------
  256.                  |                    |                |
  257.                 bin                  usr              dev
  258.                  |                    |                |
  259.                  |             --------------          |
  260.                  |             |            |          |
  261.                chmod         gwenl        markt      tty1a
  262.                                |            |
  263.                        --------------   -------------
  264.                        |            |   |           |
  265.                      mail         news text        data
  266.  
  267.  
  268.                       FIGURE 2-1  A Typical Filesystem
  269.  
  270.  
  271.  
  272.    In figure 2-1, the names [bin], [usr], [dev], [gwenl], and [markt] all
  273. represent directories, and are all nodes in the tree. At the top of the tree
  274. is the root directory, which is given the name slash (/). The names [mail],
  275. [news], [text], and [data] all represent ordinary files, and they are all
  276. "leaves" of the tree.  The file [chmod] is the name of a command that can
  277. be executed. The name [tty1a] is a special device file. It represents a 
  278. terminal and is also represented in the tree.
  279.  
  280.    If a directory contains a downward branch to other files or directories,
  281. those files and directories are "contained" in the given directory, All
  282. directories and files on the system are contained in the root directory. In
  283. Figure 2-1, the files [mail] and [news] are contained in the directory [gwenl],
  284. which itself is contained in the directory [usr]. The directory [usr], in turn,
  285. is contained in the root directory.
  286.  
  287.    It is possible to name any file in the system by starting at the root and
  288. traveling down any of the branches to the desired file. Files can also be
  289. named relative to any directory. XENIX naming conventions are discussed later
  290. in this chapter.
  291.  
  292.    THE USER DIRECTORY
  293.  
  294.    Each XENIX user is given a personal or "home" directory. This is a place
  295. where you can keep files that no other user is likely to need. Within the
  296. home directory, you may have other subdirectories that you own and control.
  297. All of the home directories on a XENIX system are often placed in the [usr]
  298. directory, as illustrated by Figure 2-2.
  299.  
  300.  
  301.                                     usr
  302.                                      |
  303.              --------------------------------------------------
  304.              |                           |                    |
  305.            adam                         eve                  mary
  306.              |                           |                    |
  307.              |                   -----------------            |
  308.              |                   |               |            |
  309.            text                 text           temp          text
  310.  
  311.  
  312.                       FIGURE 2-2  A Typical User Directory
  313.  
  314.  
  315.    In Figure 2-2, the [usr] directory contains each user's home directory.
  316. There are three users on this system, [adam], [eve], and [mary].
  317.  
  318. ===============================================================================
  319. 2.4 Naming Conventions                                   2.4 Naming Conventions
  320. ===============================================================================
  321.  
  322.    Every single file, directory, and device in XENIX has both a filename and
  323. a pathname. Filenames and pathnames are discussed in the following two
  324. sections.
  325.  
  326. ===============================================================================
  327. 2.4.1 Filenames                                                 2.4.1 Filenames
  328. ===============================================================================
  329.  
  330.    A filename is a sequence of 1 to 14 characters consisting of letters,
  331. digits and other special characters such as the underbar (_). Every single
  332. file, directory, and device in the system has a filename, it is best to
  333. confine filenames to the alphanumeric characters and the period. Other
  334. characters, especially control characters, are discouraged for use in
  335. filenames.
  336.  
  337.    Filenames should be indicative of a file's contents. For example, a file
  338. containing purchase orders should have a name like [orders], rather than
  339. [file1]. Note that filenames must be unique only within directories and need
  340. not be unique system-wide. Different directories can contain different files
  341. that have the same name. For example, there can be several files named [text]
  342. on a single system, as long as those files are each in separate directories.
  343.  
  344.    When a filename contains an initial period, it is "hidden," and is not
  345. displayed by the <lc> command. System configuration files are often hidden.
  346. However the <lc -a> command does display hidden files. The dash (-) is used
  347. in specifying command options and should be avoided when naming files. In
  348. addition, the question mark (?), the asterisk (*), brackets ([ and ]), and
  349. all quotation marks should Never be used in filenames, because they have
  350. special meaning to the XENIX shell. (For more information on these
  351. characters, see "Special Characters" later in this chapter.)
  352.  
  353. ===============================================================================
  354. 2.4.2 Pathnames                                                 2.4.2 Pathnames
  355. ===============================================================================
  356.  
  357.    A pathname is a sequence of directory names followed by a simple filename,
  358. each separated from the previous name by a slash. If a pathname begins with
  359. a slash, it specifies a file that can be found by beginning a search at the
  360. root of the entire tree. Otherwise, files are found by beginning the search
  361. at the user's Current Directory (also known as the Working Directory). The
  362. <pwd> command is used to print the name of the working directory on the
  363. screen.
  364.  
  365.    A pathname beginning with a slash is called a "full" or "absolute
  366. pathname". The absolute pathname is a map of of a file's location in the
  367. system. Absolute pathnames are unique: no two files, directories or devices
  368. have the exact same absolute pathname. A pathname Not beginning with a slash
  369. is called a "relative pathname", because it specifies a path relative to the
  370. current directory.
  371.  
  372. ===============================================================================
  373. 2.4.3 Sample Names                                           2.4.3 Sample Names
  374. ===============================================================================
  375.  
  376.    Among the directory and file names commonly found on XENIX systems are:
  377.  
  378.  
  379.    /                       The name of the root directory.
  380.  
  381.    /bin                    The directory containing most of the frequently
  382.                            used XENIX commands.
  383.  
  384.    /usr                    The directory containing each user's personal
  385.                            directory. The subdirectory, [/usr/bin] contains
  386.                            frequently used XENIX commands not in [/bin].
  387.  
  388.    /dev                    The directory containing special device files.
  389.  
  390.    /dev/console            The special device file associated with the system
  391.                            console.
  392.  
  393.    /dev/ttyXX              The names of special device files associated with
  394.                            system ports. XX represents a number, such as 1A
  395.                            or 006. Most ports are assigned to terminals.
  396.  
  397.    /lib                    The directory containing files of "libraries" used
  398.                            for system development.
  399.  
  400.    /usr/lib                The directory containing directories with XENIX
  401.                            applications.
  402.  
  403.    /tmp                    The directory for temporary files.
  404.  
  405.    /usr/joe/run            A typical full pathname. It is the pathname of a
  406.                            file named [run] belonging to a user named [joe].
  407.  
  408.    bin/script              A relative pathname. It names the file [script]
  409.                            in subdirectory [bin] of the current working
  410.                            directory. If the current directory is the root
  411.                            directory (/), it names [/bin/script]. If the
  412.                            current directory is [/usr/joe], it names
  413.                            [/usr/joe/bin/script].
  414.  
  415.    file1                   Name of an ordinary file in the current directory.
  416.  
  417.    All files and directories, with the exception of the root directory, have a
  418. "parent" directory. This directory is located immediately above the given file
  419. or directory. The XENIX filesystem provides special shorthand notations for
  420. the parent directory and for the current directory:
  421.  
  422.  
  423.    .                       The shorthand name of the current directory.
  424.                            For example, [./filexxx] names the same file
  425.                            as [filexxx], in the current directory.
  426.  
  427.    ..                      The shorthand name of the current directory's
  428.                            parent directory. For example, the shorthand
  429.                            name [../..] refers to the directory that is
  430.                            two levels "above" the current directory.
  431.  
  432. ===============================================================================
  433. 2.4.4 Special Characters                               2.4.4 Special Characters
  434. ===============================================================================
  435.  
  436.    XENIX provides a facility for specifying sets of filenames that match
  437. particular patterns. Suppose, for example, you are working on a large book.
  438. The different chapters of the book might be kept in separate files, whose
  439. names might be [chpt1], [chpt2], [chpt3], and so on. You might even break
  440. each chapter into separate files. For example, you might have files named
  441. [chpt1.1], [chpt1.2], [chpt1.3], and so on.
  442.  
  443.    If you want to print the whole book on the lineprinter, you could enter
  444. the following command:
  445.  
  446.                         <lp chap1.1 chap1.2 chap1.3 ...>
  447.  
  448.    Entering so many filenames in a command quickly becomes tedious, and will
  449. probably lead to mistakes. Fortunately, there is a shortcut. A sequence of
  450. names containing a common pattern can be specified with the use of special
  451. "wildcard" characters. The wildcard characters discussed in this chapter
  452. are:
  453.  
  454.  
  455.    *                       Matches zero or more characters.
  456.  
  457.    []                      Matches any character inside the brackets.
  458.  
  459.    ?                       Matches any single character.
  460.  
  461.  
  462.    For example, you can enter:
  463.  
  464.  
  465.    <lp chap*>
  466.  
  467.  
  468.    The asterisk (*) means "zero or more characters of any type," so this
  469. command translates into "send all files whose names begin with the word
  470. [chap] to the lineprinter." This is a quick and effective way of printing
  471. all the files that make up your book.
  472.  
  473.    This shorthand notation is not a unique property of the <lp> command. It
  474. can be used with any command. For example, you can list the names of the
  475. files in the book by typing:
  476.  
  477.  
  478.    <lc chap*>
  479.  
  480.  
  481.    The asterisk is not limited to the last position in a filename. It can be
  482. used anywhere in a filename and can occur several times. An asterisk bu itself
  483. matches all filenames not containing slashes or beginning with periods:
  484.  
  485.  
  486.    <cat *>
  487.  
  488.  
  489.    This command displays all files in the current directory on your terminal
  490. screen.
  491.  
  492.    The asterisk is not the only pattern-matching feature available. Suppose
  493. you want to print only chapters 1 through 4, and 9. You can enter:
  494.  
  495.  
  496.    <lp chap[12349]*>
  497.  
  498.  
  499.    The brackets ([ and ]) mean "match any of the characters inside the
  500. brackets." A Range of consecutive letters or digits can be abbreviated, so
  501. you can also do this with the following command:
  502.  
  503.  
  504.    <lp chap[1-49]*>
  505.  
  506.  
  507.    (Note that this does Not try to match [chap1*] through [chap49*], but
  508. rather [chap1*] through [chap4*] and [chap9*].) Letters can also be used
  509. within brackets: "[a-z]" matches any character in the range "a" through "z".
  510.  
  511.    The question mark (?) matches any single character:
  512.  
  513.  
  514.    <lc ?>
  515.  
  516.  
  517.    This command lists all files that have single-character names. The fol-
  518. lowing command lists information about the first file of each chapter (i.e.,
  519. [chap1.1], [chap2.1], ...):
  520.  
  521.  
  522.    <l chap?.1>
  523.  
  524.  
  525.    If you need to turn off the special meaning of any of the wildcard
  526. characters (*, ?, and [ ... ]) enclose the entire argument in single 
  527. quotation marks. For example, the following command lists only a file named
  528. "?" rather than all one-character filenames:
  529.  
  530.  
  531.    <lc '?'>
  532.  
  533.  
  534.    Pattern-matching features are discussed further in "The Shell" chapter of
  535. the XENIX User's Guide.
  536.  
  537. ===============================================================================
  538. 2.5 Commands                                                       2.5 Commands
  539. ===============================================================================
  540.  
  541.    You have already been introduced to three useful XENIX commands, <lc>,
  542. <lp>, and <cat>. The <lc> command is used to display directory contents, the
  543. <lp> command to print files and the <cat> command to display file contents.
  544.  
  545.    Commands are executable programs. When you enter the name of a command,
  546. XENIX looks for a program with that name and executes the program, if it can
  547. be found. Command lines can also contain arguments that specify options or
  548. files that the program needs. The command line and command syntax are
  549. discussed in the next two sections.
  550.  
  551. ===============================================================================
  552. 2.5.1 Command Line                                           2.5.1 Command Line
  553. ===============================================================================
  554.  
  555.    XENIX always reads commands from the "command line." The command line is
  556. a line of characters that is read by the shell to determine what actions to
  557. perform. (XENIX offers three shells, the Bourne Shell, the C-Shell and the
  558. Visual Shell.) The shell reads the names of commands from the command line,
  559. finds the executable program corresponding to the name of the command, then
  560. execute that program. When the program finishes executing, the shell resumes
  561. reading the command line.
  562.  
  563.    When you enter commands at a terminal, you are actually editing a line of
  564. text called the "command-line buffer." The command-line buffer becomes a
  565. command line only when you press RETURN. The command-line buffer can be edited
  566. with the BKSP and Ctrl-u keys. If the INTERRUPT key is pressed before RETURN,
  567. the command-line buffer is erased. (On most keyboards, DEL key is the
  568. INTERRUPT key.)
  569.  
  570.    Multiple commands can be entered on a single command line, provided they
  571. are separated by a semicolon (;). For example, the following command line
  572. prints out the current date and the name of the current working directory:
  573.  
  574.  
  575.    <date; pwd>
  576.  
  577.  
  578.    Commands can be submitted for processing in the "background" by appending
  579. an ampersand (&) to the command line. This mode of execution is similar to
  580. "batch" processing on other systems. The main advantage of placing commands in
  581. the background is that you can execute other commands from your terminal in
  582. the "foreground" while the background commands execute. For example, the
  583. following command outputs disk usage statistics in the directory [/usr], a
  584. fairly time-consuming operation, without tying up your terminal:
  585.  
  586.  
  587.    <du /usr > diskuse &>
  588.  
  589.  
  590.    The output of this <du> command is placed in the file [diskuse], by
  591. redirecting output with the greater-than symbol <>>. (Redirection of input
  592. and output is discussed in "Input and Output" below. Background processing
  593. is discussed in "Advanced Tasks.")
  594.  
  595. ===============================================================================
  596. 2.5.2 Syntax                                                       2.5.2 Syntax
  597. ===============================================================================
  598.  
  599.    The general syntax for commands is:
  600.  
  601.  
  602.    <cmd> [options][arguments][filename][...]
  603.  
  604.  
  605.    By convention, command names are lowercase. Options are always preceded
  606. by a dash (-) and are not required. They are used to modify the command. For
  607. example, the <lc> command lists, in columnar format, the contents of a
  608. directory. The same command with the <-l> option <lc -l> produces a long
  609. listing of a directory's contents.
  610.  
  611.    In some cases, options can be grouped to form a single option argument,
  612. as in the following command:
  613.  
  614.  
  615.    <lc -rl>
  616.  
  617.  
  618.    This command is really a combination of two options, where the <-rl>
  619. option selects the option that lists all files in the directory in both
  620. reverse alphabetical order and with the long format.
  621.  
  622.    Sometimes multiple options must be given separately, as in the following
  623. command:
  624.  
  625.  
  626.    <copy -a -v source destination>
  627.  
  628.  
  629.    Here, the <-a> option tells the <copy> command to ask the user for
  630. confirmation before copying <source> to <destination>. The <-v> option
  631. specifies "verbose", which causes <copy> to list the names if the files
  632. that are copied, as they are copied.
  633.  
  634.    Other arguments, such as search strings, can also be given, as in the
  635. following command:
  636.  
  637.  
  638.    <grep 'string of text' data.file>
  639.  
  640.  
  641.    The 'string of text' in this example is a single argument, and is the
  642. string for which the <grep> command searches in the file <data.file>.
  643.  
  644. ===============================================================================
  645. 2.6 Input and Output                                       2.6 Input and Output
  646. ===============================================================================
  647.  
  648.    By default, XENIX assumes that input comes from the terminal keyboard
  649. and that output goes to the terminal screen. To illustrate typical command
  650. input and output, enter:
  651.  
  652.  
  653.    <cat>
  654.  
  655.  
  656.    This command now expects input from your keyboard. It accepts as many
  657. lines of input as you enter, until you press Ctrl-d, which is the "end-of-
  658. file" or "end-of-transmission" indicator.
  659.  
  660.    For example, enter:
  661.  
  662.  
  663.                         this is two lines RETURN
  664.                         of input RETURN
  665.                         Ctrl-d
  666.  
  667.  
  668.    The <cat> command immediately outputs each line as you enter it. Since
  669. output is sent to the terminal screen by default, that is where the lines
  670. are sent. Thus, the complete session will look like this on your terminal
  671. screen:
  672.  
  673.  
  674.               $ cat
  675.               this is two lines
  676.               this is two lines
  677.               of input
  678.               of input
  679.               $
  680.  
  681.  
  682.    The flow of command input and output can be "redirected" so that input
  683. comes from a file instead of from the terminal keyboard and output goes to a
  684. file or lineprinter, instead of to the terminal screen. In addition, you can
  685. create "pipes" to use the output of one command as the input of another.
  686. (Redirection and pipes are discussed in the next two subsections.)
  687.  
  688. ===============================================================================
  689. 2.6.1 Redirection                                             2.6.1 Redirection
  690. ===============================================================================
  691.  
  692.    In XENIX, a file can replace the terminal for either input or output. For
  693. example, the following command displays a list of files on your terminal
  694. screen:
  695.  
  696.  
  697.    <lc>
  698.  
  699.  
  700.    But if you enter the following command, a list of your files is placed in
  701. the file [filelist] (which is created if it does not already exist), rather
  702. than sent to the screen:
  703.  
  704.  
  705.    <lc > filelist>
  706.  
  707.  
  708.    The symbol for output redirection, the greater-than sign (>), means "put
  709. the output from the command into the following file, rather than display it
  710. on the terminal screen." The following command is another way of using the
  711. output redirection mechanism:
  712.  
  713.  
  714.    <cat f1 f2 f3 > temp>
  715.  
  716.  
  717.    This command places copies of several files in the file [temp] by 
  718. redirecting the output of <cat> to that file.
  719.  
  720.    The output append symbol (>>) works very much like the output redirection
  721. symbol, except that it means "add to the end of." The following command means
  722. "concatenate [file1], [file2], and [file3] to the end of whatever is already
  723. in [temp], instead of overwriting and destroying the existing contents."
  724.  
  725.  
  726.    <cat file1 file2 file3 >> temp>
  727.  
  728.  
  729.    As with normal output redirection, if [temp] doesn't already exist, it is
  730. created for you.
  731.  
  732.    In a similar way, the input redirection symbol (<> means "take the input
  733. for a program from the following file, instead of from the terminal." As an
  734. example, you could enter the following command to send a file named
  735. [letter.txt] to several people using the XENIX <mail> facility:
  736.  
  737.  
  738.    <mail adam eve mary joe < letter.txt>
  739.  
  740.  
  741.    (See Chapter 6 of this tutorial for information on <mail>.)
  742.  
  743. ===============================================================================
  744. 2.6.2 Pipes                                                         2.6.2 Pipes
  745. ===============================================================================
  746.  
  747.    One of the major innovations of the XENIX system is the concept of a
  748. "pipe." A pipe is simply a way to use the output of one command as the input
  749. of another, so that the two run as a sequence of commands called a "pipeline".
  750.  
  751.    For example, suppose that you want to find all unique lines in [frank.txt],
  752. [george.txt], and [hank.txt] and view the result. You could enter the following
  753. sequence of commands:
  754.  
  755.  
  756.                 <sort frank.txt george.txt hank.txt > temp1>
  757.                 <uniq < temp1 > temp2>
  758.                 <more temp2>
  759.                 <rm temp1 temp2>
  760.  
  761.  
  762.    But this is more work than necessary. What you want is to take the out-
  763. put of <sort> and connect it to the input of <uniq>, then take the output
  764. of <uniq> and connect it to <more>. You would use the following pipe:
  765.  
  766.  
  767.    <sort frank.txt george.txt hank.txt | uniq | more>
  768.  
  769.  
  770.    The vertical bar character (|) is used between the <sort> and <uniq>
  771. commands to indicate that the output from <sort>, which would normally have
  772. been sent to the terminal, is to be used as the input of the <uniq> command,
  773. which in turn sends its output to the <more> command for viewing.
  774.  
  775.    The following command is another example of a pipe. The <wc> command
  776. counts the number of lines, words, and characters in its input. The <who>
  777. command prints a list of users currently logged on, one per line. Thus, the
  778. following pipeline tells you the number of users who are logged in by counting
  779. the number of lines that come from the <who> command:
  780.  
  781.  
  782.    <who | wc -l>
  783.  
  784.  
  785.    Notice the difference in output between <wc -l> and <wc>. By default, <wc>
  786. tells you how many lines, words, and characters there are in the input. How-
  787. ever, <wc -l> tells you only how many lines.
  788.  
  789.    Any program that accepts input from the keyboard can accept input from a
  790. pipe instead. Any program that displays output to the terminal screen can
  791. send input to a pipe. You can have as many elements in a pipeline as you wish.
  792.  
  793.  _____________________________________________________________________________
  794.  
  795.  
  796.  4. RECOMMENDED
  797.  --------------
  798.  This section is included in every issue of The European Digest and will
  799.  contain recommended stuff/boards/reading and so on. For this file, TV
  800.  series.
  801.  
  802.  SERIE/NAME                           WHY?
  803.  ------------------------------------ --------------------------------------
  804.  Parker Lewis Can't Lose              Real Cool. The only minus is the moral
  805.                                       at the end of each episode (as with
  806.                                       ALL American series). TOTAL COOLNESS!
  807.  
  808.  Wiseguy                              Tough Drama/Action series with a lot
  809.                                       of political stuff. Like any Cop-
  810.                                       series, only higher up the ladder.
  811.  
  812.  Murphy Brown                         Candice Bergen's Comedy Success.
  813.                                       TV station comedy, always with some
  814.                                       great intro-music, and with the
  815.                                       Youngest producer, Miles. (laughter)
  816.  
  817.  21 Jump Street                       Young cops, infiltrating clubs, gangs,
  818.                                       and so on. A lot of action and moral.
  819.                                       Still a good 'Cop' series.
  820.  
  821.  Hardball                             Well.. Just started here in Sweden,
  822.                                       and so far, not so good. It's the
  823.                                       basic odd-pair cop-show really.
  824.  
  825.  The Simpsons                         The Cult (still) series. I give 10
  826.                                       points out of ten to the first 20
  827.                                       episodes. Since then I'll give it
  828.                                       a 7. Kid-Anarchy type-o.
  829.  ---------------------------------------------------------------------------
  830.  
  831.  
  832.  5. END COMMENTS
  833.  ---------------
  834.  Rumors say that the European Amiga-Warez Scene's Blue Boxing is finally
  835.  dead. I guess some of them found out 'the hard way'. Ok, this doesn't 
  836.  belong in this issue of TED, but it's news now, and not when the next
  837.  TED in released.
  838.  
  839.  The European Digest will not feature Hacking techniques, Phreaking, Carding,
  840.  information about government systems or the basic underground rap. It will 
  841.  be different. It IS different. Manuals, The Underground Scene, Deep Deep
  842.  whatever, and so on. Less 'general rag stuff' and More Miscellaneous stuff.
  843.  Swedish Hacker News will be presented through the 'uXu - Swedish News' series,
  844.  but ONLY in Swedish. English translations will however be published in other
  845.  well-known underground rags, as contributions.
  846.  
  847.  Check out the Next TED for something Completely different!
  848.  
  849.  You can reach me on the following boards for comments, contributions,
  850.  questions or whatever:
  851.  
  852.  Condemned Reality        [618-397-7702]
  853.  Land Of Karrus           [215-948-2132]
  854.  Demon Roach Underground  [806-794-4362]
  855.  Balanced pH              [818-783-5320]
  856.  Info Addict              [+46-###-####]
  857.  
  858.  
  859.  The Chief 1991
  860.  
  861.  %&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&
  862.  %                                                                          %
  863.  &  "Congress shall make no law respecting an establishment of religion, or &
  864.  %  prohibiting the free exercise thereof; or abridging the freedom of      %
  865.  &  speech or of the press; or of the right of the people peaceably to      &
  866.  %  assemble, and to petition the Government for a redress of grievances."  %
  867.  &                                                                          &
  868.  %  This work is released according to the above Constitutional rights      %
  869.  &  for INFORMATIONAL PURPOSES ONLY.                                        &
  870.  %                                                                          %
  871.  &%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%
  872.  
  873.  ____________________________________________________________________________
  874.  ____________________________________________________________________________
  875.