If you have heard a little bit about computer history or have read old-time hackers talk about their favorite machines, such as in the Jargon File [http://www.tuxedo.org/~esr/jargon/], then you probably have this vague idea of the pool of primordial soup embodied in the operating systems of the past. PDP-10, MULTICS, VAX, VMS, TOPS-20, CP/M, blah blah blah....what is all this? In order to really know ones stuff computerwise, many sources, mostly reflecting an older viewpoint, say that you should know about all of this stuff. Today, one can navigate the Internet in all of its depth without knowing a thing about VMS, the topic at hand. For a few reasons, however, I still think its worth having at least some familiarity with for the well-rounded hacker.
GETTING AN ACCOUNT:
VMS computers are still out there--running particle accelerators, car factories, and other things you are less likely to get your hands on than, say, an account from school or work [http://www.neurophys.wisc.edu/comp/vms_serv.html] or a free provider [http://vmsbox.cjb.net/vms-accounts.html].
HISTORY:
VMS is an operating system developed for a type of computer called the VAX. This was created as the next step after the PDP-11 computer, which had been a very popular one among serious computer nerds. The VAX became as popular, or even more so, especially when BSD UNIX went into a sucky phase in the mid-eighties.
Although VMS 1.0 dates back to 1978, about a decade later than the first UNIX kernel, VMS was a serious industrial operating system when UNIX was mostly for hobbyists and students. Digital Equipment Corporation (DEC, the company that developed it,) had the money and user legacy to make VMS mainstream right away, although eventually UNIX took over as the OS of the Internet because you didnt have to buy expensive DEC hardware, and students already knew the UNIX OS out of college. VMS has changed hands since it was developed--these days is known as OpenVMS and it runs on other computers than just VAXen. (VAXen, is, of course, the plural of VAX.) For the purposes of this tutorial, VMS and OpenVMS are the same thing.
Not everyone likes VMS, but it is often said that it is more secure and more reliable than UNIX, and some even go so far as to say, easier to use. Woah.
GETTING STARTED: How basic commands work
VMS proponents claim that one thing that makes their OS better is that commands are just English words and not weird, cryptic combinations of abbre- viations like in UNIX and DOS. It is largely true--if you just type some likely-sounding words at the prompt, theyll often turn out to be commands. Of course, like any command-line interface, there are still lots of commands and symbols that are far from intuitive.
When you are ready to start entering commands, youll know it because the prompt is a dollar sign:
$
Cha-Ching! The first command that you should probably know is DIRECTORY. In VMS you dont really have a home directory like you do in UNIX. What VMS uses is kind of a compromise between the home directory con- cept and the working directory concept. If you dont know UNIX, dont get all worried, its not that important to this concept. VMS has what is called a default directory, and this is what will be displayed when you enter the DIRECTORY command. You will get a few different lines with the names of the files on that directory printed two or three on a line.
There are various ways to get more information about these files. If you want to see how much space the files take up, type DIRECTORY/SIZE=ALL. Now each file is listed on its own line, and to the right of it is a frac- tional number. Whats this about? Well, because VMS is old and weird, instead of listing the file size by the number of bytes or something like that, it gives it in file blocks. If the fraction after a file is something like 8/8 then its taking up eight file blocks, where each block is 512 bytes for some reason. If the fraction is something like 1/4, then this means that one block is in fact being taken up, but four are allocated for this file. If you have limits on how much you can store in your directories, then a file with a file size 1/4 would in fact be considered as taking up four blocks. Doesnt seem fair I know, but thats how it works.
DIRECTORY/OWNER would show you who owns the files in a directory. If we are still in your default directory, its probably going to be your login name shown as the owner. If you want to see both of these things at once, you can combine them into DIRECTORY/OWNER/SIZE=ALL. These two things, OWNER and SIZE are called parameters and can be put in any order, so DIRECTORY/SIZE=ALL/OWNER would also work. The ALL following the equals sign is called an option, it just tells the computer that we want both sides of the fraction that we get from the size command, instead of just one. For this reason, the ALL must always be right after the SIZE. There are various other parameters as well, the /SECURITY parameter will tell you about the security of files, if you know what youre looking at, and /DATE will tell you when a file was made. If you dont want to fool around with all these different parameters, use DIRECTORY/ALL to display all the information that is available about all the files in a directory. If you try this you may find that there is much more information than can be displayed on one screenfull--add the /PAGE parameter to the end of this command to make things come at you one page at a time. This is a lot like the more command that you may be used to.
Make sense? Really its not that hard since all the commands are English words and you can just keep adding them on as parameters. VMS has a few features that make it even easier. First of all, unlike UNIX, VMS is not case-sensitive--Ive been putting commands in all caps here, but really DIRECTORY is the same as directory is the same as Directory. Also, you dont usually have to type out the whole name of a command or parameter, you only have to provide as many letters as will distinguish it from other commands. For example, the command DIRECTORY/OWNER could just as well be DIR/OWN and still work the same.
OK, now that you have seen you default directory in about a hundred different ways, lets take a closer look at the files that are in it. Youll see a bunch of files that look something like this:
MAIL.MAI;1
In VMS this is called a file specification. MAIL is the name of the file and MAI is the file type or file extension, just like in UNIX and DOS. The 1 is the file version. You see, every time you change a file, rather than writing over the old file, VMS simply creates a new file with a version number one higher than the last one for that same file name. So if you change MAIL.MAI;1 youll end up with a MAIL.MAI;2 as well. (This helps you by preserving your data in case you screw up, and also makes dating files easier.) This is not the whole file specification, either. File specs can get pretty long and involved, but if you wanted to be a little more specific about this file, you have to include the directory that it resides in. This is a little like a pathname in other OSs. Every time you use the DIRECTORY command, the computer should tell you the name of your default directory. Its up there at the top of the output, in brackets, like this:
[SKINNER]
Or at least thats the name of mine, you will of course have to substi- tute your own directories names in the examples. So, now that we know the directory name, we know that this file could be called [SKINNER]MAIL.MAI;1. When I issue a command that relates to this file, I dont have to put in the directory name [SKINNER], because the computer will assume it as long as [SKINNER] is my default directory. Also I dont have to put the version number, because the computer will assume that I mean the most current one unless I specify otherwise. There are often other directories under your present default directory--these you will see, if you have any, as files that have a .DIR file extension. Lets say that you have a directory with your web page in it called [WEB]. This will be listed as a file called WEB.DIR;1. When you refer to this directory in commands, the computer already knows that its a directory, so you dont need to type the file extension, as in other files. You also dont need to put the version number. What you do need to do is refer to it by its complete file specifi- cation in relative to the default directory. If you want to list the contents of the [WEB] directory, you have to type DIRECTORY [SKINNER.WEB] to do this. The names of different directories are put together and separated by periods like this, up to seven layers deep usually. If you dont want to have to type the [SKINNER.WEB] part, you can do this by changing the default directory to [SKINNER.WEB]. Simply type SET DEFAULT [SKINNER.WEB] at the prompt. Now just a regular DIRECTORY or DIR command will show you whats in your web pages directory. You dont really have to change your default directory to do most day-to-day tasks, it just makes the commands shorter.
Any commands in which you dont give a file specification or the direct- ory portion of you file specification are assumed to apply to your home directory. If you are familiar with DOS you may know of the TYPE command. If you were like me you were probably wondering why they didnt use cat instead, because many UNIX commands are the same as DOS ones. Well, it turns out that TYPE is a command that comes from VMS. Lets say you have a file in [SKINNER.WEB] called INDEX.HTML;1. If [SKINNER] were your default directory you would give the command TYPE [SKINNER.WEB]INDEX.HTML, but if [SKINNER.WEB] were your home directory, you could simply give TYPE INDEX.HTML as the command.
USEFUL KEY COMBOS:
Sometimes telnet connections dont really like to let you use the delete key. I dont really know why, and Ill admit it sucks, because some of these commands can get confusing. In VMS you can use the Ctrl+J charac- ter to delete the last word you typed. This can be a handy substitute for normal deleting. Also, if you really screw up or you just dont know how to get out of some program or other, the Ctrl+C combo will interrupt it for you.
TCP/IP COMMANDS AND UTILITIES:
One thing that I really didnt understand until about the same time as I started to get into VMS is the equivalency of all computers on the Internet. I had always read about, and always thought of, the Internet as being divided into clients and servers. I was a client, running Windows, separated by a dial-up connection, and was strangely unable to do all the mysterious things that Internet servers, usually UNIX, were able to do. Then I picked up a book about TCP/IP commands that treated all OSs equals, something that I had never really thought of before. Of course, in truth any computer on the Internet has just as much potential as another, its just that I wasnt running any server-side software. Part of the real beauty of the Net is that TCP/IP commands are pretty much universal and will often work at the command prompt of any major OS--DOS, UNIX, VMS and others.
FTP:
The FTP program on VMS systems works just like any other command prompt FTP system on any OS. You have it on your Windows box even if you dont know it. Just type FTP and the name of the system at the prompt. Then all commands are the same, DIR to look at a list of directories, CD and the name of a directory to change to that directory, GET and a filename or filespec to download a file, PUT to upload one. The only thing that I have found tends to be different from the DOS FTP in VMS is that I have to type USER and my username instead of being explicitly asked for my username.
Telnet:
Another TCP/IP command that is no doubt familiar to you Windows users, since you are probably Telnetting to your VMS account in the first place. Some versions of Windows have a Graphical telnet client, but the command- line one is pretty much the same, youll catch on quick.
Other TCP/IP commands that you may find are finger, rsh, rlogin, and you may even have a web browser.
The VMS MAIL program is very easy to use. To activate it type MAIL at the dollar sign, and you will get the MAIL> prompt. Typing READ or simply pressing Return will show you your most recent mail messages in full. If you want to see a list, just use the ol DIRECTORY command. To read a message from this list, type in the appropriate message number. MAIL has an internal set of help files, just type HELP at the MAIL> prompt. Many computers will also be found to be running pine if you are more familiar with this mail reader.
GETTING TO KNOW THE SYSTEM and generally having some fun with it
If youre already board minding your own business and want to snoop around a little, one thing you should learn how to use is the SHOW command. This does pretty much what youd expect--it, uh, well, it shows you stuff.
Information about yourself:
SHOW PROCESS will give you information about your system process. Everything that the system does is represented as something called a system process. Sitting there and waiting for you to make up commands is one of them. SHOW PROCESS gives you information such as what your processs number is, where in the system in is running, etc.
SHOW TERMINAL will show you how your computer is expected or allowed to interact with the system and give you an idea of how closely it approximates real DEC keyboard functions, which are different than any other computer. VAXen have buttons on the keyboard that you dont even have.
Information about the system:
SHOW SYSTEMwill give you a complete process list for the whole system. Add /FULL to the end of this command for more information about the processes.
SHOW TIME will, oddly enough, tell you the time and date that the system thinks it is. If you happen to have no clue where your system is and youre wanting to find out, youll be able to calculate the timezone from this.
Information about other users:
SHOW USERS will give you a list of all the users who are logged in at the present time. Adding /FULL will not only give you more information but will show it to you in a different format, unusual for VMS commands.
Also if youve ever messed around with the FINGER utility, you know what its all about. Just typing FINGER will give you a list of the users who are interactively logged in, as you may have seen in the output from SHOW USERS. If you qualify FINGER with a username you will get more specific information about that user. If you were to finger me (pardon the expression) youd type FINGER SKINNER at the prompt. You would get back such fascinating information as my process ID, the address of the terminal from which I am accessing the system, a little bit about what Im doing, my real name if the system admin has it, and also any other information that I have chosen to enter about myself.
FURTHER EXPLORING THAT 32-BIT, MANY-SPLENDERED THING KNOWN AS VAX
At this point you may have decided that looking at system information is all well and good, and want to actually change some of the system settings, in which case you may want to start learning about the SET command, as well as some others. Maybe you are not satisfied and want to know a little more about the VMS box. Either way, you need some HELP. The HELP command, followed by the name of another command, will give you a help page about that command. In my opinion the VMS help is much easier to understand than UNIX man pages, although sometimes it is not quite as inclusive.
Besides the HELP command, which only covers commands proper and not general concepts or other terminology, you can search for VMS help on your favorite search engine (which should be Google.com if its not), but sometimes good VMS info on the web can be a little short. Also check out all the official documentation which is mirrored at http://blacksun.box.sk/books/open%20vms.htm Or just screw it and mess around with the system until I decide to write a Part II to this tutorial.
LAST LITTLE NOTE:
OK, well as long as Ive got to finish this thing out somehow, heres something kinda interesting. As you probably know, many tutorials (like this one) end in the letters EOF, which stand for End Of File. Although this abbreviation did not originate in VMS, the usage of it at the end of a text file came about because the VMS editor EVE uses it to signify to the system and the user where an ASCII file ends, like this: