old-www/HOWTO/VMS-to-Linux-HOWTO/short-intro.html

748 lines
13 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML
><HEAD
><TITLE
>Short Intro </TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.7"><LINK
REL="HOME"
TITLE="From VMS to Linux HOWTO"
HREF="index.html"><LINK
REL="PREVIOUS"
TITLE="Introduction "
HREF="introduction.html"><LINK
REL="NEXT"
TITLE="Editing Files "
HREF="editing-files.html"></HEAD
><BODY
CLASS="SECT1"
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>From VMS to Linux HOWTO</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="introduction.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="editing-files.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="SECT1"
><H1
CLASS="SECT1"
><A
NAME="SHORT-INTRO"
></A
>2. Short Intro</H1
><P
>This is what you absolutely need to know before logging in the first
time. Relax, it's not much.</P
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="AEN56"
></A
>2.1. Files</H2
><P
>&#13;<P
></P
><UL
><LI
><P
> Under VMS filenames are in the form <TT
CLASS="LITERAL"
>filename.extension;version</TT
>.
Under Linux, the version number doesn't exist (big limitation, but see
Section <A
HREF="useful-programs.html#NUMBERED-BACKUPS-UNDER-LINUX"
>Section 10.2</A
>); the filename
has normally a limit of 255 characters and can have as many dots as you
like. Example of filename: <TT
CLASS="LITERAL"
>This.is_a_FILEname.txt</TT
>.&#13;</P
></LI
><LI
><P
> Linux distinguishes between upper case and lower case characters:
<TT
CLASS="LITERAL"
>FILENAME.txt</TT
> and <TT
CLASS="LITERAL"
>filename.txt</TT
> are two different files;
<TT
CLASS="LITERAL"
>ls</TT
> is a command, <TT
CLASS="LITERAL"
>LS</TT
> is not.&#13;</P
></LI
><LI
><P
> A filename starting with a dot is a `hidden' file (that is,
it won't normally show up in dir listings), while filenames ending with a
tilde '<TT
CLASS="LITERAL"
>&#732;</TT
>' represent backup files.
&#13;</P
></LI
></UL
>&#13;</P
><P
>Now, a table to sum up how to translate commands from VMS to Linux:</P
><P
>&#13;<TABLE
BORDER="1"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="SCREEN"
>&#13;VMS Linux
---------------------------------------------------------------------
$ COPY file1.txt file2.txt $ cp file1.txt file2.txt
$ COPY [.dir]file.txt [] $ cp dir/file.txt .
$ COPY [.dir]file.txt [-] $ cp dir/file.txt ..
$ DELETE *.dat;* $ rm *dat
$ DIFF file1 file2 $ diff -c file1 file2
$ PRINT file $ lpr file
$ PRINT/queue=queuename file $ lpr -Pprintername file
$ SEARCH *.tex;* "geology" $ grep geology *tex</PRE
></FONT
></TD
></TR
></TABLE
>&#13;</P
><P
>For other examples involving directories, see below; for details about
protections, ownership, and advanced topics, see Section <A
HREF="advanced-topics.html"
>Section 8</A
>.</P
></DIV
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="AEN79"
></A
>2.2. Directories</H2
><P
>&#13;<P
></P
><UL
><LI
><P
> Within the same node and device, directories names under VMS are in
the form <TT
CLASS="LITERAL"
>[top.dir.subdir]</TT
>; under Linux, <TT
CLASS="LITERAL"
>/top/dir/subdir/</TT
>. On
the top of the directory tree lies the so--called `root directory' called
<TT
CLASS="LITERAL"
>/</TT
>; underneath there are other directories like <TT
CLASS="LITERAL"
>/bin</TT
>,
<TT
CLASS="LITERAL"
>/usr</TT
>, <TT
CLASS="LITERAL"
>/tmp</TT
>, <TT
CLASS="LITERAL"
>/etc</TT
>, and others.&#13;</P
></LI
><LI
><P
> The directory <TT
CLASS="LITERAL"
>/home</TT
> contains the so--called users' `home
directories': e.g. <TT
CLASS="LITERAL"
>/home/guido</TT
>, <TT
CLASS="LITERAL"
>/home/warner</TT
>, and so on.
When a user logs in, they start working in their home dir; it's the
equivalent of <TT
CLASS="LITERAL"
>SYS$LOGIN</TT
>. There's a shortcut for the home
directory: the tilde '<TT
CLASS="LITERAL"
>&#732;</TT
>'. So, <TT
CLASS="LITERAL"
>cd &#732;/tmp</TT
> is the same
as, say, <TT
CLASS="LITERAL"
>cd /home/guido/tmp</TT
>.&#13;</P
></LI
><LI
><P
> Directory names follow the same rules as file names. Furthermore,
each directory has two special entries: one is <TT
CLASS="LITERAL"
>.</TT
> and refers to the
directory itself (like <TT
CLASS="LITERAL"
>[]</TT
>), and <TT
CLASS="LITERAL"
>..</TT
> that refers to the parent
directory (like <TT
CLASS="LITERAL"
>[-]</TT
>).&#13;</P
></LI
></UL
>
</P
><P
>And now for some other examples:</P
><P
>&#13;<TABLE
BORDER="1"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="SCREEN"
>&#13;VMS Linux
---------------------------------------------------------------------
$ CREATE/DIR [.dirname] $ mkdir dirname
$ CREATE/DIR [.dir1.dir2.dir3] $ mkdirhier dir1/dir2/dir3
n/a $ rmdir dirname
(if dirname is empty)
$ rm -R dirname
$ DIRECTORY $ ls
$ DIRECTORY [...]file.*;* $ find . -name "file*"
$ SET DEF SYS$LOGIN $ cd
$ SET DEF [-] $ cd ..
$ SET DEF [top.dir.subdir] $ cd /top/dir/subdir
$ SET DEF [.dir.subdir] $ cd dir/subdir
$ SHOW DEF $ pwd&#13;</PRE
></FONT
></TD
></TR
></TABLE
>&#13;</P
><P
>For protections, ownership, and advanced topics, see Section <A
HREF="advanced-topics.html"
>Section 8</A
>.</P
></DIV
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="AEN112"
></A
>2.3. Programs</H2
><P
>&#13;<P
></P
><UL
><LI
><P
> Commands, compiled programs, and shell scripts (VMS' `command
files') don't have sort of mandatory extensions like <TT
CLASS="LITERAL"
>.EXE</TT
> or <TT
CLASS="LITERAL"
>.COM</TT
>
and can be called whatever you like. Executable files are marked by an
asterisk '<TT
CLASS="LITERAL"
>*</TT
>' when you issue <TT
CLASS="LITERAL"
>ls -F</TT
>.&#13;</P
></LI
><LI
><P
> To run an executable file, just type its name (no <TT
CLASS="LITERAL"
>RUN
PROGRAM.EXE</TT
> or <TT
CLASS="LITERAL"
>@COMMAND</TT
>). Caveat: it's essential that the file be
located in a directory included in the <EM
>path of executables</EM
>, which is a
list of directories. Typically, the path includes dirs like <TT
CLASS="LITERAL"
>/bin</TT
>,
<TT
CLASS="LITERAL"
>/usr/bin</TT
>, <TT
CLASS="LITERAL"
>/usr/X11R6/bin</TT
>, and others. If you write your
own programs, put them in a directory you have included in the path (see how
in Section <A
HREF="configuring.html"
>Section 9</A
>). As an alternative,
you may run a program specifying its complete path: e.g.,
<TT
CLASS="LITERAL"
>/home/guido/data/myprog</TT
>; or <TT
CLASS="LITERAL"
>./myprog</TT
>, if the current
directory isn't in the path.&#13;</P
></LI
><LI
><P
> Command switches are obtained with <TT
CLASS="LITERAL"
>/OPTION=</TT
> under VMS, and
with <TT
CLASS="LITERAL"
>-switch</TT
> or <TT
CLASS="LITERAL"
>--switch</TT
> under Linux, where <TT
CLASS="LITERAL"
>switch</TT
> is a
letter, more letters combined, or a word. In particular, the switch <TT
CLASS="LITERAL"
>-R</TT
>
(recursive) of many Linux commands performs the same action as <TT
CLASS="LITERAL"
>[...]</TT
>
under VMS;&#13;</P
></LI
><LI
><P
> You can issue several commands on the command line:
<TABLE
BORDER="1"
BGCOLOR="#E0E0E0"
WIDTH="90%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="SCREEN"
>$ command1 ; command2 ; ... ; commandn</PRE
></FONT
></TD
></TR
></TABLE
>
&#13;</P
></LI
><LI
><P
> Most of the flexibility of Linux comes from two features awkwardly
implemented or missing in VMS: I/O redirection and piping. (I have been told
that recent versions of DCL support redirection and piping, but I don't have
that version.) Redirection is a side feature under VMS (remember
the switch <TT
CLASS="LITERAL"
>/OUTPUT=</TT
> of many commands), or a fastidious process,
like:
<TABLE
BORDER="1"
BGCOLOR="#E0E0E0"
WIDTH="90%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="SCREEN"
>$ DEFINE /USER SYS$OUTPUT OUT
$ DEFINE /USER SYS$INPUT IN
$ RUN PROG</PRE
></FONT
></TD
></TR
></TABLE
>
which has the simple Linux (UNIX) equivalent:
<TABLE
BORDER="1"
BGCOLOR="#E0E0E0"
WIDTH="90%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="SCREEN"
>$ prog &#60; in &#62; out</PRE
></FONT
></TD
></TR
></TABLE
>
Piping is not readily available under VMS, but has a key role under UNIX. A
typical example:
<TABLE
BORDER="1"
BGCOLOR="#E0E0E0"
WIDTH="90%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="SCREEN"
>$ myprog &#60; datafile | filter_1 | filter_2 &#62;&#62; result.dat 2&#62; errors.log &#38;</PRE
></FONT
></TD
></TR
></TABLE
>
which means: the program <TT
CLASS="LITERAL"
>myprog</TT
> gets its input from the file
<TT
CLASS="LITERAL"
>datafile</TT
> (via <TT
CLASS="LITERAL"
>&#60;</TT
>), its output is piped (via <TT
CLASS="LITERAL"
>|</TT
>) to
the program <TT
CLASS="LITERAL"
>filter_1</TT
> that takes it as input and processes it, the
resulting output is piped again to <TT
CLASS="LITERAL"
>filter_2</TT
> for further processing, the
final output is appended (via <TT
CLASS="LITERAL"
>&#62;&#62;</TT
>) to the file <TT
CLASS="LITERAL"
>result.dat</TT
>,
and error messages are redirected (via <TT
CLASS="LITERAL"
>2&#62;</TT
>) onto the file
<TT
CLASS="LITERAL"
>errors.log</TT
>. All this in background (<TT
CLASS="LITERAL"
>&#38;</TT
> at the end of the
command line). More about this in Section <A
HREF="examples.html"
>Section 11</A
>.&#13;</P
></LI
></UL
>
</P
><P
>For multitasking, `queues', and the like, see Section <A
HREF="advanced-topics.html"
>Section 8</A
>.</P
></DIV
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="QUICK-TOUR"
></A
>2.4. Quick Tour</H2
><P
>Now you are ready to try Linux out. Enter your login name and password
<EM
>exactly</EM
> as they are. For example, if your login name and password are
<TT
CLASS="LITERAL"
>john</TT
> and <TT
CLASS="LITERAL"
>My_PassWd</TT
>, <EM
>don't</EM
> type <TT
CLASS="LITERAL"
>John</TT
> or <TT
CLASS="LITERAL"
>my_passwd</TT
>.
Remember, UNIX distinguishes between capital and small letters.</P
><P
>Once you've logged in, you'll see a prompt; chances are it'll be something
like <TT
CLASS="LITERAL"
>machinename:$</TT
>. If you want to change the prompt or make
some programs start automatically, you'll have to edit a `hidden' file
called <TT
CLASS="LITERAL"
>.profile</TT
> or <TT
CLASS="LITERAL"
>.bash_profile</TT
> (see example in Section <A
HREF="configuring.html"
>Section 9</A
>). This is the equivalent of
<TT
CLASS="LITERAL"
>LOGIN.COM</TT
>.</P
><P
>Pressing ALT--F1, ALT--F2, ... ALT--F6 switches between `virtual consoles'.
When one VC is busy with a full--screen application, you can flip over to
another and continue to work. Try and log in to another VC.</P
><P
>Now you may want to start X Window System (from now on, X). X is a graphic
environment very similar to DECWindows---actually, the latter derives from
the former. Type the command <TT
CLASS="LITERAL"
>startx</TT
> and wait a few seconds; most likely
you'll see an open <TT
CLASS="LITERAL"
>xterm</TT
> or equivalent terminal emulator, and possibly
a button bar. (It depends on how your sysadm configured your Linux box.)
Click on the desktop (try both mouse buttons) to see a menu.</P
><P
>While in X, to access the text mode (`console') sessions press
CTRL--ALT--F1 ... CTRL--ALT--F6. Try it. When in console, go back to X
pressing ALT--F7. To quit X, follow the menu instructions or press
CTRL--ALT--BS.</P
><P
>Type the following command to list your home dir contents, including the
hidden files:</P
><P
>&#13;<TABLE
BORDER="1"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="SCREEN"
>$ ls -al</PRE
></FONT
></TD
></TR
></TABLE
>&#13;</P
><P
>Press SHIFT--PAG UP to back-scroll. Now get help about the <TT
CLASS="LITERAL"
>ls</TT
> command
typing:</P
><P
>&#13;<TABLE
BORDER="1"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="SCREEN"
>$ man ls</PRE
></FONT
></TD
></TR
></TABLE
>&#13;</P
><P
>pressing 'q' to exit. To end the tour, type <TT
CLASS="LITERAL"
>exit</TT
> to quit your session.
If now you want to turn off your PC, press CTRL--ALT--DEL and wait a few
seconds (<EM
>never</EM
> switch off the PC while in Linux! You could damage the
filesystem.)</P
><P
>If you think you're ready to work, go ahead, but if I were you I'd jump
to Section <A
HREF="advanced-topics.html"
>Section 8</A
>.</P
></DIV
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="introduction.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="editing-files.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>Introduction</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
>&nbsp;</TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>Editing Files</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>