The Project Directory Approach



next up previous contents index
Next: Personalizing Unix Up: WORKSTATION SETUP AND Previous: Checking the File

The Project Directory Approach

 

A useful aspect of Unix is the directory and subdirectory structures it permits. When combined with the -CF options to the ls command (to distinguish files, directories and executables), it lets you keep your projects separate, organized, and manifestly accessible to both you and others. We suggest you give a separate directory to each project you work on as well as to letters, subroutine libraries, and your own personalized commands. Then divide each major directory into subdirectories for data, input, output, source codes (src), object codes, etc. For example, peeking into loren's home directory we find: 

%cd /u/loren   	Change to home directory.   
%pwd   	Print name of working directory.   
/u/loren   	Ah, home sweet home.   
%ls -Fx   	List file Names in columns with codes.   
Mail/  bin/  book/ comphy/    	    
letters/ mbox       papers/   proton/   	  

We see a directory Mail for saving outgoing mail, a file mbox for saving incoming mail, a directory bin where loren saves his personalized commands, a directory book where this book is being written, directories comphy and proton containing research projects on computational physics and proton scattering, respectively, directory letters containing correspondence, and a directory papers. Looking into the directory papers we see subdirectories, each containing manuscripts:

%cd papers   	Change to directory papers.   
%pwd   	Check that I'm there.   
/u/loren/papers   	Unix assuages loren's anguish.   
%ls -Fx   	List files here!   
carbon/ kaon/   pbar/  pole/   	(Publish or perish, you know.)   
%ls -Fx kaon   	List contents of kaon.   
kn.aux   kn.dvi  kn.log   kn.tex   	LaTeXfiles for paper.  

In loren's home directory we also find proton, a typical directory for a Fortran computing project:

%cd   	Change to home directory.   
%cd proton   	Go to subdirectory from home.   
%pwd   	Check where I am?   
/u/loren/proton   	In subdirectory. Good.   
%ls -Fx   	List what's here.   
LPOTp*    README   data/   in/   	Executable (*), file, directories (/).    
out/    plots/  subs/README   	all    

In this directory loren has placed notes in the file describing what LPOTp does, how to use it, and what changes were made recently. LPOTp is an executable file (as denoted by the *). Related data files are in data, input files for running LPOTp are in in, object files in obj, output files in out, plot files in plot, and Fortran subroutines in subs.

These few cases should give you ideas for organizing your projects in the way that is best for you. In particular, you may also find it effective to keep each level simple enough so you can quickly see what's there, to standardize your notation and organization throughout your directories, and to leave notes in README files. You may be able to live well enough in your own mess, but if you want your work to be valuable to others as well, then they need to be able to find it and use it. 



next up previous contents index
Next: Personalizing Unix Up: WORKSTATION SETUP AND Previous: Checking the File