home *** CD-ROM | disk | FTP | other *** search
- Unix
-
- Most Internet host computers use Unix as their operating
- system, so a knowledge of certain Unix commands is essential
- for managing your Internet sessions and the files in your
- Unix home directory. Even if your Internet provider offers
- a fancy graphical interface, it will not be long until you
- telnet to another network where you will have to work with
- the bare Unix prompt, so it is good to know a little Unix.
-
- Unix is very complex, and is definitely NOT user friendly.
- It was written by programmers for programmers. Nevertheless
- this lesson will teach you basic facts about several basic
- commands that you will find very valuable.
-
- ls - Listing Your Files
-
- To learn what files are in your home directory enter the
- command ls. As with all Unix commands you must use lower
- case letters. A list of file names, alphabetized, will
- appear on your screen. Most Unix commands allow you to
- enter a "switch" after them, to affect the way the command
- works or to format it's output. The command ls -l will
- produce a "long" list of your files, showing file attributes,
- creation dates, file size, and name. The dash (-) before the
- letter l tells Unix that this is a switch. The command
- ls -a shows "all" files, including hidden ones, in your
- directory. The command ls -la shows all files in long form.
- The equivalent DOS command is "dir."
-
- cp - Copy A File
-
- To copy a file enter the command: cp file1 file2, where file1
- is the name of the file you want to copy and file2 is the name
- you want to assign to the copy. After executing this command
- you will have two copies of the file called file1, one named
- file1 and one named file2. Unix does not check to see if
- another file with the name of file2 exists prior to executing
- this command, so be very careful. If a file called file2
- existed before executing the above command, it would be over-
- written with the contents of file1. Unix also operates on the
- principle that "no news is good news." It will not inform you
- when it successfully carries out the command. The equivalent
- DOS command is "copy."
-
- mv - Renaming Or Moving A File
-
- The command mv file1 file2 will change the name of file1 to
- file2. Be very careful, though. If file2 already exists
- it will be overwritten with the contents of file1 and Unix
- will not warn you.
-
- The mv command is very powerful because it can be used to
- move files between directories also. mv is a combination
- of the DOS commands "rename" (ren) and "move."
-
-
-
-
-
- rm - Removing Files
-
- The command rm file1 will delete (remove) the file named
- file1. Be extremely cautious, in Unix there is no command
- equivalent to the DOS undelete command. Once your file has
- been deleted there is no way to get it back. When it's gone,
- it's gone for good.
-
- With copying, deleting and listing commands you may also use
- wildcard symbols as you would in DOS. The "?" wildcard acts
- just like it does in DOS, substituting for a single character
- in a file name. The "*" symbol, however, is more powerful.
- The command ls f* would list all files beginning with "f."
- The command rm * would delete all files in your directory.
-
- cat - Viewing A File
-
- To view the contents of a text file use the command cat file1,
- where file1 is the name of the file you want to view. The
- contents of the file will scroll quickly over your screen. If
- the file is longer than will fit on a single screen, use the
- "more" filter along with cat, like this: cat file1 |more. The
- vertical bar before "more" is called the piping symbol, and
- "pipes" the output of the cat command to the paging command
- "more." In this case, you will see a screenful of information
- at a time. Pressing the spacebar will advance to the next
- screen. Pressing control-c will break out of the more filter.
- The cat is only for text files, not binary files. The equiv-
- alent DOS command is "type."
-
- cd - Changing Directories
- The Unix file system is similar to the DOS system (DOS stole
- the idea from Unix). It uses a single root directory and a
- system of "tree" directories branching off from the root.
- The directories below a directory are called sub-directories.
- The equivalent Mac terminology is folders and folders within
- folders. For example, your home directory may be called
- /pub/guests/efudd. (Notice the Unix slashes go the opposite
- direction from the DOS slashes). To change to a subdirectory
- called News beneath your home directory enter the command:
- cd News. To change to the directory above your home directory
- enter: cd .., where the two dots are an abbreviation for "the
- directory above." To change from the root directory to your
- home directory enter: cd /pub/guests/efudd.
-
- man - Getting Help
-
- There is an on-line help facility on every Unix system called
- man (short for manual). To get help on any Unix command
- enter: man [commandname]. For example, to get help on the ls
- command enter: man ls. Be prepared for some heavy sledding,
- though. The manual pages are very technical and go into pain-
- ful detail about the implications of every switch available to
- every command. This is what you want in a technical manual,
- but it is not easy to get a short, simple answer to a simple
- question--but we warned you, Unix is not user friendly.
-
- The equivalent DOS command is "help."
-
-
- sz - Downloading/Uploading Files
- If you dial in to Internet you will soon need to know how to
- get files from your Unix home directory (where they will go
- when you ftp them) to your home PC. What you do is use a
- file transfer protocol supported by your communications pro-
- gram. The best is Zmodem, but if your program does not
- support Zmodem use Kermit (next screen). The key to Down/Up-
- loading is to set up the host Unix system first, and then
- begin the command from your PC. For example, to download the
- file file1.zip from your home directory enter the command:
- sz -b file1.zip, then issue the command that initiates Zmodem
- file transfers from your communications program. (Your pro-
- gram may do this automatically). The "-b" means binary file.
- To upload, begin with the Unix command rz -b file1.zip.
-
- kermit - A Slower But More Reliable Alternative
-
- If Zmodem will not work for you you can always use the kermit
- protocol, which is almost universally supported. To download
- using kermit first start the kermit program on your Unix host
- by entering the command: kermit. After the kermit> prompt
- appears, enter the command: set file type binary (if you are
- transferring a binary file). Then issue the command send
- file1.zip. Then from your own communications program issue
- the command that initiates a kermit download. Be sure the
- file type parameter is set correctly on your end too. To
- upload the procedure is the same, except begin with the
- Unix kermit command: receive file1.zip. To exit from the
- Unix kermit program enter: quit, or q at the kermit prompt.
-
- Summary
-
- This is just the barest introduction to Unix commands, but
- they are definitely the most essential commands. If you do
- not know them life with Unix will be very difficult. The
- printed summary to this lesson lists a couple of excellent
- references to Unix if you wish to know more.
-
- If you are a Mac or Windows user exclusively, you will find
- this daunting, and even if you are used to working from the
- DOS C:> prompt you will find Unix difficult at first, but
- it just takes a little practice. Good luck!
-
-
-
-
-
-
-
-