[ Program Manual | User's Guide | Data Files | Databases ]
Overview
Fundamentals: Using UNIX
Getting Help for UNIX
Logging On
Working with Directories
Displaying Directory Contents
Creating Directories
Changing Directories
Defining and Using Logical Names for Directories
Working with Files
Creating and Editing Files
Specifying Files
Deleting Files
Displaying and Changing File Protections
Using Wildcards
Viewing Files
Using Command-Line Redirection
Controlling Program Execution
Running Jobs in the Background
Displaying Background Jobs
Moving a Job to the Foreground
Terminating a Background Job
Logging Off
Quick Reference
UNIX Commands
Controlling Screen Output
Getting Started with the Wisconsin Package
Initializing the Package
For Advanced Users
Customizing Your Login
Initializing the Wisconsin Package
Automating Program Commands
Defining Logical Names
Defining Your Graphics Configuration
This chapter helps prepare you to use the Wisconsin Package. Written with the novice user in mind, it provides you with the fundamentals of working with the UNIX operating system. While the commands and procedures in later chapters and in the Program Manual often assume that you have a working knowledge of UNIX commands, this chapter assumes you have little or no experience working with the computer, and it provides you with that basic groundwork.
You can find the details on working with files and directories, logging on and off the system, and customizing your login environment in this chapter. It also explains how to start running the Package.
The Wisconsin Package you use is installed on a minicomputer using a UNIX operating system. You are connecting to that computer in one of two ways: 1) you are directly connected to the computer, or 2) you connect to the computer over the network. The device you are using could be a dumb terminal, a console, an X Windows terminal, or a PC or Macintosh running terminal emulation software. Regardless of what device you are using to access the Package, you must become familiar with UNIX commands to use the Wisconsin Package programs and manipulate the output.
Note: If you are more familiar with OpenVMS commands than UNIX commands, see Appendix D, Command and Keystroke Differences between OpenVMS and UNIX.
Your system manager has just set up a UNIX account for you to use the Wisconsin Package. But what if you've never used UNIX before and you're not sure where to start? This chapter will walk you through the basics of using the UNIX operating system. If you take a little time now to learn the basics of UNIX, you will increase the efficiency with which you can later work with the Wisconsin Package.
This section teaches you how to
The Wisconsin Package supports two shells in UNIX: C shell and Korn shell. Commands vary slightly between UNIX shells, so you must know which shell you are using to get the results you want. How do you know which shell you are using? Ask the computer by typing % echo $SHELL. (Note that UNIX commands are case sensitive.) The system displays the shell you are using. Where commands differ between the two shells, this manual gives the commands for both.
Keep the following points in mind as you work with the commands and tasks in this chapter and manual.
You use UNIX commands to manipulate files and directories. Think of a directory as being similar to a file cabinet. Within the file cabinet you can find drawers (subdirectories) and files. Subdirectories, like file cabinet drawers, help you organize your files into loosely related groups. Files are where you store information in the computer--for example, sequence information or the output of a program. Most Wisconsin Package programs require a file as input and produce an output file of results.
Each directory and file in the UNIX system is under file protection. This protects you and others from writing in directories or reading or executing files for which you do not have the privilege. For example, you can set a file's protection so that only you can read it.
In your work with the UNIX files, there are times when you must use a text editor to complete a task. The default text editor in UNIX is vi. However, you can use other text editors, if available.
It is beyond the scope of this manual to provide detailed instructions in the use of text editors. However, we do provide the basics to get started using vi in Appendix B, Text Editor Basics. For more information about the default text editor vi, see the documentation for your UNIX system. For other text editors, see the appropriate program documentation.
Type % man command_name. For example, % man ls displays online help for the UNIX command ls (list).
The UNIX commands are also described in detail in your UNIX operating system manuals. For more information, see your system manager.
To use the Wisconsin Package, you will be in one of two possible situations: 1) you are directly connected to the computer, or 2) you connect to the computer over the network. The device you are using could be a dumb terminal, a console, an X Windows terminal, or a PC or Macintosh running terminal emulation software.
Note: You must have an approved account, also called a login, from the system manager to use any UNIX computer. The system manager usually sets up a user name, which is typically your first or last name, and lets you specify a password for security. No one can access the system through your account without your password. Keep your password secret.
When you are connected, you should see the prompt "Login:" on the screen. If you don't, press <Return> until you do.
Note: Your user name and password are case sensitive; that is, the computer distinguishes uppercase letters from lowercase letters. Therefore, type your login name and password exactly as they are set up in the system.
Note: If you make a mistake in typing your user name or password, press <Delete> to delete the error or press <Return> and try again.
When you see the operating system prompt (%) in the left margin of your screen, the computer is ready for your commands. Note that the % prompt is a convention used in this guide. Your site may have set up a different prompt.
You can think of a directory as being similar to a file cabinet. Within the file cabinet you can find drawers (or subdirectories) and files. Subdirectories, like file cabinet drawers, help you organize your files into loosely related groups.
When you log in, you will be in your top directory, also known as your home directory. Your current (or working) directory refers to whatever directory you are presently working in.
For more information on working with directories and UNIX commands, see the documentation for your UNIX operating system or your system manager.
Type % ls (list).
Type % pwd (print working directory).
Your system manager probably provided you with one directory in which to maintain your files--your home directory. To help organize your files, you may want to create subdirectories within your current directory.
You've learned how to create directories, and now you want to know how to move between them. Consider the following example of a directory tree as you read through the tasks below.
Choose from the following.
GCG has defined simple commands to aid you in easily changing directories. These commands are especially helpful when you have many subdirectories to work with. Choose from the following.
Note: The following commands are provided by GCG and are only available when the Wisconsin Package has been initialized (see "Getting Started with the Wisconsin Package" in this chapter for more information). They are not standard UNIX commands.
If you move to a directory other than your home directory often, you can assign it a logical name. A logical name is a shorthand name you can give a filename or directory. Logical names often reduce typing and are easier to remember than full specifications. The GCG utility Name lets you create logical names within a UNIX operating system.
For example, let's say you assigned /smith/project the logical name proj. Regardless of the directory you are located in, you can move to /smith/project with the command % to proj instead of typing the entire directory specification.
Note that before you define a logical name, you first should check to make sure you will not overwrite an existing logical name. To check if a logical name is already defined. To do so, type % name logical_name.
Wisconsin Package programs use logical names to refer to various resources in the UNIX file system. These resources consist of directories, databases, system utilities, shell scripts, devices, or files. For example, the logical name genrundata is assigned to the directory containing the sequence databases and other data files. The logical names and their specifications are maintained in a table you can view by typing % name.
Note: Logical names are case insensitive; that is, they can appear in uppercase, lowercase, or mixed case. For example, the logical name GenRunData is the same as genrundata.
Note: For more information about the Name program, see the Program Manual.
Type the logical name followed by a colon and a filename, for example proj:gamma.seq. You must use a colon (:) between a directory logical name and the filename that follows it.
If you forget what a logical name is defined as, type % name logical_name. For example
% name proj
/smith/project.
Note: Because logical names are created within the Wisconsin Package, you can use them only with Wisconsin Package programs and commands. The UNIX shell does not understand logical names.
Files are where you store information in the computer--for example, sequence information or the output of a program. Most Wisconsin Package programs require one or more files as input and produce an output file of results.
Filenames have a particular format: /directory/filename, where directory is the directory in which the file belongs; and filename is the name of the file. Directory names and filenames are case sensitive. You can use all alphanumeric characters as part of the name; however, you should avoid using characters with special meaning in UNIX, such as / \ " ' * ; - ? $ [ ] { } ~ ! < >. In addition, avoid including spaces within the name. Try to make the directory or filenames as descriptive as possible to help you remember their contents.
Unlike some other operating systems, UNIX doesn't assign file extensions to distinguish types of files. You can, however, add your own extensions to group similar types of files together. The Wisconsin Package often adds extensions to help distinguish output files.
Note that UNIX saves only the most recent version of a file. Therefore, use care in saving and naming files: if the filename already exists, the system writes the new information over the existing file without warning you. All previous information is lost.
For more information on working with files and UNIX commands, see the UNIX documentation for your system or your system manager.
Most Wisconsin Package programs create output files, some of which you can use as input to other programs. To create files in a directory, you must have privileges to write in that directory (see "Displaying and Changing File Protections" in this chapter). If you don't, change the directory protections (if possible) or move to another directory in which you do have the necessary privileges.
We recommend that you learn to use a text editor to create and edit files. Files written by most Wisconsin Package programs are easily edited using text editors.
Use a UNIX text editor, for example vi. You can use other text editors as well. For more information about vi, see Appendix B, Text Editor Basics or refer to the documentation for your UNIX operating system. For more information about other text editors, see the appropriate program documentation.
Note: If you create and save a file under a filename that already exists in the directory, UNIX replaces the original file with the new information. That is, UNIX writes over the data in the original file without warning you.
UNIX and Wisconsin Package commands often require one or more filename(s) to do their job. A simple example of a UNIX command is when you type % rm, the computer expects you to supply it with the name of the file to remove. As an example of a Wisconsin Package command, when you run the Map program, it asks you "MAP of what sequence?" In such instances you need to specify a filename.
Choose one of the following.
Note: For more information about directories, see "Working with Directories" in this chapter.
You will find it necessary to clean up your directories at times and to delete unnecessary files. You can do this with two commands: rm (remove file) and rmdir (remove directory).
Choose from the following.
File protection is a means of security by which three categories of users are assigned privileges to each file: user (you), group (the group(s) you belong to, for example your lab), and other (everyone outside your group). Each category has certain privileges of access and use:
(r) read - Users can read the contents of the file or directory.
(w) write - Users can write in and edit the files or directory.
(x) execute - Users can execute the file or files in the directory or can display the contents of the directory.
Type % ls -l.
The system displays the name of each file followed by the protections (rwx) grouped by user, group, and other. For example
As you can see in this example, directories as well as files have protections assigned to them.
Type % chmod u=protections filename, where u defines the category of user (u [user], g [group], or o [other]) and protections defines the protections you want to set (r [read], w [write], or x [execute]).
Use wildcards to specify multiple files. An asterisk (*) wildcard serves as an ambiguous replacement for one or more characters; the * means "anything or nothing." You can also use a percent sign (%) wildcard as an ambiguous replacement for a single character. Consider the following examples:
Most UNIX commands and some Wisconsin Package programs accept wildcards in file specifications.
Note: If a command allows two file specifications on the command line, never use wildcards in the second parameter, for example % cp *.txt *.seq. Using wildcards in this manner will produce unexpected results.
Choose from the following.
Every UNIX program or command can read or write to:
The table below describes the command line characters you can use to redirect standard input, output, and error. Notice that you can combine input and output redirection characters on the command line.
With UNIX, you can run several programs at once from the same terminal. UNIX allows you to do this by running programs in the foreground or background.
The ability to put jobs in the background is very useful; it allows you to keep working at your terminal even though you are running one or more programs which take some time to complete.
If you want to run one or more jobs in the background, keep the following points in mind:
In the Wisconsin Package, you can bypass most program prompts by using parameters on the command line. For more information on using command-line parameters, see "Using Program Parameters" in Chapter 3, Running Programs.
Although you can run only one program in the foreground, you can run multiple programs in the background.
Add an & (ampersand) to the end of the command line, for example % fasta ggammacod.seq -Default &.
The system puts the job in the background and displays a response similar to the following:
[1] 14999
%
The number in square brackets [ ] is your job number, in this case job number 1. If you ran a second job in the background, it would have a job number [2]. The second set of numbers is the process identification (PID) number assigned by the system. The system prompt (%) tells you the system is ready for your next command.
A job will stop running if it needs information that you must enter at the keyboard, such as a filename or other parameter. When this happens to a background job, the system displays a message similar to the following on your screen:
[1] + Stopped (tty input) fasta
To continue the job, bring it to the foreground. The job, requiring your input, continues from where it stopped. For more information, see "Moving a Job to the Foreground" in this chapter.
If you log out while running a background job, the job continues to run. When the job finishes processing, its output file appears in the directory you specified.
Note: Some programs, such as those that search the databases, are computationally intensive and take some time to execute. You can use the -Batch parameter to submit these programs to the batch queue to execute at a later time. For more information about the batch queue, see "Using the Batch Queue" in Chapter 3, Using Programs.
Type % jobs. A list of each background job you are running appears on your screen, marked as either running or stopped. A running job is executing in the background. A stopped job is one that either you or the system put on hold. For example
[1] +Running - (set noglob; $GCGUTILDIR/fasta ggammacod.seq -def)
[2] -Stopped - (set noglob; $GCGUTILDIR/mfold -save ala-trna.seq -def)
Let's say you ran a program and put it in the background. But the program stopped after encountering an unanswered prompt. What do you do? You can move the program into the foreground. The program continues from where it left off in the background.
You can put a foreground job in the background again by pressing <Ctrl>z to stop the job then typing % bg (background) to put it in the background for processing. The job will continue running in the background
Type % logout.
Note: If you are running a program in the background when you log out, and you redirected the output to a file, the program runs to completion and places the output file in the directory you specified. However, if you haven't directed your output to a file when you log out, the program is terminated before completion.
You should become familiar with the following UNIX operating system commands to use the UNIX system and Wisconsin Package programs effectively and efficiently. For more information on UNIX commands, see the documentation for your UNIX operating system.
The following is a partial list of key combinations you will find helpful in controlling screen output. For more information on terminal keyboard combinations, see the documentation for your UNIX operating system.
Note: Chapters 2-5 in this guide provide general instructions for all programs in the Wisconsin Package. For detailed instructions about a specific program, see the Program Manual.
To use the Wisconsin Package, you must first initialize your environment. Initializing your environment gives you access to the Wisconsin Package programs, the databases, data files the programs need, logical names, and other information required for the Package to run smoothly.
Type % gcg. The system takes a few seconds to initialize the Package and displays a banner similar to the following:
The banner displays the version of the Package you are running, as well as the reference you can cite if you use the Wisconsin Package in your publishable research. (Because the banner changes with each update to the available databases, your banner may look slightly different than the one above.)
When you see the operating system prompt (%), the Wisconsin Package is ready for use.
Note: The % prompt is a convention used in this guide. Your site may have set up a different prompt. Also, if the command % gcg does not initialize the Wisconsin Package on your system, see your system manager.
For help working with the Wisconsin Package, check the documentation, look in the GenManual or GenHelp online help, or contact technical support. For more information, see "Getting Help" in the preface "Before You Begin."
TIP - If your primary reason for using the UNIX system is to use the Wisconsin Package, you may want to customize your login to automatically initialize it. To do so, you need to create or edit your .login or .profile file. For more information on working with login initialization files, see "Customizing Your Login" in the "For Advanced Users" section of this chapter.
The information in this section is intened for users who are familair with the operating system. This section teaches you how to
You or your system manager can customize your login to ensure that certain commands execute or are available every time you log in. For example, you may want to customize your login to automatically initialize the Wisconsin Package. Or, you can assign logical names for filenames and directories so that each time you log in, they will be defined automatically. To do these things and more, you can do this with two files:
Note: To determine which shell your system runs under, type % echo $SHELL.
When you initialize the GCG environment, the last step in the initialization process is the execution of your .gcgrc or .gcgrc.ksh file, if one exists. This file is not executed until after the logical name and symbol service is fully initialized and after all environment tables are set. Because of this, the .gcgrc or .gcgrc.ksh file is the best place to put your customized commands.
Use a text editor of your choice, for example vi. Create the file(s) in your top directory.
Note: To test your login file after you've edited and saved it, type % source filename (csh) or % . filename (ksh), for example % source .login (csh) or % . .profile (ksh). The system reruns the file.
Note: The first line of each of the csh and ksh examples sets environment variables for working with the Wisconsin Package. See your system manager for the correct specification at your site.
The second line of each of the examples initializes the Package.
Note: For more information, see "Working with Shell Scripts" in the "For Advanced Users" section of Chapter 3, Using Programs.
You may find that you frequently run a Wisconsin Package program using the same parameters each time. You can define an alias in your .gcgrc (csh) or .gcgrc.ksh (ksh) file to create a shortcut command for the program and its parameters.
Before you create an alias, you should check to make sure the alias is not already defined. To do so, type % alias alias_name. Then (if the alias is not defined, or if you want to redefine the alias) use the following syntax to define an alias:
% alias command_line
If you define an alias at the operating system prompt, it will be in effect until you log out. To save your alias from one session to the next, add it to your .gcgrc (csh) or .gcgrc.ksh (ksh) file.
(csh) - alias mc mapplot -CIRcular
(ksh) - alias mc=mapplot -CIRcular
Note: Make sure the .gcgrc or .gcgrc.ksh file is located in your top directory.
You can assign logical names to files you use frequently or directories that you move to frequently. When you define logical names in your .gcgrc (csh) or .gcgrc.ksh (ksh) file, they are available every time you initialize the Wisconsin Package.
Note that before you define a logical name, you first should check to make sure the logical name is not already defined. To do so, type % name logical_name.
For more information on defining logical names, see the topic "Defining and Using Logical Names for Directories" earlier in this chapter.
Before you run a Wisconsin Package program that produces graphic output, you must define your graphics configuration. Defining your graphics configuration means telling the computer what graphics language you want to use and on what device you want to display. For more information, see "Initializing Your Graphics Configuration" in Chapter 5, Using Graphics.
graphics_language is the name of the graphics language you want to use. For more information about what graphics languages are available, see "Configuring Graphics Languages and Devices" in Appendix C, Graphics.
graphics_device is the device you want to send output to, for example a graphics terminal screen, printer, or plotter. Supported devices also are listed in "Configuring Graphics Languages and Devices" in Appendix C, Graphics.
port_or_queue is where the graphics device is attached, for example term or /dev/tty11.
For example, to set up a graphics configuration for a LaserWriter, you might type postscript laserwriter /dev/tty11.
Note: Some graphics configuration commands have fewer prompts, such as XWindows, and some have more, such as HPGL. Make sure you answer all the prompts when you set up your graphics configuration in your .gcgrc or .gcgrc.ksh file.
TIP - "Initializing Your Graphics Configuration" in Chapter 5, Using Graphics describes using the SetPlot command to define your graphics configuration from the command line. You also can use the SetPlot command in your .gcgrc or .gcgrc.ksh file to define your graphics configuration for you when you log in. To do so, follow these steps:
[ Program Manual | User's Guide | Data Files | Databases ]
Documentation Comments: doc-comments@gcg.com
Technical Support: help@gcg.com
Copyright (c) 1982, 1983, 1985, 1986, 1987, 1989, 1991, 1994, 1995, 1996, 1997 Genetics Computer Group, Inc. a wholly owned subsidiary of Oxford Molecular Group, Inc. All rights reserved.
Licenses and Trademarks Wisconsin Package is a trademark of Genetics Computer Group, Inc. GCG and the GCG logo are registered trademarks of Genetics Computer Group, Inc.
All other product names mentioned in this documentation may be trademarks, and if so, are trademarks or registered trademarks of their respective holders and are used in this documentation for identification purposes only.