ARCHIVED: VMS command introduction

This content has been archived, and is no longer maintained by Indiana University. Information here may no longer be accurate, and links may no longer be available or reliable.

Note: The software discussed here is no longer in common use at IU, and UITS may no longer be able to verify this text's accuracy; additionally, the UITS Support Center may no longer have the materials needed to adequately support this software.

Digital Command Language

While the operating system itself is called VMS, the language of the operating system is called the Digital Command Language (DCL).

Files on VMS

Filenames in VMS consist of three parts: the first part of the filename followed by a period (.), the optional extension followed by a semicolon (;), and the version number. When you edit or otherwise modify a file, one previous version is retained as a backup. By default, there are a maximum of two versions saved for most file types. Whenever you refer to a file with any DCL command, VMS will assume you mean the version of that file with the highest version number, which is the most recent version, unless you include the version number in the filename.

Common VMS commands

The DIRECTORY command will give you a list of your files. You can add to this command to get additional information, for example:

Lists your files and the size in blocks (A block is 512 bytes.)
Lists your files, the date last modified, and the current protection on the file (See "SET PROTECTION" below.)
Gives you all information about the file that the system maintains, except for its contents
The COPY command allows you to make a copy of a file. You can copy it from within the same directory, from one subdirectory to another, or possibly from one account to another. If you want to copy a file to a new filename in the same directory, at the VMS prompt, enter:
  copy oldfile newfile
Replace oldfile and newfile with the appropriate filenames.

To copy a file from one subdirectory to another, at the VMS prompt, enter:

  copy file [.subdirectory]*

Note: With this command, the old filename will be retained in the new subdirectory. If you want a new name, replace the * with the desired filename, for example:

  copy file [.subdirectory] new_filename        

To copy a file from someone else's account, either that file must have World:Read privileges, or an ACL must identify your username as having "read access". (See "SET PROTECTION" below.)

If you are in your account and the file you want to copy is in a subdirectory of an account on another disk, you would enter the following:

  copy $diskxx:[]filename.ext  *

Replace xx,, and filename.ext with the appropriate replacements.

DELETE is used to delete files from your account. You have to specify the version number or use a wildcard when deleting files.

Deletes the second version of the file called FILE.EXT
Deletes the highest version of FILE.EXT
Deletes every version of all files with the extension FOR
Deletes every file that has the name DATA. , regardless of the extension
Deletes every file that begins with the letters DATA , regardless of the rest of the filename and regardless of the extension
DELETE *.*;*
Deletes every file on the current directory (By default you will not be asked whether or not you are sure you want to delete all files.)
You can use RENAME to give a file a new name; it's also the most efficient way to move a file between subdirectories.
  rename oldfile newfile
Note: Only the file newfile will remain on the disk. To move a file into a subdirectory, enter:
  rename oldfile [username.subdirectory]
Displays a text (or ASCII) file to the screen; should not be used with binary (executable) files. The /PAGE qualifier will cause the display to pause after each screen. Without that qualifier, the file will just scroll across the screen until the end of the file.

Displays the current status of the disk space on an account.

Deletes all but the most recent version of each file in the current directory.

Modifies the protection of files. To give the World (anyone on the DECnet) read access to a file, enter:
  set prot = (w:r) filename

You can set the protection for Read, Write, Execute, and Delete privileges to files. You can set different protection rights for four groups: Owner, World, System, and Group. You are the Owner of files on your account, and the World is anyone on the VMS machine. The categories System and Group also exist, but UITS does not recommend that you alter System privileges. The following example illustrates how you can set protections:

  set protection = (s:rwe,o:rwed,g,w:re) myfile

This will give the following privileges to the file called myfile:

  System = Read, Write, Execute
  Owner  = Read, Write, Execute, Delete
  Group  = no privileges
  World  = Read and Execute

By default, most files you create on your account will have the protection:


This means that no one else will be able to access your files. The main exceptions to the above list of protections are .MAI files and subdirectories, which do not have Owner:Delete privileges. Do not change the protection on any .MAI files.

Creating subdirectories

When you log in, you are placed by default in your root directory, otherwise known as SYS$LOGIN. The following commands deal with creating subdirectories and navigating between directories:

  • To create a subdirectory beneath the current directory, enter:
      create/directory [.subdirectory]
    That subdirectory will appear in your current directory as:
    Note: You can have subdirectories up to seven levels deep.
  • To move into a subdirectory, enter:
      set default [.subdirectory]
    If you mistype the subdirectory name, you will not get an error message. VMS will let you "set default" to anything, but if you try to do something in a non-existent subdirectory you will get an error message.
  • SHOW DEFAULT tells you which subdirectory you are in.
  • SET DEF [-] moves you up one level.
  • SET DEF SYS$LOGIN moves you to your root directory, i.e., your top level directory. You need to enter this command only once to get to your root directory.

Important control keys

Ctrl-c Interrupt/cancel
Ctrl-y Abort
Ctrl-z Exit
Screen lock (freezes screen display)
Ctrl-q Continue (resumes scrolling)


The LOGIN.COM file is executed every time you log into your account. You may choose to include lines that will create a customized environment for your accounts. If you want to make changes to this file you'll need to use one of the editors on VMS, like EVE. Changes you make to the LOGIN.COM file will not take effect until you re-execute it. You can do this by logging out and logging back in, or by entering the following at the VMS prompt:


The sample LOGIN.COM file below illustrates some of the abbreviations and substitutions that can be defined in your own LOGIN.COM file. The lines preceded by "$!" are comment lines and explain what the lines that follow mean.

  $! The following line creates the symbol "EVE" to access the EVE
  $! editor:
  $ eve :== ed/tpu
  $! To set up the EVE editor to emulate edt:
  $ define tpu$section edt$section
  $! Defines a logical "week" to represent the week$scratch (Cinderella)
  $! disk:
  $ week:== set default week$scratch:[your_username]
  $! Sets the terminal type to VT100 and allows command line
  $! editing:
  $ set terminal/device_type = vt100/line_editing
  $! Defines the symbol "mail" to call up mail in EDIT mode: (VMS Mail is not 
  $! available at Indiana University)
  $! Creates the symbol "type" to stand for the command TYPE/PAGE:
  $ type :== type/page
  $! Defines a symbol to take you to your root directory from any
  $! subdirectory:
  $ home:==set def sys$login
  $! Defines the symbol "who" to stand for the command SHOW USERS:
  $ w*ho :== show users
  $! Defines the symbol "time" to stand for the command SHOW TIME:
  $ time :== show time
  $! Defines the symbol "quota" to stand for the command SHOW QUOTA:
  $ quota :== show quota
  $! Defines the symbol "where" to stand for the command SHOW DEFAULT:
  $ where :== show default
  $! Defines your default scratch disk (sys$scratch) as the
  $! day$scratch disk:
  $ define sys$scratch day$scratch:[your_username]
  $! Clears the screen:
  $cls:==ty/p nl:

This is document aafh in the Knowledge Base.
Last modified on 2018-01-18 08:59:38.