Thomas Schenk IT Service

Thomas Schenk, Frankfurt am Main

 

VMS - UNIX survival guide

The brief command reference shown below hopefully helps you to survive a couple of days on your new OpenVMS or UNIX system.

Please note that VMS provides the Digital Command Language (DCL) only, whereas UNIX offers several shells like the Bourne Again Shell (bash), the Korn Shell (ksh), the C Shell (csh) and others. Depending on your shell selected the commands shown below may slightly differ.

VMS was once developed by Digital Equipment Company which now belongs to HP. From version 6 it was renamed to OpenVMS. You can find information on good ol' VAXes, PDPs and other great stuff on:
Documenting DIGITAL ,  PDP-11 and Digital trademarks.

Online documentation is available on:
VMS HelpOpenVMS beginner's FAQOpenVMS DocumentationVMS Software and
Bash reference manualBash home page

General commands

UNIX (bash) VMS (DCL) remarks
man cp
whatis cp
apropos cp
cp --help
HELP COPY tell me how to copy
Cntrl-C Cntrl-Y stop current program
exit or Cntrl-D LOGOUT or LO terminate interactive shell
df -k SHOW DEVICE D or SH DEV D show drives/partitions
ps aux SHOW SYSTEM or SH SYS show processes
ps aux|grep abc PIPE SHOW SYSTEM | cont...
   SEARCH SYS$INPUT ABC
show process abc
kill -15 12345
kill -9 12345
STOP PROC /ID=12345 stop process no. 12345
-15 is better, -9 should only be used if the process doesn't react on -15

Directory commands

UNIX (bash) VMS (DCL) remarks
ls -la/abc/xyz/ DIR [ABC.XYZ] list directory /abc/xyz/
cd /abc SET DEFAULT [ABC] or
SET DEF [ABC]
change to directory /abc
cd /abc SET DEF DKA200:[ABC] VMS: change to directory abc
on disk DKA200:
cd abc/xyz SET DEF [.ABC.XYZ] change to directory below current directory
cd / SET DEF [000000] change to root directory
cd .. SET DEF [-] change to directory above current directory
cd SET DEF SYS$LOGIN: change to home directory
pwd SHOW DEFAULT or SH DEF show current directory
mkdir /abc/xyz CREATE /DIR [ABC.XYZ] create directory /abc/xyz
rmdir /abc/xyz DELETE [ABC]XYZ.DIR; delete directory /abc/xyz

File commands

UNIX (bash) VMS (DCL) remarks
cat abc.txt TYPE ABC.TXT list file contents
more abc.txt TYPE/PAGE ABC.TXT list file contents page by page
rm abc.txt DELETE ABC.TXT;
DELETE ABC.TXT;5
PURGE ABC.TXT
PURGE /KEEP=3 ABC.TXT
delete highest version
delete version no. 5
delete any but higest version
keep 3 highest versions
UNIX: delete file (there are no versions)
cp abc.txt /xyz/ COPY ABC.TXT DKA200:[XYZ] copy file abc.txt into directory /xyz/
mv abc.txt xyz.txt RENAME ABC.TXT XYZ.TXT rename a file
ls -la abc.* DIR ABC.* list all files matching abc.*
find . -name *.txt DIR [*...]*.TXT list all files matching *.txt in any subdirectory
find / -name *.txt DIR DKA200:[000000...]*.TXT list all files matching *.txt in any directory
grep text abc.txt SEARCH ABC.TXT "text" search file for lowercase text
grep -i text abc.txt SEARCH ABC.TXT TEXT search again, but ignore case of text
diff abc.txt xyz.txt DIFF ABC.TXT XYZ.TXT
DIFF ABC.TXT ;-1
compare 2 files
compare current and
previous version

Program and script commands

UNIX (bash) VMS (DCL) remarks
. abc.bash @ABC.COM run script file in current context
abc.bash SPAWN ABC.COM run script file in a subshell
bash -x abc.bash SET VERIFY
@ABC.COM
SET NOVER
switch on trace
then run script
then switch off trace
abc RUN ABC.EXE UNIX: run program abc. Search for it in environment vaiable $PATH
VMS: run program abc found in current directory
/xyz/abc RUN $DKA200:[XYZ]ABC.EXE run program abc in directoy /xyz
/xyz/abc arg1 arg2 ABC=="$DKA200:[XYZ]ABC.EXE"
ABC arg1 "arg2"
run same program with 2 arguments.
VMS: first define symbol (dont forget $), then run program with uppercase arg1 and lowercase arg2
ls -la >xyz.txt DIR /OUTPUT=XYZ.TXT redirect output of shell command into a file
abc >xyz.txt DEFINE/USER cont...
   SYS$OUTPUT XYZ.TXT
RUN ABC.EXE
redirect output of program into a file
VMS: redirect output for one command only, then run program
abc |grep -i xyz PIPE RUN ABC.EXE | cont...
   SEARCH SYS$INPUT XYZ
search output of program for xyz ignoring the case
VMS 7.x: PIPE allows UNIX style pipes

Alias and environment variable commands

UNIX (bash) VMS (DCL) remarks
alias abc SHOW SYMBOL ABC show alias or symbol abc
alias |grep a SHOW SYMBOL *A* show aliases or symbols containing an a
alias rm='rm -i' DEL=="DELETE /CONFIRM" define an alias or symbol
alias rm='rm -i' DEL*E=="DELETE /CONFIRM" same. VMS: Entering DEL or DELE calls the symbol. Entering DELET or DELETE calls the normal VMS DELETE command
export home='/abc/' DEFINE HOME DKA200:[ABC] define an environment variable or logical name
echo $home SHOW LOG home show environment variable or logical name
ls -la $home DIR HOME: use environment variable or logical name

UNIX commands and names are case-sensitive. VMS converts commands and names into uppercase letters. VMS commands can be abbreviated. For example DELETE, DELET, DELE, del and DEL are equivalent.

Comments and corrections are welcome! Please send them to

E-M-a-i-l

Copyright © 2003-2017 by Thomas Schenk IT Service

VMS, OpenVMS, UNIX, Digital and HP are trademarks of their owners.