![]()
![]()
![]()
![]()
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:
![]()
pwdshows the name and location of the directory where you are curretly working.$ pwd /usr/users/donigt01
![]()
lsgives 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
![]()
cdmoves you to another directory.$ cd Misc
![]()
mkdircreates 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, socd ..will move you up one level.
~means your home directory, socd ~will move you back to your home level.
Just typing a plaincdwill 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.
upmoves you up from a sub-directory to the parent directory (equivalent tocd ..)
down subdirmoves you down into a sub-directory (equivalent tocd subdir)
over subdir2moves you from one sub-directory to another one at the same level under one parent directory
![]()
![]()
![]()
![]()
Using Computers for Molecular Biology
Stuart M. Brown, Ph.D, RCR, NYU Medical Center Comments to: browns02@mcrcr.med.nyu.edu