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

  1. ftp> get uxu-080.txt -
  2.  
  3. <><><><><><><><><><><><><><><><><><><>!<><><><><><><><><><><><><><><><><><><><>
  4. #%       ..uXu..                                                   1992      %#
  5. %#                       Underground eXperts United                          #%
  6. #%                                presents...                                %#
  7. %#                                  -=*=-                                    #%
  8. #%                 The European Digest Series Vol.2 Issue #3                 %#
  9. %#        1992                  By THE CHIEF                      ..uXu..    #%
  10. <><><><><><><><><><><><><><><><><><><>!<><><><><><><><><><><><><><><><><><><><>
  11.  
  12.      SPECIAL MANUAL ISSUE    -   SCO XENIX System V TUTORIAL CHAPTER #4 PT.2
  13.  
  14.                                   Contents...
  15.  
  16.                           01.............Introduction
  17.                           02.............Contents In Chapter Four (part 2)
  18.                           03.............Xenix Tutorial Chapter Four (part 2)
  19.                           04.............Recommended
  20.                           05.............End Comments
  21.  
  22.  
  23.  
  24.  
  25.  1. INTRODUCTION
  26.  ---------------
  27.  Welcome to TED Vol.2 Issue #3 - The uXu File #80!
  28.  This is Chapter 4 of the XENIX Tutorial series, Part 2, which concludes
  29.  chapter 4, and we're only two chapters from covering the complete manual.
  30.  Alongside with this series, we're covering Digital's VMS version 5, but
  31.  we will NOT publish the complete manual-package, only those sections we
  32.  get requests about, so if you don't request it, we will not publish it,
  33.  and you can take that to the bank. Enjoy.
  34.  
  35.  
  36.  
  37.  2. CONTENTS IN CHAPTER FOUR (part 2)
  38.  ------------------------------------
  39.  
  40.  CHAPTER 4 (part 2)
  41.  
  42.  Working With Files and Directories
  43.  _________________________________________________________________________
  44.  
  45.  
  46.  SCO XENIX System V TUTORIAL
  47.  
  48.  
  49.    4.4 Printing Files
  50.  
  51.        4.4.1 Using lp           [covered in the previous part]
  52.        4.4.2 Using lp Options
  53.        4.4.3 Cancelling a Print Request
  54.        4.4.4 Finding Out the Status of a Print Request
  55.  
  56.    4.5 Working With Files
  57.  
  58.        4.5.1 Displaying File Contents
  59.        4.5.2 Deleting Files
  60.        4.5.3 Combining Files
  61.        4.5.4 Renaming Files
  62.        4.5.5 Moving Files
  63.        4.5.6 Copying Files
  64.        4.5.7 Finding Files
  65.  
  66.    4.6 Processing Text Files
  67.  
  68.        4.6.1 Comparing Files
  69.        4.6.2 Sorting Files
  70.        4.6.3 Searching for Patterns in a File
  71.        4.6.4 Counting Words, Lines and Characters
  72.  
  73.    4.7 Using File and Directory Permissions
  74.  
  75.        4.7.1 Changing File Permissions
  76.        4.7.2 Changing Directory Permissions
  77.  
  78.  
  79.  
  80.  3. XENIX TUTORIAL CHAPTER FOUR
  81.  ------------------------------
  82.  
  83. _______________________________________________________________________________
  84.  
  85. 4.4.2                          USING LP OPTIONS                           4.4.2
  86. _______________________________________________________________________________
  87.  
  88.    The <lp> command has several options that help you control the printed
  89. output. You can specify the number of copies you want printed by using the
  90. number option, <-n>. For example, to print two copies of [printfile], enter:
  91.  
  92.                             <lp printfile -n2>
  93.  
  94.    Several different printers are often attached to a single XENIX system.
  95. With the <-d> option, you can specify the printer on which your file is to
  96. be printed. To print two copies of [printfile] on a printer named [laser],
  97. enter:
  98.  
  99.                          <lp printfile -n2 -dlaser>
  100.  
  101.    Check with your system administrator for the names of the printers
  102. available on your system.
  103.  
  104.  
  105. _______________________________________________________________________________
  106.  
  107. 4.4.3                       CANCELLING A PRINT REQUEST                    4.4.3
  108. _______________________________________________________________________________
  109.  
  110.    Use the <cancel> command to cancel a print request. The <cancel> command
  111. takes as its argument the request ID. For example, to stop printing a file
  112. with a request ID of [laser-245], you would enter:
  113.  
  114.                             <cancel laser-245>
  115.  
  116.    Experiment with <cancel> by using <lp> to print [printfile] and then
  117. using <cancel> to cancel the print request. When you are finished, enter the
  118. following command to remove [printfile]:
  119.  
  120.                                <rm printfile>
  121.  
  122.    You can also use the <cancel> command to stop whatever is currently
  123. printing on a particular printer. For example, to cancel whatever file is
  124. currently printing on the printer [laser], you would enter the following
  125. command:
  126.  
  127.                                <cancel laser>
  128.  
  129.    If you cancel a file that does not belong to you, mail reporting that the
  130. print request was canceled is automatically sent to the file's owner.
  131.  
  132.  
  133. _______________________________________________________________________________
  134.  
  135. 4.4.4             FINDING OUT THE STATUS OF A PRINT REQUEST               4.4.4
  136. _______________________________________________________________________________
  137.  
  138.    Use the <lpstat> command to check on the status of your print request.
  139. To use it, simply enter the following:
  140.  
  141.                                     <lpstat>
  142.  
  143.    The <lpstat> command produces output like the following:
  144.  
  145.                   --------------------------------------------
  146.                   prt1-121      cindym     450   Dec 15  09:30
  147.                   laser-450     cindym    4968   Dec 15  09:46
  148.                   --------------------------------------------
  149.  
  150.    Note that entering <lpstat> with no options displays information on your
  151. files only, not those of other users. To generate a report for all users on
  152. your computer, use <lpstat> with the <-o> option. Nothing is displayed by the
  153. <lpstat> command if the print job is complete.
  154.  
  155.    The first column of the <lpstat> output shows the request ID for each of
  156. your files being printed. The second column is your login name. In the third
  157. column, the number of characters to be printed is shown, and the fourth
  158. column lists the dates and times the print requests were made.
  159.  
  160.    To learn the status of a particular file, use the <lpstat> command with the
  161. file's request ID. For example, to find out the status of a file with the
  162. request ID of [laser-256], you would enter the follwing command:
  163.  
  164.                                <lpstat laser-256>
  165.  
  166.    The status of that file only is displayed.
  167.  
  168.    You can also request the status of various printers on your system by
  169. using the <-p> option or by giving the name of the particular printer you
  170. are interested in. Enter the following command to find out the status of all
  171. the printers on your system:
  172.  
  173.                                   <lpstat -p>
  174.  
  175.    To find out the status of a printer named [laser], you would enter the
  176. following:
  177.  
  178.                                 <lpstat -plaser>
  179.  
  180.    The request ID and status information for each file currently waiting
  181. to be printed on [laser] is displayed.
  182.  
  183.  
  184. _______________________________________________________________________________
  185.  
  186. 4.5                            WORKING WITH FILES                           4.5
  187. _______________________________________________________________________________
  188.  
  189.    File manipulation (creating, deleting, displaying, combining, renaming,
  190. moving, and copying) is one of the most important capabilities an operating
  191. system provides. The XENIX commands that perform these functions are described
  192. in the following sections.
  193.  
  194.  
  195. _______________________________________________________________________________
  196.  
  197. 4.5.1                       DISPLAYING FILE CONTENTS                      4.5.1
  198. _______________________________________________________________________________
  199.  
  200.    The <more> command displays the contents of a file, one screenful at a
  201. time. It cannot be used to edit files. If the file contains more than one
  202. screenful of data, you see the following prompt after each screen of text
  203. is displayed:
  204.  
  205.                                 --More--(XX%)
  206.  
  207.    XX% represents the percentage of the file displayed. Press the RETURN
  208. key to display another line. Press the SPACEBAR to display another screen.
  209.  
  210.    Try the follwing command:
  211.  
  212.                                <more /etc/rc>
  213.  
  214.    This causes the contents of [/etc/rc] to display on the screen. To quit
  215. <more> before [/etc/rc] is finished displaying, press [q] for quit.
  216.  
  217.    The <more> command does not allow you to scroll backward, towards the
  218. beginning of the file. However, you can search forward for patterns with
  219. <more> by using the slash (/) command. For example, enter the following
  220. commands to search for a line containing "process" in [/etc/rc]:
  221.  
  222.                                 <more /etc/rc>
  223.                                 </process>
  224.  
  225.    You see the following message at the top of the screen:
  226.  
  227.                       --------------------------------
  228.                       ...skipping
  229.                       --------------------------------
  230.  
  231.    If the pattern is found, it is displayed two lines below this message.
  232. If the pattern is not found, "Pattern not found" is displayed.
  233.  
  234.    If you are looking at a file with <more> and decide that you want to
  235. edit the file, you can invoke the <vi> editor by pressing [v]. Of course,
  236. you must have write permission on a file before you can edit it with <vi>
  237. or any other text editor. To display the file's contents, you only need
  238. read permission.
  239.  
  240.    You will often use <more> in pipes. For example, <more> is useful when
  241. you want to list the contents of a directory in long format. Enter the
  242. following command to display a long listing of the contents of [/bin], one
  243. screenful at a time:
  244.  
  245.                              <l /bin | more>
  246.  
  247.    (For more information on pipes, refer to Chapter 2 of this tutorial)
  248.  
  249.    The <head> and <tail> commands, display the beginning and the end of
  250. a file, respectively. With no options, they display the first or last 10
  251. lines. Enter the following command to display the last 10 lines of [/etc/rc]:
  252.  
  253.                               <tail /etc/rc>
  254.  
  255.    You can specify exactly how many lines you want displayed. Enter the
  256. following command to display the first 20 lines of [/etc/rc]:
  257.  
  258.                              <head -20 /etc/rc>
  259.  
  260.    Enter the following command to display the last 20 lines of [/etc/rc]:
  261.  
  262.                              <tail -20 /etc/rc>
  263.  
  264.    The <cat> command also displays the contents of a file. Unlike <more>,
  265. <cat> continuously scrolls the file until you stop the scroll with CTRL-S.
  266. CTRL-Q continues scrolling. Scrolling stops automatically when the end of
  267. the file is reached. To stop scrolling before the end of the file, press
  268. INTERRUPT, which is the DEL key on most keyboards.
  269.  
  270.    Enter the following command to display the contents of [/etc/termcap].
  271. Use CTRL-S and CTRL-Q to stop and start the scrolling and INTERRUPT to halt
  272. the scrolling before the end of the file is reached:
  273.  
  274.                               <cat /etc/termcap>
  275.  
  276. _______________________________________________________________________________
  277.  
  278. 4.5.2                           DELETING FILES                            4.5.2
  279. _______________________________________________________________________________
  280.  
  281.    The <rm> command is used to delete files. We have used it throughout this
  282. chapter to delete various files. Use <cd> to change to your home directory
  283. and enter the following command to create three new files:
  284.  
  285.                    <touch tempfile1 tempfile2 tempfile3>
  286.  
  287.    Delete [tempfile3] by entering the following command:
  288.  
  289.                                  <rm tempfile3>
  290.  
  291.    The <-i> option allows you to remove files interactively by asking you
  292. if you really want to delete each of the files specified on the command
  293. line. If you press [y] followed by a RETURN, the given file is removed.
  294. If you press [n], the file is left untouched. This option is useful when
  295. removing files from a directory that contains many files. It helps you
  296. avoid erasing files accidentally that you really want to keep.
  297.  
  298.    Experiment with the <-i> option by entering the following command:
  299.  
  300.                          <rm -i tempfile1 tempfile2>
  301.  
  302.    Note that you can place several filenames on the <rm> command line. This
  303. is true for most XENIX commands. You can also use wildcard characters. For
  304. example, instead of entering the above command, you could enter the
  305. following:
  306.  
  307.                              <rm -i tempfile*>
  308.  
  309.    (The use of wildcard characters on the XENIX command line is discussed
  310. in Chapter 2 of this tutorial.)
  311.  
  312.  
  313. _______________________________________________________________________________
  314.  
  315. 4.5.3                           COMBINING FILES                           4.5.3
  316. _______________________________________________________________________________
  317.  
  318.    In addition to displaying files, the <cat> command can be used to combine
  319. several existing files into a single new file. This is done by redirecting
  320. the output of <cat> into a new file. The greater-than sign (>) is used for
  321. redirection. If the new file does not exist, it is created automatically.
  322. (If you are not familiar with redirection, see Chapter 2 of this tutorial.)
  323.  
  324.    Use <cd> to move to your home directory and enter the following command
  325. to combine [/etc/motd] and [/etc/rc] into a file named [catfile]:
  326.  
  327.                      <cat /etc/motd /etc/rc > catfile>
  328.  
  329.    Now display the contents of the new file [catfile] with the <more>
  330. command:
  331.  
  332.                               <more catfile>
  333.  
  334.    The symbol >> can be used with <cat> to append one file to the end of
  335. another file. For example, to append the contents of [/etc/motd] to [catfile],
  336. enter the following command:
  337.  
  338.                          <cat /etc/motd >> catfile>
  339.  
  340.    The contents of [/etc/motd] should now be placed at the beginning and
  341. at the end of [catfile]. Verify this with the following <head> and <tail>
  342. commands:
  343.  
  344.                              <head -20 catfile>
  345.                              <tail -20 catfile>
  346.  
  347.  
  348. _______________________________________________________________________________
  349.  
  350. 4.5.4                           RENAMING FILES                            4.5.4
  351. _______________________________________________________________________________
  352.  
  353.    The <mv> command is used to move files around the XENIX filesystem and
  354. also to rename files. Use <cd> to move to your home directory. Rename
  355. [catfile], created in section 4.5.3, to [catfile2], by entering the following
  356. command:
  357.  
  358.                               <mv catfile catfile2>
  359.  
  360.    After this move is completed, [catfile] no longer exists. The file
  361. [catfile2] exists in its place. Verify this by entering the following
  362. command:
  363.  
  364.                                      <lc>
  365.  
  366.  
  367. _______________________________________________________________________________
  368.  
  369. 4.5.5                            MOVING FILES                             4.5.5
  370. _______________________________________________________________________________
  371.  
  372.    To move a file into another directory, give the name of the destination
  373. directory as the final name on the <mv> command. You do not need to specify
  374. the destination filename. For example, enter the following command to move
  375. [catfile2], created in section 4.5.4, to the [/tmp] directory:
  376.  
  377.                            <mv $HOME/catfile2 /tmp>
  378.  
  379.    To be sure that [catfile2] is in [/tmp] and not in the current directory,
  380. enter the following command:
  381.  
  382.                                   <lc . /tmp>
  383.  
  384.    (Remember that you can enter more than one argument on most XENIX
  385. command lines, and that the dot (.) stands for the current directory.)
  386.  
  387.    Finally, move [catfile2] back to the current directory by entering the
  388. following command:
  389.  
  390.                              <mv /tmp/catfile2 .>
  391.  
  392.    The <mv> command always checks to see if the last argument is the name
  393. of a directory. If it is, all files designated by filename arguments are
  394. moved into that directory. However, if you do not have write permission on
  395. the directory to which you are attempting to move files, the move fails.
  396.  
  397.  
  398. _______________________________________________________________________________
  399.  
  400. 4.5.6                            COPYING FILES                            4.5.6
  401. _______________________________________________________________________________
  402.  
  403.    The <cp> command is used to copy files. There are two forms of the <cp>
  404. command, one in which files are copied into a directory and another in which
  405. a file is copied to another file.
  406.  
  407.    Use <cd> to change to your home directory. Then enter the following command
  408. to copy the contents of [catfile2], created in section 4.5.4, to [catfile3]:
  409.  
  410.                             <cp catfile2 catfile3>
  411.  
  412.    You now have two files with identical contents. To copy [catfile2] and
  413. [catfile3] to the [/tmp] directory, enter the following command:
  414.  
  415.                            <cp catfile2 catfile3 /tmp>
  416.  
  417.    This last command can be simplified by using a wildcard character:
  418.  
  419.                               <cp catfile* /tmp>
  420.  
  421.    Like the <mv> command, <cp> always checks to see if the last argument
  422. is the name of a directory, and, if so, all files designated by filename
  423. arguments are copied into that directory. However, unlike the <mv> command,
  424. <cp> leaves the original file untouched. There should now be two copies of
  425. [catfile2] and [catfile3] on the system, one copy of each in the current
  426. directory and one copy of each in [/tmp].
  427.  
  428.  
  429. _______________________________________________________________________________
  430.  
  431. 4.5.7                            FINDING FILES                            4.5.7
  432. _______________________________________________________________________________
  433.  
  434.    A XENIX filesystem can contain thousands of files. Because of this,
  435. files can often get lost. The <find> command is used to search the file-
  436. system for files. The command has the form:
  437.  
  438.                     <find pathname -name filename -print>
  439.  
  440.    The pathname is the pathname of the directory that you want to search.
  441. The search is recursive; it starts at the directory named and searches
  442. downward through all files and subdirectories under the named directory.
  443.  
  444.    The <-name> option indicates that you are searching for files that have
  445. a specific filename. The <-print> option indicates that you want to print
  446. that pathnames of all the files that match [filename] on your screen.
  447.  
  448.    Enter the following command to search all directories and subdirectories
  449. for [catfile2], the file created in section 4.5.4:
  450.  
  451.                       <find / -name catfile2 -print>
  452.  
  453.    It may take a few minutes for this command to finish executing. The
  454. output of this <find> command should indicate that there are at least two
  455. occurrences of [catfile2], one in [/tmp] and one in your home directory.
  456. Remove [catfile2] and [catfile3] from [/tmp] and from your home directory
  457. by entering the following command:
  458.  
  459.                      <rm /tmp/catfile* $HOME/catfile*>
  460.  
  461.  
  462. _______________________________________________________________________________
  463.  
  464. 4.6                            PROCESSING TEXT FILES                        4.6
  465. _______________________________________________________________________________
  466.  
  467.    XENIX includes a set of utilities that let you process information in
  468. text files. These utilities enable you to compare the contents of two files,
  469. sort files, search for patterns in files, and count the characters, words,
  470. and lines in files. These utilities are described below.
  471.  
  472.  
  473. _______________________________________________________________________________
  474.  
  475. 4.6.1                           COMPARING FILES                           4.6.1
  476. _______________________________________________________________________________
  477.  
  478.    The <diff> command allows you to compare the contents of two files and
  479. to print out those lines that differ between the files. To experiment with
  480. <diff>, use <vi> to create two files to compare. The files will me [men] and
  481. [women]. First <cd> to your home directory. Then enter the following command
  482. at the XENIX prompt:
  483.  
  484.                                    <vi men>
  485.  
  486.    When you are placed in <vi>, press the [i] key to enter Insert Mode, 
  487. and then type the following lines:
  488.  
  489.                       Now is the time for all good men to
  490.                       Come to the aid of their party.
  491.  
  492.    Press ESC to return to Command mode and save [men] by entering [:w].
  493.    While still in Command mode, enter the following command to create
  494.    [women]:
  495.  
  496.                                  <:n women>
  497.  
  498.    You see the following message:
  499.  
  500.                       ---------------------------------
  501.                       "women" No such file or directory
  502.                       ---------------------------------
  503.  
  504.    You are then placed in [women]. Press [i] to enter Insert mode and then
  505. enter the following lines:
  506.  
  507.                      Now is the time for all good women to
  508.                      Come to the aid of their party.
  509.  
  510.    Press ESC to return to Command mode, then [:x] to save [women] and
  511. leave <vi>. You have now created [men] and [women].
  512.  
  513.    Enter the following command to compare the the contents of these two
  514. files:
  515.  
  516.                              <diff men women>
  517.  
  518.    This <diff> command should produce the following output:
  519.  
  520.                    -------------------------------------
  521.                    1c1
  522.                    <Now is the time for all good men to
  523.                    ---
  524.                    >Now is the time for all good women to
  525.                    --------------------------------------
  526.  
  527.    The lines displayed are the lines that differ from one another in the
  528. two files.
  529.                
  530.  
  531. _______________________________________________________________________________
  532.  
  533. 4.6.2                            SORTING FILES                            4.6.2
  534. _______________________________________________________________________________
  535.  
  536.    One of the most useful file processing commands is <sort>. When used
  537. without options, <sort> alphabetizes lines in a file, starting with the
  538. leftmost character of each line. These sorted lines are then output to
  539. the screen, or to a file if redirection is used on the <sort> command
  540. line. This command does not affect the contents of the actual file.
  541.  
  542.    Enter the following command to display an alphabetized list of all
  543. users who have system accounts:
  544.  
  545.                              <sort /etc/passwd>
  546.  
  547.    The <sort> command is useful in pipes. Enter the following command to
  548. display an alphabetized list of users who are currently using the system:
  549.  
  550.                                 <who | sort>
  551.  
  552.  
  553. _______________________________________________________________________________
  554.  
  555. 4.6.3                 SEARCHING FOR PATTERNS IN A FILE                    4.6.3
  556. _______________________________________________________________________________
  557.  
  558.    The <grep> command selects and extracts lines from a file, printing only
  559. those lines that match a given pattern. Enter the following command to print
  560. out the lines in [/etc/passwd] that contain your login information. There
  561. will probably be only one such line:
  562.  
  563.                              <grep login /etc/passwd>
  564.  
  565.    Be sure to replace [login] in this command with your login name. Your
  566. output should be similar to the following:
  567.  
  568.       -----------------------------------------------------------------
  569.       markt:0V/wE/utnUkpc:6005:104:Mark Taub, Docland:/u/markt:/bin/csh
  570.       -----------------------------------------------------------------
  571.  
  572.    Note that whenever wildcard characters are used to specify a <grep>
  573. search pattern, the pattern should be enclosed in single quotation marks
  574. ('). Note also that the search pattern is case sensitive. Searching for
  575. "joe" will not yield lines containing "Joe".
  576.  
  577.    As another example, assume that you have a file named [phonelist]
  578. that contains a name followed by a phone number on each line. Assume also
  579. that there are several thousand lines in this list. You can use <grep>
  580. to find the phone number of someone named Joe, whose phone number prefix
  581. is 822, by entering the following command:
  582.  
  583.             <grep 'Joe' phonelist | grep '822-' > joes.number>
  584.  
  585.    The <grep> utility first finds all occurrences of lines containing the
  586. word "Joe" in the file [phonelist]. The output from this command is then
  587. filtered through another <grep> command, which searches for an "822-"
  588. prefix, thus removing any unwanted "Joes." Finally, assuming that a
  589. unique phone number for Joe exists with the "822-" prefix, that name and
  590. number are placed in a the file [joes.number].
  591.  
  592.    Two other pattern searching utilities are available with XENIX. These
  593. are <egrep> and <fgrep>. Refer to <grep(C)> in the XENIX User's Reference
  594. for more information on these utilities.
  595.  
  596.  
  597. _______________________________________________________________________________
  598.  
  599. 4.6.4                COUNTING WORDS, LINES, AND CHARACTERS                4.6.4
  600. _______________________________________________________________________________
  601.  
  602.    The <wc> utility is used to count words in a file. Words are presumed to
  603. be separated by punctuation, spaces, tabs, or newlines. In addition to
  604. counting words, <wc> counts characters and lines.
  605.  
  606.    Use <cd> to change to your home directory. Then enter the following
  607. command to count the lines, words, and characters in the file [men], created
  608. in section 4.6.1:
  609.  
  610.                                    <wc men>
  611.  
  612.    The output from this command should be the following:
  613.  
  614.                           -------------------------
  615.                           2     16    68 men
  616.                           -------------------------
  617.  
  618.    The first number is the number of lines in [men], the second number is
  619. the number of words and the third number is the number of characters. Remove
  620. [men] and [women] by entering the following command:
  621.  
  622.                                   <rm *men>
  623.  
  624.    To specify a count of characters, words, or lines only, you must use
  625. the <-c>, <-w>, or <-l> option, respectively. For example, enter the following
  626. command to count the number of users currently logged onto the system:
  627.  
  628.                                 <who | wc -l>
  629.  
  630.    The <who> command reports on who is using the system, one user per line.
  631. The <wc -l> command counts the number of lines reported by the <who> command.
  632. This is the number of users currently on the system.
  633.  
  634.  
  635. _______________________________________________________________________________
  636.  
  637. 4.7                   USING FILE AND DIRECTORY PERMISSIONS                  4.7
  638. _______________________________________________________________________________
  639.  
  640.    The XENIX system allows the owner of a file or directory to restrict
  641. access to that file or directory. This is done with permission settings.
  642. Permissions on a file limit who can read, write and/or execute the files.
  643. Permissions on a directory limit who can <cd> to the directory, list the
  644. contents of the directory, and create and delete files in the directory.
  645.  
  646.    To determine the permissions associated with a given file or directory,
  647. use the <l> command. Use <cd> to change to your home directory and then
  648. enter <l> to get a long listing of the files in this directory.
  649.  
  650.    Permissions are indicated by the first 10 characters of the output of
  651. the <l> command. The first character indicates the type of file and must
  652. be one of the following:
  653.  
  654.  
  655.                 -           Indicates an ordinary file.
  656.  
  657.                 b           Indicates a block special device such as a
  658.                             hard or floppy disk. Hard and floppy disks
  659.                             can be treated as both block and character
  660.                             special devices.
  661.  
  662.                 c           Indicates a character special device such as
  663.                             a lineprinter or terminal.
  664.  
  665.                 d           Indicates a directory.
  666.  
  667.                 m           Indicates a shared data file.
  668.  
  669.                 n           Indicates a name special file.
  670.  
  671.                 p           Indicates a named pipe.
  672.  
  673.                 s           Indicates a semaphore.
  674.  
  675.  
  676.    From left to right, the next nine characters are interpreted as three
  677. sets of three permissions. Each set of three indicates the following
  678. permissions:
  679.  
  680.  
  681.                 *    Owner permissions,
  682.  
  683.                 *    Group permissions, and
  684.  
  685.                 *    All other user permissions.
  686.  
  687.  
  688.    Within each set, the three characters indicate permission to read, to
  689. write, and to execute the file as a command, respectively. For a directory,
  690. "execute" permission means permission to search the directory for any files
  691. or directories.
  692.  
  693.    Ordinary file permissions have the following meanings:
  694.  
  695.  
  696.                  r      The file is readable.
  697.  
  698.                  w      The file is writable.
  699.  
  700.                  x      The file is executable.
  701.  
  702.                  -      The permission is not granted.
  703.  
  704.  
  705.    For directories, permissions have the following meanings:
  706.  
  707.  
  708.                  r      Files can be listed in the directory; the directory
  709.                         must also have "x" permission.
  710.  
  711.                  w      Files can be created or deleted in the directory.
  712.                         As with "r", the directory itself must also have
  713.                         "x" permission.
  714.  
  715.                  x      The directory can be searched. A directory must
  716.                         have "x" permission before you can move to it with
  717.                         the <cd> command, access a file within it, or list
  718.                         the files in it. Remember that a user must have "x"
  719.                         permission to do anything useful to the directory.
  720.  
  721.  
  722.    The following are some typical directory permission combinations:
  723.  
  724.  
  725.           d--------     No access at all. This is the mode that denies 
  726.                         access to the directory to all users but the
  727.                         superuser.
  728.  
  729.           drwx-----     Limits access to the owner. The owner can list the
  730.                         contents of this directory and the files in it (if
  731.                         they have appropriate permissions), <cd> to the
  732.                         directory, and add files to, and delete files from,
  733.                         the directory. This is the typical permission for
  734.                         the owner of a directory.
  735.  
  736.           drwxr-x---    In addition to allowing the owner all of the above
  737.                         access permissions, this setting allows group members
  738.                         to list the contents of this directory and files within
  739.                         it and to <cd> to this directory. However, group
  740.                         members cannot create files in, or delete files from,
  741.                         this directory. This is the typical permission an
  742.                         owner gives to others who need access to files in
  743.                         his or her directory.
  744.  
  745.           drwxr-x--x    In addition to allowing the owner and the group all
  746.                         of the above access permissions, this setting allows
  747.                         users other than the owner or members of the group
  748.                         to <cd> to this directory. However, because the <r>
  749.                         is not set for others, other users cannot list the
  750.                         contents of this directory with any of the <ls>
  751.                         commands. This mode is rarely used, but it can be
  752.                         useful if you want to give someone access to a specific
  753.                         file in a directory without revealing the presence of
  754.                         other files in the directory.
  755.  
  756.  
  757.    The [/etc] directory contains files whose permissions vary. Examine the
  758. permissions of the files in this directory by entering the following command:
  759.  
  760.                              <l /etc | more>
  761.  
  762.  
  763. _______________________________________________________________________________
  764.  
  765. 4.7.1                       CHANGING FILE PERMISSIONS                     4.7.1
  766. _______________________________________________________________________________
  767.  
  768.    The <chmod> command changes the read, write, execute, and search permis-
  769. sions of a file or directory. It has the form:
  770.  
  771.                         <chmod instruction filename>
  772.  
  773.    The instruction argument indicates which permissions you want to change
  774. for which class of users. There are three classes of users, and three levels
  775. of permissions. The users are specified as follows:
  776.  
  777.  
  778.        u              User, the owner of the file or directory.
  779.  
  780.        g              Group, the group the owner of the file belongs to.
  781.  
  782.        o              Other, all users of the system who are not in u or g.
  783.  
  784.        a              All users of the system.
  785.  
  786.  
  787.    The permissions are specified as follows:
  788.  
  789.  
  790.        r              Read, which allows permitted users to look at but not
  791.                       change or delete the file.
  792.  
  793.        w              Write, which allows permitted users to change or even
  794.                       delete the file.
  795.  
  796.        x              Execute, which allows permitted users to execute the
  797.                       file as a command.
  798.  
  799.  
  800.    Use <cd> to move to your home directory. Then enter the following command
  801. to create [tempfile]:
  802.  
  803.                              <touch tempfile>
  804.  
  805.    The permissions on [tempfile] are probably:
  806.  
  807.                                 -rw-r--r--
  808.  
  809.    Verify this by entering the following command:
  810.  
  811.                                <l tempfile>
  812.  
  813.    Enter the following command to give yourself (the file's owner) execute
  814. permissions on [tempfile]:
  815.  
  816.                            <chmod u+x tempfile>
  817.  
  818.    Verify the permissions change with the <l> command. (Of course, since
  819. [tempfile] is neither a binary nor a script, having execute permission on
  820. it is meaningless.)
  821.  
  822.    Enter the following command to give the group and other users write
  823. permission on [tempfile]:
  824.  
  825.                             <chmod go+w tempfile>
  826.  
  827.    Verify the permissions change with the <l> command.
  828.  
  829.    The <chmod> command also allows you to remove permissions. For example,
  830. enter the following command to prohibit others from writing to [tempfile]:
  831.  
  832.                              <chmod o-w tempfile>
  833.  
  834.    Remove [tempfile] with the following command:
  835.  
  836.                                 <rm tempfile>
  837.  
  838.  
  839. _______________________________________________________________________________
  840.  
  841. 4.7.2                     CHANGING DIRECTORY PERMISSIONS                  4.7.2
  842. _______________________________________________________________________________
  843.  
  844.    Directories also have an execute permission, even though they cannot be
  845. executed in the same way that a script or binary file can. For directories,
  846. the execute attribute is needed in order to do any useful work in a directory.
  847. Users who do not have execute permission for a directory cannot <cd> to the
  848. directory, list the names of files in the directory, or copy files to or from
  849. the directory.
  850.  
  851.    The permissions on your home directory are probably set to the following:
  852.  
  853.                                   drwxr-xr-x
  854.  
  855.    Verify this by entering the following command:
  856.  
  857.                                  <l -d $HOME>
  858.  
  859.    You probably see output like the following:
  860.  
  861.            --------------------------------------------------------
  862.            drwxr-xr-x  4 markt   pub     240 Feb 10 09:09  /u/markt
  863.            --------------------------------------------------------
  864.  
  865.    This setting allows you, the directory's owner, to <cd> to the directory,
  866. to list the contents of the directory and of the files within it (if the file
  867. permissions also allow), and to create and delete files in the directory. This
  868. setting also allows members of the group and other users to <cd> to the
  869. directory, to list the directory's contents and also the contents of files
  870. within the directory, if file permissions allow.
  871.  
  872.    To deny any useful access to others, enter the following command:
  873.  
  874.                                <chmod o-x $HOME>
  875.  
  876.    Verify that the permissions were changed with the following command:
  877.  
  878.                                   <l -d $HOME>
  879.  
  880.    Your output should look like the following:
  881.  
  882.            --------------------------------------------------------
  883.            drwxr-xr--  4 markt   pub     240 Feb 10 09:09  /u/markt
  884.            --------------------------------------------------------
  885.  
  886.    Now, only you and the members of the group have access to your directory.
  887. If you want to restore access to your home directory to other users, enter the
  888. following command:
  889.  
  890.                                 <chmod o+x $HOME>
  891.  
  892.  
  893. _______________________________________________________________________________
  894.  
  895.  4. RECOMMENDED
  896.  --------------
  897.  This section is included in every issue of The European Digest and will
  898.  contain recommended stuff/boards/reading and so on. For this file,
  899.  some currently popular drinks;
  900.  
  901.  
  902.         B-52                   ----------  1/3 Kahlua
  903.                                            1/3 Bailey's
  904.                                            1/3 Grand Marnier
  905.  
  906.         Burning B-52           ----------  (set the above on fire)
  907.  
  908.         Brain                  ----------  1/2 Bailey's
  909.                                            1/2 Schnapps
  910.                                            (in a shot-glass)
  911.  
  912.         Orgasm                 ----------  1 1/2 oz Vodka
  913.                                            1 1/2 oz Triple sec
  914.                                            Splash of Rose's Lime Juice
  915.                                            Fill up with Soda Water,
  916.                                            7-Up or Sprite
  917.  
  918.         Screaming Orgasm       ----------  Pour as much Galliano as
  919.                                            possible in a spoon, and
  920.                                            add to the above.
  921.  
  922.         Woo-Woo                ----------  Ice
  923.                                            2 oz Vodka
  924.                                            1 oz Peachschnapps
  925.                                            Fill up with Cranberry Juice
  926.  
  927.  
  928.  5. END COMMENTS
  929.  ---------------
  930.  The European Digest will NOT cover european news. We have started a new
  931.  series in Swedish, with such news, which will be released on the last day
  932.  every month. So, we'll stick to this format.
  933.  
  934.  The European Digest will not feature Hacking techniques, Phreaking, Carding,
  935.  information about government systems or the basic underground rap. It will 
  936.  be different. It IS different. Manuals, The Underground Scene, Deep Deep
  937.  whatever, and so on. Less 'general rag stuff' and More Miscellaneous stuff.
  938.  Swedish Hacker News will be presented through the 'uXu - Swedish News' series,
  939.  but ONLY in Swedish. English translations will however be published in future
  940.  issues of the well-known underground rag, Phrack Inc.
  941.  
  942.  Check out the Next TED for another issue! (no kiddin'?)
  943.  
  944.  You can reach me on the following boards for comments, contributions,
  945.  questions or whatever:
  946.  
  947.  Ripco ][                 [312-528-5020]
  948.  Condemned Reality        [618-397-7702]
  949.  Demon Roach Underground  [806-794-4362]
  950.  Solsbury Hill            [301-428-3268]
  951.  Anonymous                [+45-981-89771]
  952.  The Stash                [+46-13-175042]
  953.  Sedes Diaboli            [+46-586-43766]
  954.  
  955.  You can't reach me on the following boards anymore. Reason(s) stated below.
  956.  
  957.  Balanced pH              [818] Down
  958.  Land Of Karrus           [215] Down
  959.  Lunatic Labs             [213] (ok, Sometimes)
  960.  
  961.  The Chief 1992
  962.  
  963.  %&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&
  964.  %                                                                          %
  965.  &  "Congress shall make no law respecting an establishment of religion, or &
  966.  %  prohibiting the free exercise thereof; or abridging the freedom of      %
  967.  &  speech or of the press; or of the right of the people peaceably to      &
  968.  %  assemble, and to petition the Government for a redress of grievances."  %
  969.  &                                                                          &
  970.  %  This work is released according to the above Constitutional rights      %
  971.  &  for INFORMATIONAL PURPOSES ONLY.                                        &
  972.  %                                                                          %
  973.  &%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%
  974.  
  975.  ____________________________________________________________________________
  976.  ____________________________________________________________________________
  977.