UNIX Primer

File and Directory Manipulation

Listing your files
ls lists all files in your directory (like dir)
ls -l show all attributes (such as size, date created, and permissions)
ls -a list all files (including those that begin with . )

Copying and deleting files
cp file1 file2 copies file1 into file2
rm file deletes file

Directories and subdirectories

Like DOS, your Unix files may be organized into directories and subdirectories for the purpose of good organization. The syntax is roughly the same as in DOS (note, however, that UNIX uses the forward slash / instead of the backslash for subdirectories).

Creating and deleting directories
mkdir directory creates a new subdirectory called directory
rmdir directory deletes that directory (but only if all files in it have been deleted).

Changing the current directory
Like DOS, you can navigate through your directories using the cd command.

cd directory takes you to directory (if it is a subdirectory of the current one)
cd .. takes you back up to the directory of which your current directory is a subdirectory
cd returns you to your root directory.

Copying and directories
You can also copy and move files from one directory to another using cp. For example:
cp file directory will make a copy of file in directory directory (as long as directory is a subdirectory of your current location).
cp directory1/file directory2 will copy of file from directory1 into directory directory2.
cp ../file1 file2 Will copy file1 from the directory below the current one, into

Transfering Files To/From a Diskette with ftp

The simplest way to copy files between your UNIX account and a diskette is to use the ftp option in Windows. This can be reached by the following procedure:
  1. Go to Windows (that is, do not tn to UNIX).
  2. Open the OnNet 2.1 WinApps icon.
  3. Find and open the ftp icon.

This will bring up the ftp window. From here:

  1. You will first be prompted for the machine you wish to connect to. Choose frodo
  2. You will then be prompted for your login name and password.

At this point, you now have access both to your UNIX account (shown on the left) and to the PC (shown on the right).

  1. Select the a: drive from the options on the right.
  2. If you are copying to/from some subdirectory, you will have to select it from the lists of directories on the left and right.
  3. If you are transferring binary data of some sort (such as an image), you want to make sure that option is selected at the top of the window.

You are now ready to copy a file. To do this:

  1. Click on the file you wish to copy. If you are copying from your UNIX account to your diskette, this will be on the right side of the screen. If you are copying from your diskette to your UNIX accout, this will be on the left side of the screen.
  2. Click the copy button.