Digital UNIX Concepts

Issuing commands and changing the environment are two important concepts in the Digital UNIX operating system. Commands tell the operating system what to do. The environment settings control how you will view the results. To learn more about Digital UNIX itself, refer to Digital UNIX overview.

When you are logged in to Digital UNIX, you are working in a program called theshell. The shell accepts your commands at the shell prompt. The commands you type are then interpreted and carried out by the shell.

There is more than one type of shell available; by default, your account uses the C shell. The C shell prompt is a percent sign (%). The first word you type after the shell prompt should always be a Digital UNIX command. When you press, the shell accepts, interprets, and executes your command.

Many commands are followed by optional arguments. Arguments can modify a command through:

  • options, or ways a command works
  • filenames, or specific pathname(s) to the file(s) on which the command works.

Digital UNIX can multi-task, or work on more than one command at the same time. Each command becomes a process that can run in the foreground or background. When you enter a command as a foreground process, Digital UNIX carries out the command before returning to the shell prompt. When you enter a command as abackground process, the shell prompt appears before the command is completed. This lets you continue to work by entering more commands. After you have started processes, you can use other commands to manage them.


Why should I use Digital UNIX concepts?

To interact with Digital UNIX, you should know some basic concepts. Once you understand these concepts, you will know how to issue commands and set up your environment. This lets you effectively manage files and information in your Digital UNIX account.


How do I get help with Digital UNIX concepts?

How do I use Digital UNIX concepts?

  • Enter commands at the shell prompt
    • Your shell prompt is a percent sign (%). You can type commands and their arguments after the shell prompt.

      The command, options, and filenames must all be separated by spaces. All of the options for a command should be grouped together and placed before all of the filenames the command will use:

      % ls -l $home/www/

      Digital UNIX is case sensitive, so it knows the difference between uppercase and lowercase letters. Unless otherwise noted, type all commands in lowercase letters. You can put more than one command on the same line. Separate each command with a semicolon character (;).

  • Use special characters and wildcards
    • Some characters, like the space, may be confusing when seen on a terminal screen. Other characters, called wildcards or metacharacters, can stand for one or more characters in the name of files or directories:

      Character name Display Usage
      Space   To select a file that contains one or more spaces, use double quotation marks around its name.
      Underline _ To make filenames easier to recognize on-screen, type the underline character with instead of using a space character. Double quotation marks are not required when selecting files with underline characters and no spaces.
      Asterisk * Use the asterisk wildcard in place of any number of characters in a filename.
      Question mark ? Use the question mark wildcard in place of any one character in a filename.
      Square brackets [ and ] To stand for any one character out of a range of several, enclose that range of characters (such as the numbers 1-9 or the letters "D" and "d") in the square brackets wildcard.

      Example:
      To copy a file named "quote_this file.txt" into your "www" directory, type:

      % cp "quote_this file.txt" $home/www/

      Example:
      To list every file beginning with "A" or "a" in your current working directory, enter:

      %ls [Aa]*
  • Manage processes
    • To start a command as a background process, put the ampersand character (&) at the end of the command line. You will receive an on-screen notice that the process has started. In this notice, a unique number assigned by Digital UNIX to the process-called the process identification(PID)-is displayed. Meanwhile, you can type more commands. You will later be notified when the process finishes.

      In certain command shells, you can use a feature called job control to manage processes. Job control lets you type the suspend character ( in the C shell) to pause a process and get a new shell prompt. While a process is suspended in this way, type bg to send it to the background or fg to bring it to the foreground.

      To see a list of your processes, use the ps command. It displays the PID, the terminal from which the command was started, the how long each process has been running, and the command associated with each process. Processes can be:

      • the ps command itself
      • a command shell process, such as csh
      • compiled programs, such as those written in C or Pascal
      • shell scripts, or sequences of commands stored in a file and which start another shell process (as well as any further command processes needed)
  • End a process
    • The kill -9 command stops any process. In order to end a process, you must know its PID.

      Example:
      If you launch Netscape Navigator on a Digital UNIX workstation and want to end its process, find out its PID first and then use add it to the kill command:

      % kill -9 7068

      [1] Killed netscape