This is a translation from text into HTML of an old tutorial I
gave. The translation is incomplete. Sorry. I'll finish it
eventually.
- Intro to the Intro
- What this tutorial is
- Introduction to Linux/Unix
- I will focus on Linux, but most stuff is applicable to other
Unices, too.
- Enough to get you comfortable with the system and able to learn
more on your own.
- What this tutorial is not
- How to install Linux -- do that at Installfest
- How to use <large program> -- teaching basics
- Intro to graphical tools -- Unix's heart is text
- Logging in
- Linux is multi-user
- Knows the "identity" of different users.
- Each user has a name -- who they are -- and password -- proof
that they are who they claim to be.
- Keeps user's stuff separate from the others
- Type user name and password at prompt
- Rejoice! (Or retype...)
- Non-local systems
- Can log in to machines across the network.
- Briefly mention X's network transparency, too
- Use program for sending text across the network
- telnet
- widely supported (windows has telnet program)
- insecure -- plaintext
- ssh
- Basic commands
- Concepts
- type command on command line, press enter
- "pieces" are separated by spaces
- first piece is command name -- there is a program with that
name somewhere on the system
- last are arguments necessary to functioning of command --
often files
- Ex: rm <file>
- Ex: ssh <computer>
- In the middle are options, usually starting with dash
- Ex: rm -f <file>
- Ex: ssh -v <computer>
- Useful commands
- ls
- lists all files in a directory.
- ls -l gives the long version of the directory
listing, showing permissions, access times, and other useful
info.
- In UNIX, all files beginning with a dot are
considered "hidden"; ls -a will display all files in the
directory, including these.
- ls -R will give you a recursive listing of the
directory.
- These options (and others!) can be combined like so: ls
-alR. This is true of most UNIX commands.
- mv
- moves one file to another. The syntax is mv oldfile newfile.
Since UNIX doesn't have a "rename" command, this is what you
use. It can also move directories.
- cp
- copies a file. The syntax is cp oldfile newfile.
- pwd
- Displays the present working directory, e.g., "Where am I"?
- cd
- Changes directories. The syntax is cd newdirectory.
- mkdir
- Makes a new directory. The syntax is mkdir newdirectory.
- rm
- Deletes a file; the syntax is rm filename. To do a recursive
removal (for a directory), type rm -r filename.
- man
- Brings up the manual page for the specified command. The
syntax is man command . If you don't know the exact command,
you can look for it by typing man -k something, where
something is the object of your desires. Naturally, you can
also type man man for help on man.
- chmod
- Changes the mode, or permissions, of a file or
directory. Modes are covered in more detail below. Like cp,
giving it an option of -R will make the change recursive. The
syntax is chmod value filename.
- less
- Allows you to view a file without editing (and possibly
writing to) it. The syntax is less filename. In typical UNIX
fashion, less is better than it's predecessor, more.
- grep
- Searches a file for a string. The syntax is grep
searchstring filename. grep also has other uses, one of which
is given below.
- tar and gzip
- For compressed archives, similar to Window's .zip or MacOS's
binhex. The extensions for tarred and gzipped archives are
.tar and .gz, respectively. Most often, you will see both at
once, eg foo.tar.gz, or the abbreviation foo.tgz. To
decompress these archives, you can type tar xvzf filename
(this applies to the GNU/Linux version of tar). tar has
literally dozens of options, and the man page is not for the
faint of heart.
- ssh
- This is the UNIX command to evoke Secure Shell, which is a
safe, secure replacement for telnet. The basic syntax is ssh
user@hostname. An example would be ssh r1@linux.umbc.edu.
Phil! Gold