home *** CD-ROM | disk | FTP | other *** search
/ The Best Internet Programs / BESTINTERNET.bin / internet / lrn_inet / li_unix.txt < prev    next >
Encoding:
Text File  |  1994-10-05  |  7.4 KB  |  171 lines

  1.  Unix 
  2.  
  3. Most Internet host computers use Unix as their operating
  4. system, so a knowledge of certain Unix commands is essential
  5. for managing your Internet sessions and the files in your
  6. Unix home directory.  Even if your Internet provider offers
  7. a fancy graphical interface, it will not be long until you
  8. telnet to another network where you will have to work with
  9. the bare Unix prompt, so it is good to know a little Unix.
  10.  
  11. Unix is very complex, and is definitely NOT user friendly.
  12. It was written by programmers for programmers.  Nevertheless
  13. this lesson will teach you basic facts about several basic
  14. commands that you will find very valuable.
  15.  
  16.  ls - Listing Your Files 
  17.  
  18. To learn what files are in your home directory enter the
  19. command ls.  As with all Unix commands you must use lower
  20. case letters.  A list of file names, alphabetized, will
  21. appear on your screen.  Most Unix commands allow you to
  22. enter a "switch" after them, to affect the way the command
  23. works or to format it's output.  The command ls -l will 
  24. produce a "long" list of your files, showing file attributes,
  25. creation dates, file size, and name.  The dash (-) before the
  26. letter l tells Unix that this is a switch.  The command 
  27. ls -a shows "all" files, including hidden ones, in your
  28. directory.  The command ls -la shows all files in long form.
  29. The equivalent DOS command is "dir."
  30.  
  31.  cp - Copy A File 
  32.  
  33. To copy a file enter the command: cp file1 file2, where file1
  34. is the name of the file you want to copy and file2 is the name
  35. you want to assign to the copy.  After executing this command
  36. you will have two copies of the file called file1, one named
  37. file1 and one named file2.  Unix does not check to see if 
  38. another file with the name of file2 exists prior to executing
  39. this command, so be very careful.  If a file called file2 
  40. existed before executing the above command, it would be over-
  41. written with the contents of file1.  Unix also operates on the
  42. principle that "no news is good news."  It will not inform you
  43. when it successfully carries out the command.  The equivalent
  44. DOS command is "copy."
  45.  
  46.  mv - Renaming Or Moving A File 
  47.  
  48. The command mv file1 file2 will change the name of file1 to
  49. file2.  Be very careful, though.  If file2 already exists
  50. it will be overwritten with the contents of file1 and Unix
  51. will not warn you.  
  52.  
  53. The mv command is very powerful because it can be used to
  54. move files between directories also.  mv is a combination
  55. of the DOS commands "rename" (ren) and "move."
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  rm - Removing Files 
  62.  
  63. The command rm file1 will delete (remove) the file named
  64. file1.  Be extremely cautious, in Unix there is no command
  65. equivalent to the DOS undelete command.  Once your file has
  66. been deleted there is no way to get it back.  When it's gone,
  67. it's gone for good.
  68.  
  69. With copying, deleting and listing commands you may also use
  70. wildcard symbols as you would in DOS.  The "?" wildcard acts
  71. just like it does in DOS, substituting for a single character
  72. in a file name.  The "*" symbol, however, is more powerful.
  73. The command ls f* would list all files beginning with "f."
  74. The command rm * would delete all files in your directory.
  75.  
  76.  cat - Viewing A File 
  77.  
  78. To view the contents of a text file use the command cat file1,
  79. where file1 is the name of the file you want to view.  The
  80. contents of the file will scroll quickly over your screen.  If
  81. the file is longer than will fit on a single screen, use the
  82. "more" filter along with cat, like this: cat file1 |more.  The
  83. vertical bar before "more" is called the piping symbol, and 
  84. "pipes" the output of the cat command to the paging command
  85. "more."  In this case, you will see a screenful of information
  86. at a time.  Pressing the spacebar will advance to the next
  87. screen.  Pressing control-c will break out of the more filter.
  88. The cat is only for text files, not binary files.  The equiv-
  89. alent DOS command is "type."
  90.  
  91.  cd - Changing Directories 
  92. The Unix file system is similar to the DOS system (DOS stole
  93. the idea from Unix).  It uses a single root directory and a
  94. system of "tree" directories branching off from the root.
  95. The directories below a directory are called sub-directories.
  96. The equivalent Mac terminology is folders and folders within
  97. folders.  For example, your home directory may be called
  98. /pub/guests/efudd.  (Notice the Unix slashes go the opposite
  99. direction from the DOS slashes).  To change to a subdirectory
  100. called News beneath your home directory enter the command:
  101. cd News.  To change to the directory above your home directory
  102. enter: cd .., where the two dots are an abbreviation for "the
  103. directory above."  To change from the root directory to your
  104. home directory enter: cd /pub/guests/efudd.
  105.  
  106.  man - Getting Help 
  107.  
  108. There is an on-line help facility on every Unix system called
  109. man (short for manual).  To get help on any Unix command 
  110. enter: man [commandname].  For example, to get help on the ls
  111. command enter: man ls.  Be prepared for some heavy sledding,
  112. though.  The manual pages are very technical and go into pain-
  113. ful detail about the implications of every switch available to
  114. every command.  This is what you want in a technical manual,
  115. but it is not easy to get a short, simple answer to a simple
  116. question--but we warned you, Unix is not user friendly.
  117.  
  118. The equivalent DOS command is "help."
  119.  
  120.  
  121.  sz - Downloading/Uploading Files 
  122. If you dial in to Internet you will soon need to know how to
  123. get files from your Unix home directory (where they will go
  124. when you ftp them) to your home PC.  What you do is use a
  125. file transfer protocol supported by your communications pro-
  126. gram.  The best is Zmodem, but if your program does not
  127. support Zmodem use Kermit (next screen).  The key to Down/Up-
  128. loading is to set up the host Unix system first, and then
  129. begin the command from your PC.  For example, to download the
  130. file file1.zip from your home directory enter the command:
  131. sz -b file1.zip, then issue the command that initiates Zmodem
  132. file transfers from your communications program.  (Your pro-
  133. gram may do this automatically).  The "-b" means binary file.
  134. To upload, begin with the Unix command rz -b file1.zip.
  135.  
  136.  kermit - A Slower But More Reliable Alternative 
  137.  
  138. If Zmodem will not work for you you can always use the kermit
  139. protocol, which is almost universally supported.  To download
  140. using kermit first start the kermit program on your Unix host
  141. by entering the command: kermit.  After the kermit> prompt 
  142. appears, enter the command: set file type binary (if you are
  143. transferring a binary file).  Then issue the command send
  144. file1.zip.  Then from your own communications program issue
  145. the command that initiates a kermit download.  Be sure the
  146. file type parameter is set correctly on your end too.  To
  147. upload the procedure is the same, except begin with the 
  148. Unix kermit command: receive file1.zip.  To exit from the
  149. Unix kermit program enter: quit, or q at the kermit prompt.
  150.  
  151.  Summary 
  152.  
  153. This is just the barest introduction to Unix commands, but
  154. they are definitely the most essential commands.  If you do
  155. not know them life with Unix will be very difficult.  The
  156. printed summary to this lesson lists a couple of excellent
  157. references to Unix if you wish to know more.
  158.  
  159. If you are a Mac or Windows user exclusively, you will find
  160. this daunting, and even if you are used to working from the
  161. DOS C:> prompt you will find Unix difficult at first, but
  162. it just takes a little practice.  Good luck!
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.