Using the Unix Operating System

Files, directories, commands, text editors

Lincoln Stein

Genome Informatics

Suggested Reading

Chapters 3-5 of Running Linux.

Lecture Notes

Workshop Problem Set

Problem #1

  1. Log into your machine. What is the full path to your home directory?
  2. What is the path to the home directory of user lstein?
  3. What is the path to the home directory of user guest?
  4. Locate the directory /net/share/unix1. How v many files does it contain? How many directories?

Problem #2

Without using a text editor examine the contents of the file cosmids1.txt.

  1. How many lines does this file contain?
  2. How many characters?
  3. What is the first line of this file?
  4. What are the last 3 lines?
The files cosmids1.txt, cosmids2.txt, cosmids3.txt, and cosmids4.txt each contain lists of predicted genes from the C. elegans genome.
  1. Using the grep program, find the file(s) that contains the gene ZK103.4.
  2. Copy these four files into your home directory using one command only.
  3. Rename cosmids1.txt to clones.txt.
  4. Create a new subdirectory named delete_me. Move all the cosmids file into it.
  5. Use the chmod command to make this new subdirectory and its contents read-only.
  6. Now delete delete_me and all its contents using the recursive form of rm. What effect do the read-only file permissions have on this?

Problem #3

Create a text file using the emacs, xemacs or vi editor. Enter your name and address and save the file as address.txt.

Problem #4

Using the man and/or apropos commands, find the command(s) necessary to discover the amount of free disk space available for your home directory. Run the command(s).


Genome Informatics
Lincoln D. Stein, lstein@cshl.org
Cold Spring Harbor Laboratory
Last modified: Thu Oct 9 19:34:38 EDT 2003