OpenVMS Commands with Unix Equivalents

VMS command Unix equivalent
APPEND cat    concatenates files. If contents of file1 need to be placed at the end of file2 issue the following unix command.cat file1 >> file2
x=,x:= = (Bourne and Korn) ,    set (C shell)
x==,x:==    same as = followed by export
ASSIGN,DEFINE if file,directory alias definition: ln , ln -s    hard and soft links
DEFINE    variable definitions (no real equivalent!)
DIRECTORY ls
ATTACH fg
BACKUP tar or pax :   back up files into a tar file.
BACKUP/INIT tar -c or pax :   Restore files.
BACKUP/LIST tar -t :   List contents.
BACKUP/LOG tar -v :   Report progress.
BACKUP/NOREWIND tar -r :   Write at end of existing backup (tar) files.
BACKUP/RECORD tar -m :   Update file's modification date upon restore.
COPY cp :   Copy a file
COPY/CONFIRM cp -i :   Confirm before copying.
COPY/FTP or FTP ftp :   Copy to/from a nontrusted remote host.
COPY/RCP, RCP,SCP,SFTP rcp,scp,sftp :   Copy to/from a trusted remote host.
CREATE touch :   Create or update a file.
CREATE/DIRECTORY mkdir :   Create a subdirectory.
CREATE filename cat >filename : create a file from keyboard input
DEBUG dbx :   Debug a program.
DELETE rm :   Delete a file.
DELETE/CONFIRM rm -i :   Confirm deletion.
DELETE/ENTRY lprm :   Remove queued line printer job.
DELETE/QUEUE lprm -P :   Remove all jobs from the queue.
DELETE/LOG rm -e :   Delete files and list them as they are deleted.
DELETE/SYMBOL unset :   Get rid of an environment variable.
DELETE x.DIR; rmdir :   Delete an empty subdirectory.
DIFFERENCES diff :   Display all differences in files or directories.
DIFF/MAXIMUM_DIFF=1 cmp :   Display first difference in two files (typically used with binary files).
DIFF/NUMBER NL: cat -n :   Display a file with line numbers.
DIFF/SLP diff - e :   Generate editing changes for the ed editor.
DIRECTORY [...] ls -R :   Do a recursive directory/list of files.
DIRECTORY [...] find :   Find a file
DIRECTORY *.DIR ls -d :   List directory name(s) only ls -Rd
DIRECTORY ls :   List files.
DIRECTORY/BY_OWNER ls -l dir | grep owner :   List only those files owned by a specifed user.
DIRECTORY/COLUMN ls -1 :   List one file per line.
DIRECTORY/DATE ls -c :   List by creation/last modification.
DIRECTORY/FULL ls -l :   Long listing.
DIRECTORY/TOTAL du :   Summarize disk usage.
DIRECTORY/MODIFIED/SINCE [...] find -mtime +n :   Modified more than n days ago.
DIRECTORY/MODIFIED /BEFORE [...] find -mtime +n :   Modified more than n days ago.
DIRECTORY/OWNER ls -g :   Include group (used with |).
DIRECTORY/SIZE ls -s :   Include size.
DISMOUNT/UNLOAD mt rewofmt offline :   Rewind and unload the tape.
DUMP od :   Dump a file in various formats.
DUMP/HEXADECIMAL od -h :   Hexadecimal dump.
DUMP/OCTAL od -o :   Octal dump.
EDIT/EDT,EDIT/EVE,EVE vi :   Screen editor session.
EDIT/RECOVER vi -r :   Recover a screen editing session.
EXCHANGE dd :   Back up, restore, and convert nonstandard files.
EXIT exit :   Terminate a script.
HELP man :   Display online reference pages.
HELP HINTS man -k topic :   Display a list of commands that correspond to the specified topic.
INQUIRE/NOPUNCTUATION read choice? :   Prompt for a responce and put the response into an environment variable.
INITIALIZE device: fddisk -fmt device :   Format a diskette.
LIBRARY ar :   Library maintainer.
LIBRARY/CREATE ar -cr :   Create library.
LIBRARY/EXTRACT ar -x :   Extract modules.
LIBRARY/INSERT ar -q :   Insert modules.
LIBRARY/LIST ar -t :   List modules.
LIBRARY/REPLACE ar -r :   Replace modules.
LINK ld :   Link compiled source code into an executable image.
login procedure .login .cshrc .profile .kshrc
Set of commands automatically executed at login time.
On OpenVMS, LOGIN/CLI specifies an alternate command language interpreter.
LOGOUT logout C shell exit Bourne and Korn shell Terminate a terminal session.
MAIL mail :   Invoke the mail utility.
MERGE sort -m :   Merge sorted files.
MOUNT mount :   Mount a tape.
ON COUNTROL_C THEN trap 2 :   Enable handler for Stop signal.
ON CONTROL_Y onintr :   On interrupt.
PHONE talk tty name :   Communicate interactively with another user.
PRINT lpr :   Print a file on the default line printer.
PRINT/COPIES=n lpr -#n :   Print n copies.
PRINT/DELETE lpr -r :   Remove file after printing
PRINT/FORM lpr -ln :   Make page n lines (default = 66)
PRINT/FORM lpr -n :   Print n column output.
PRINT/FORM lpr -wn :   Set line width to n
PRINT/HEADER pr -h string | lpr :   Print a header on each page.
PRINT/NAME=jobname lpr -Jjobname :   Include job name on the first page of the job.
PRINT/NOFLAG lpr -h :   Print with no header page.
PRINT/NOTIFY lpr -m :   Send mail upon completion.
PRINT/PAGES=(n,?) lpr +n :   Begin printing on page n.
PRINT/QUEUE lpr -Pqueue :   Print a file on the specified queue.
READ read :   Read input (korn shell)
RECALL/ALL history :   Recall command lines
REPLY/USER write :   Send a brief message to a logged-in user
RENAME mv :   move/rename a file(s)
RENAME/CONFIRM mv -i :   confirm the move/rename of a file(s)
SEARCH grep :   Search files for strings.
SEARCH/MATCH=NOR grep -v :   List only lines that do not match
SEARCH/NOEXACT grep -i :   Ignore case distinctions.
SEARCH/NUMBERS grep -n :   Precede each match with line number.
SEARCH/STATISTICS grep -c :   List only a file name that contains match
SEARCH/WINDOW=0 grep -l :   Return only file name(s) that contains match
SEARCHfile pattern/WINDOW=5 more -5 +/pattern file :   Display search line plus two lines before and after. (Terminate with q).
SEARCHfile pattern/WIND=(5,0) cat file | more -5+pattern :   Display search line plus next five lines.
SET DEFAULT cd :   Change directory.
SET FILE/OWNER chgrp :   Change group ownership of a file.
SET FILE/PROTECTION chmod :   Change file protection.
SET FILE/ENTER ln :   make file alias, create link.
SET HOST rlogin :   Network login to trusted host.
SET HOST/DTE tip :   Dial remote host.
SET HOST 0/LOG script :   Record a transcript of a terminal session.
SET PASSWORD passwd :   Change you local password.
SET PROCESS/PRIORITY nice or renice :   Change the priority of a process.
SET PROTECTION/DEFAULT umask :   Change default protection for files not yet created.
SET TERMINAL tset or stty :   Set terminal characteristics.
SET VERIFY ksh -x orcsh -x :   Verify command or script execution. Echo after variable substitution.
SHOW DEFAULT pwd :   Display current directory.
SHOW DEVICE/FULL df :   filesystem Display information on a file system
SHOW LOGICAL printenv :   Display environment characteristics.
SHOW PROCESS/ALL ps -l :   Dislay all processes on system.
SHOW/QUEUE lpq :   Display default print queue status.
SHOW STATUS time :   Display resources used by a process.
SHOw TIME date :   Display date and time
SHOW USERS who :   Display the list of current system users.
SORT sort :   Sort and merge.
SORT/KEY sort +fskip.cskip /-fskip.cskip :   Starting/ending porint of sort key.
SORT/OUTPUT sort -o file :   Direct output to file.
SPAWN/NOWAIT bg :   Move a process to the background (command &).
STOP/ID kill -9 :   Remove a process.
SUBMIT at :   Start a process at a latter time.
TYPE cat :   Display a file
TYPE/PAGE=SAVE more :   Display a file, pausing after each page.
TYPE/PAGE NL: clear :   Clear the terminal screen.
WRITE file /bin/echovar > file :   Create a file and write a string or the contents of a variable to it.
WRITE file /bin/echovar >> file :   Append a string or the contents of a variable to an existing file.
WRITE SYS$OUTPUT echo (c Shell) print (Korn) Write to standard output.

OpenVMS Mathematical Operators Function Equivalents

.EQ. ==
Equal to
.EQS. ==
string Equal to
.NE. !
Not equal to
.NES. !
string Not equal to
.AND. &&
Boolean and
.OR. ||
Boolean or
.GT. >
Greater than
.GTS. >
string Greater than
.GE. >=
Greater than or equal to
.GES. >=
string Greater than or equal to
.LT. <
Less than
.LTS. <
string Less than
.LE. <=
Less than or euqal to
.LES. <=
string Less than or euqal to
+ +
add
- -
Subtract
* *
Multiply
/ /
Divide
var + 1 var++
Increment by 1
var - 1 var--
Decrement by 1
.NOT. ~
1's complement
.NOT. !
Logical negation
.OR. |
Inclusive OR
.AND. &
And

OpenVMS Lexical Function and Unix Equivalents

F$ENVIRONMENT("INTERACTIVE") tty -s
Determine if you are an interactive user.
F$EXTRACT(start,length,string) cut -c
Locate fields in a test string and write them out.
F$ELEMENT(element#,delimiter,string) cut -f -d awk
Locate delimited fields in a test string.
F$ENVIRONMENT("PROCEDURE") $0 (Korn)$arg [0] (C)
Get name of currently executing script.
F$TRANSLATE("SYS$SYSDEVICE") sizer -r
Get name of the device from which the operating system bootstrapped.
F$GETDVI("TT:","DEVNAM") tty -s
Determine the name of the terminal you are using.
F$GETSYI("HW_NAME") sizer -c
Get model name of the CPU
F$GETSYI("HW_MODEL") sizer -wt
Return workstation device type
F$GETSYI("VERSION") sizer -bstrings /vmunix | grep "(Rev" uname -a
Determine booted kernel's file name and system version.
F$GETSYI("PHYSICALPAGES") uerf -r 300 -R | grep physical (+2)wc -c/dev/mem
Get the physical memory on a system.
F$GETSYI("BOOTTIME") who -b
Get system boot time.

Unix Branching Statements

DCL command procedures rely on the statements if, gosub, call, and goto for program branching. The shells under unix offer several branching statements.
Shell Branching Statements Offered

csh if, goto, while, foreach, switch, shift
ksh do, case, elif, for, function, if, select, time, until, while
sh if, for, while, until, case

Debugging Shell Scripts

Debugging of shell scripts is done by invoking ksh or sh scripts with the -x and -v flags. Debuging of C shell scripts by invoking them with the -v, -V, -x or -X flags. The result is like using the OpenVMS command set verify.
This html file is based on a text file saved from comp.os.vms years ago, credit goes to the unknown author; I don't claim any Copyrights.
J.Huber March 1998