2012/11/29

OpenVMS commands for the Unix/Linux minded

As an OpenVMS Enthusiast, I would recommend anyone on Unix/Linux to move to OpenVMS. You might, or might not want to do so, but that is up to you. Anyway, if you want to try and play with it, you can always get an account at the DEATHROW OpenVMS Cluster.
OpenVMS does not by default have a shell like Unix/Linux. Instead, it has a command interpreter, which is very powerful. Most users that come from a different platform have problems with the command syntax. I recently found this link on Stack Overflow in an answer about the equivalent of the history command.
The page on the link above was not very well formatted, I provide the list of command equivalents here in a more readable form (btw. not verified any of them). The other information on the page is for some other post. There are several of these lists on the internet, so maybe I will post another one later.
OpenVMSUnix/LinuxDescription
APPENDcatConcatenates files. If contencs of file1 need to be placed at the end of file2 issue the following unix command.cat file1 >> file2
ASSIGN or DEFINE=(Bourne & Korn)
set (C shell)
in Bourne or Korn shell DIR = ls
in C shell set DIR ls
DIRlsList file in the current directory
ATTACHfg
BACKUPtar
pax
back up files into a tar file.
/INITtar -c
pax
Restore files.
/LISTtar -tList contents.
/LOGtar -vReport progress.
/NOREWINDtar -rWrite at end of existing backup (tar) files.
/RECORDtar -mUpdate file's modification date upon restore.
COPYcpCopy a file
COPYftpCopy to/from a nontrusted remote host.
COPYrcpCopy to/from a remote host.
COPY /CONFIRMcp -iConfirm before copying.
CREATE touchCreate or update a file.
/DIRECTORYmkdirCreate a subdirectory.
CREATE filenamecat << filenameCreate a file from the keyboard.
CREATE filenamecat
DEBUGdbxDebug a program.
DELETErmDelete a file.
DELETErmdirDelete an empty subdirectory.
/CONFIRMrm -iConfirm deletion.
/ENTRYlprmRemove queued line printer job.
/QUEUElprm -PRemove all jobs from the queue.
/LOGrm -eDelete files and list them as they are deleted.
/SYMBOLunsetGet rid of an environment variable.
DIFFERENCESdiffDisplay all differences in files or directories.
/MAXIMUM_DIFF= 1cmpDisplay first difference in two files (typically used with binary files).
/NUMBER NL:cat -nDisplay a file with line numbers.
/SLPdiff - eGenerate editing changes for the ed editor.
DIRECTORYlsList files.
DIRECTORY [...]ls -RDo a recursive directory/list of files.
DIRECTORY [...]findFind a file
DIRECTORY *.DIRls -dList directory name(s) only ls -Rd
/BY_OWNERls -l dir | grep ownerList only those files owned by a specifed user.
/COLUMNls -1List one file per line.
/DATEls -cList by creation/last modification.
/FULLls -lLong listing.
/FULL /TOTALduSummarize disk usage.
/MODIFIED /SINCE [...]find -mtime +nModified more than n days ago.
/MODIFIED /BEFORE [...]find -mtime +nModified more than n days ago.
/OWNERls -gInclude group (used with |).
/SIZEls -sInclude size.
DISMOUNT /UNLOADmt rewofmt offlineRewind and unload the tape.
DUMPodDump a file in various formats.
/HEXADECIMALod -hHexadecimal dump.
/OCTALod -oOctal dump.
EDIT /EDT,EDIT /EVE, EVEviScreen editor session.
EDIT /RECOVERvi -rRecover a screen editing session.
EXCHANGEddBack up, restore, and convert nonstandard files.
EXITexitTerminate a script.
HELPmanDisplay online reference pages.
HELP HINTSman -k topicDisplay a list of commands that correspond to the specified topic.
INQUIRE /NOPUNCTUATIONread choice?Prompt for a responce and put the response into an environment variable.
INITIALIZE device:fddisk -fmt deviceFormat a diskette.
LIBRARYarLibrary maintainer.
/CREATEar -crCreate library.
/EXTRACTar -xExtract modules.
/INSERTar -qInsert modules.
/LISTar -tList modules.
/REPLACEar -rReplace modules.
LINKldLink compiled source code into an executable image.
login procedure LOGIN.COM.login
.cshrc
.profile
.kshrc
Set of commands automatically executed at login time.
 On OpenVMS, LOGIN/CLI specifies an alternate command language interpreter.
LOGOUTlogout C shell
exit Bourne & Korn shell
Terminate a terminal session.
MAILmailInvoke the mail utility.
MERGEsort -mMerge sorted files.
MOUNTmountMount a tape.
ON CONTROL_C THENtrap 2Enable handler for Stop signal.
ON CONTROL_YonintrOn interrupt.
PHONEtalk tty nameCommunicate interactively with another user.
PRINTlprPrint a file on the default line printer.
/COPIES=Nlpr -#nPrint n copies.
/DELETElpr -rRemove file after printing
/FORMlpr -lnMake page n lines (default = 66)
/FORMlpr -nPrint n column output.
/FORMlpr -wnSet line width to n
/HEADERpr -h string | lprPrint a header on each page.
/NAME=jobnamelpr -JjobnameInclude job name on the first page of the job.
/NOFLAGlpr -hPrint with no header page.
/NOTIFYlpr -mSend mail upon completion.
/PAGES=(n,"")lpr +nBegin printing on page n.
/QUEUElpr -PqueuePrint a file on the specified queue.
READreadRead input (korn shell)
RECALL /ALLhistoryRecall command lines
REPLY /USERwriteSend a brief message to a logged-in user
RENAMEmvmove/rename a file(s)
/CONFIRMmv -iconfirm the move/rename of a file(s)
SEARCHgrepSearch files for strings.
/MATCH=NORgrep -vList only lines that do not match
/NOEXACTgrep -iIgnore case distinctions.
/NUMBERSgrep -nPrecede each match with line number.
/STATISTICSgrep -cList only a file name that contains match
/WINDOW = 0grep -lReturn only file name(s) that contains match
file pattern /WINDOW=5more -5 +/pattern fileDisplay search line plus two lines before and after. (Terminate with q).
file pattern /WIND=(5,0)cat file | more -5+patternDisplay search line plus next five lines.
SET DEFAULTcdChange directory.
SET FILE/OWNERchgrpChange group ownership of a file.
SET HOSTrloginNetwork login to trusted host.
SET HOST /DTEtipDial remote host.
SET HOST 0 /LOGscriptRecord a transcript of a terminal session.
SET PASSWORDpasswdChange you local password.
SET PROCESS /PRIORITYnice
renice
Change the priority of a process.
SET PROTECTIONchmod Change file protection.
/DEFAULTumaskChange default protection for files not yet created.
SET TERMINALtset
stty
Set terminal characteristics.
SET VERIFYksh -x
csh -x
Verify command or script execution. Echo after variable substitution.
SHOW DEFAULTpwdDisplay current directory.
SHOW DEVICE /FULLdf filesystemDisplay information on a file system
SHOW LOGICALprintenvDisplay environment characteristics.
SHOW PROCESS /ALLps -lDislay all processes on system.
SHOW /QUEUElpqDisplay default print queue status.
SHOW STATUStimeDisplay resources used by a process.
SHOW TIME dateDisplay date and time
SHOW USERSwhoDisplay the list of current system users.
SORTsortSort and merge.
/KEYsort +fskip.cskip
sort -fskip.cskip
Starting/ending porint of sort key.
/OUTPUTsort -o fileDirect output to file.
SPAWN /NOWAITbgMove a process to the background.
STOP /IDkill -9Remove a process.
SUBMIT atStart a process at a latter time.
TYPEcatDisplay a file
/PAGEmoreDisplay a file, pausing after each page.
/PAGE NL:clearClear the terminal screen.
WRITEecho var > fileCreate a file and write a string or the contents of a variable to it.
WRITEecho var >> fileAppend a string or the contents of a variable to an existing file.
WRITE SYS$OUTPUTecho (c Shell)
print (Korn)
Write to standard output.
Of course it is possible to have a bash shell on OpenVMS. That requires the installation of GNV (open source project at SourceForge).

1 comment:

  1. as promised, at labs.hoffmanlabs.com which I regularly visit for OpenVMS related searches you can find another list: DCL and bash command comparison.

    ReplyDelete