This is what you absolutely need to know before logging in the first time. Relax, it's not much.
filename.extension.version;
.
Under Linux, the version number doesn't exist (big limitation, I know); the
filename has normally a limit of 255 characters and can have as many dots
as you like. Example of filename: This.is_a_FILEname.txt
.
FILENAME.txt
and filename.txt
are two different files;
ls
is a command, LS
is not.
~
' represent backup files.
Now, a table to sum up how to translate commands from VMS to Linux:
VMS Linux
---------------------------------------------------------------------
$ COPY file1.txt; file2.txt; $ cp file1.txt file2.txt
$ COPY [.dir]file.txt;1 [] $ cp dir/file.txt .
$ COPY [.dir]file.txt;1 [-] $ cp dir/file.txt ..
$ DELETE *.dat.* $ rm *dat
$ DIFF file1 file2 $ diff file1 file2
$ PRINT file $ lpr file
$ PRINT/queue=queuename file $ lpr -Pprintername file
$ SEARCH *.tex.* "geology" $ grep geology *tex
For other examples involving directories, see below; for details about protections, ownership, and advanced topics, see Section Advanced Topics.
[top.dir.subdir]
; under Linux, /top/dir/subdir/
.
On the top of the directory tree there's a so-called `root directory'
called /
; underneath there are other directories like
/bin
, /usr
, /tmp
, /etc
, and others.
/home
contains the so-called users' `home
directories': e.g. /home/guido
, /home/warner
, and so on.
When a user logs in, they start working in their home dir; it's the
equivalent of SYS$LOGIN
. There's a shortcut for the home directory: the
tilde '~
'. So, cd ~/tmp
is the same as, say, cd
/home/guido/tmp
.
.
and refers to the
directory itself (like []
), and ..
that refers to the parent
directory (like [-]
).
And now for some other examples:
DOS 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
$ SET DEF [-] $ cd ..
$ SET DEF [top.dir.subdir] $ cd /top/dir/subdir
$ SET DEF [.dir.subdir] $ cd dir/subdir
$ SHOW DEF $ pwd
For protections, ownership, and advanced topics, see Section Advanced Topics.
.EXE
or .COM
and can be called whatever you like. Executable files are marked by an
asterisk '*
' when you issue ls -F
.
RUN
PROGRAM.EXE
or @COMMAND
). Caveat: it's essential that the file be
located in a directory included in the path, which is a list of
directories. Typically, the path includes dirs like /bin
,
/usr/bin
, /usr/X11R6/bin
, and others. If you write your
own programs, put them in a directory you have included in the path (see how
in Section
Configuring). As an alternative,
you may run a program specifying its complete path: e.g.,
/home/guido/data/myprog
; or ./myprog
, if the current
directory isn't in the path.
/OPTION=
under VMS, and
with -switch
or --switch
under Linux, where switch
is a
letter, more letters combined, or a word. In particular, the switch -R
(recursive) of many Linux commands performs the same action as [...]
under VMS;
$ command1 ; command2 ; ... ; commandn
/OUTPUT=
of many
commands), but has a key role under Unix. A typical example:
$ myprog < datafile | filter_1 | filter_2 >> result.dat 2> errors.log &
which means: the program myprog
gets its input from the file
datafile
(via <
), its output is piped (via |
) to
the program filter_1
that takes it as input and processes it, the
resulting output is piped again to filter_2
for further working, the
final output is appended (via >>
) to the file result.dat
,
error messages are redirected (via 2>
) onto the file
errors.log
. All this in background (&
at the end of the
command line). More about this in Section
Examples.
For multitasking, `queues', and the like, see Section Advanced Topics.
Now we are ready do try Linux out. Enter your login name and password
exactly as they are. For example, if your login name and password
are john
and My_PassWd
, don't type John
or
my_passwd
. Remember that Unix distinguishes between capital and
small letters.
Once you've logged in, you'll see a prompt; chances are it'll be something
like machinename:$
. If you want to change the prompt or make
some programs start automatically, you'll have to edit a `hidden' file
called .profile
or .bash_profile
(see example in Section
Configuring). This is the equivalent of
LOGIN.COM
.
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.
Now you may want to start X Window System (from now on, X). Type the
command startx
and wait a few seconds to find yourself in a graphic
environment; most likely you'll see an open xterm
or equivalent
terminal emulator, and possibly a button bar. (It depends on how your
sysadm configured your Linux box.) Left click on the desktop to see
a menu.
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.
Type the following command to list your home dir contents, including the hidden files:
$ ls -al
Press SHIFT-PAG UP to back-scroll. Now get help about the ls
command
typing:
$ man ls
pressing 'q' to exit. To end the tour, type exit
to quit your session.
If now you want to turn off your PC, press CTRL-ALT-DEL and wait a few
seconds (never switch off the PC while in Linux! You could damage the
filesystem.)
If you think you're ready to work, go ahead, but if I were you I'd jump to Section Advanced Topics.