back contents next index

Basic UNIX Commands for Working with Directories

***Directories are a means of organizing your files on the Alpha. They are equivalent to directories in DOS/Windows and to folders on a Macintosh.

***Directories contain files, executable programs, and sub-directories

***Understanding how to use directories is crucial to manipulating your files on the Alpha.

***Use directories to store specific projects or groups of information just as you would keep a stack of papers on a particular topic in a single folder


This is my concept of a minimal list of commands necessary for file management and movement among directories on the Alpha. All of these commands can be modified with many options. Learn to use UNIX "man" pages for more information.


	ls (list)                        mkdir  (make directory)  
	
        pwd (present working directory)  cd (change directory)      
	
	cp (copy)                        mv (move)    
   
        rm (remove)                      cat (view entire file on screen)

	more (view by page)              diff (differences)           
	
	 


***First, lets cover moving around among directories:

*** pwd shows the name and location of the directory where you are curretly working.

 $ pwd
 /usr/users/donigt01


*** ls gives you a short list of the files in the directory where you are currently working.

  $ ls
  assembin4.fasta  Misc             test2.txt
  bin              temp             testfile
  ESTparse         test             testit


*** cd moves you to another directory.

 $ cd Misc


*** mkdir creates a new subdirectory inside of the directory where you are currently working

 $ ls
 assembler  phrap      space
 $ mkdir subdir
 $ ls
 assembler  phrap      space      subdir


There are some important shortcuts in UNIX for specifying directories

  • . means "the current directory"

  • .. means "the parent directory," i.e., the directory above the current directory, so cd .. will move you up one level.

  • ~ means your home directory, so cd ~ will move you back to your home level.
    Just typing a plain cd will also bring you back to your home directory.

***UNIX is not idiot-proof, nor is it forgiving of even tiny mistakes!

*** GCG has some additional shortcut commands for directory navigation.

  • up moves you up from a sub-directory to the parent directory (equivalent to cd ..)

  • down subdir moves you down into a sub-directory (equivalent to cd subdir)

  • over subdir2 moves you from one sub-directory to another one at the same level under one parent directory



back contents next index

Using Computers for Molecular Biology
Stuart M. Brown, Ph.D, RCR, NYU Medical Center
Comments to: browns02@mcrcr.med.nyu.edu