Now we briefly describe essential UNIX commands.
Description: There are whole books on this program. We will use awk in a very primative way to select specific columns from standard input for use as input into another program. For example, if the third and fourth column of file myfile is desired as input to program myprog type:
% awk '{print $3, $4 }' myfile | myprog
Description: concatinates and displays files. It reads from standard
input or from the specified file(s) and displays them to standard output.
Description: changes directory from current directory to the one specified.
Description: copies files or directories.
Description: grep, like awk, is a very versatile (and complicated) program about which one could read an entire book. However, we will use grep in a primative way, to pick out particular key strings from a file. For example, if a file myfile contains lines of data for many samples, and we wish to consider the data for a single sample mysamp, lines containing the word mysamp can be ``grepped'' out by:
% grep ``mysamp'' myfile
and listed to the screen, redirected to a file, or piped to a program.
Description: file1 and file2 share a common ``join'' field, by default the first column. This could for example be a sample name. The output file prints the join field, followed by the rest of the line from file1, then the rest of the line in file2. Say file1 has magnetometer output data, with lines of data containing: sample, treatment, D, I, M and file2 has pertinent information such as sample orientation, with lines: sample, azimuth, plunge. We may wish to attach the sample orientation data to the magnetometer output for further processing. join allows us to do this by the following:
% join file1 file2
Description: lists the contents of the specified directory. If none
specified, lists the current directory.
Description: makes a directory with the specified name.
Description: lists the contents of a file page by page. To advance
the page, press the space bar. To view line by line, press
return.
Description: renames file1 to file2. This also works for
directory names.
Description: concatenates lines from file2 onto the corresponding line
in file1.
Description: prints the absolure pathname of the working (or current)
directory.
Description: Deletes the specified file or files.
Description: Deletes the specified directories. Note: the directory
has to be empty.
Description: tee transcribes the standard input to the standard output
and copies the input to the filename.
More detailed descriptions are usually available on-line with the man command. For example, to find out more about cat, type:
% man cat
and read all about it.
For content questions please contact: Lisa Tauxe |
|