HOME Top of Unix Eye On The World The World's Information Kiosk
An Overview
When you login to your account, you are placed automatically into your home directory. Configuration files needed to control your processes reside in this area, as do any other files that you create or move there. Each file has a filename that may consist of a single name, or a name with a suffix and/or a prefix. Some examples: .login my.schedule phonelist edit.session.3You'll likely want to learn how to list, read, move, copy, remove and rename those files, view your directory pathname, create directories, change directory and view directory contents among other things. Before
An Introduction to UNIX Commands
The unix command-line format offers a great deal of flexibility and
power to the user. The general command line format for unix is:
world% command options filename
The options, or flags, for unix commands are prefixed with a dash or hyphen. These options come directly after the command and before the filenames.
Example: sz -a my.file
Many unix commands require filename arguments. In this document filenames
are indicated by file1 or file2.
Whenever you see this in an example, you can replace it with the name of
the document you wish to create, access or view. Many commands can be
issued with more than one filename.
Also in this document optional values are indicat
Every command should be followed by a carriage-return or enter. The
command will not be invoked until you press this key.
Command:
Use this command to display the files within the current directory.
It can be used selectively, as
Example:
This means display only those files whose names end with the numbers
Command: ls -a
This command shows all files in a directory, both visible and invisible.
All files preceded by a period are normally invisible, and are not normally
displayed when using
Command:
Example:
This displays the size of the files. Directories will not show the
size of their contents. Use the command du for this.
Command:
Example:
A slash after a name indicates a directory. Other files will be
stored in the directory.
Another symbol you might see looks like this:
Example:
This indicates that
You may see another symbol
Other options exist for listing files in special ways. To view a long
listing of information about the files in your directory, that includes
file protections, file size, and date last edited, use:
Command:
Example:
Command:
Example:
To view the contents of the specified file one page at a time with
pauses. Hit the spacebar to see the next portion. To view previous
screenfuls, use
Command:
Example:
This displays the contents of a file in a rapid scroll without
pausing. Use control-c to abort this.
Command:
Example:
Pico will invoke the text editor used by Pine. This program has menus
and uses arrow keys. If the file specified does not exist, pico will
create a new one by that name. Pico is very user-friendly.
Vi, the text editor found on most UNIX systems, is also available.
Emacs (also on World) is a text editor of exceptional power and
complexity. It features a built-in online tutorial and help system.
A potent tool in the hands of an expert, it can do far more than edit
text. To its devotees, Emacs is not simply an editor, but a way of
life.
The commands needed to use emacs or vi effectively are rather complex, so
we recommend user-friendly Pico.
Command:
The special characters >> will append the contents of file1 to
the end of file2
Command:
Example:
This will create a copy of the file
If you were in the directory
Example:
The tilde "~" here refers to your home directory (see Changing to your Home Directory) and the filename will
remain unchanged. Once you issue this command, a copy of the document
Command:
Example:
Use this command to remove the named file. Any file you saved a few
minutes ago will be gone. Some older files may be found on the World
backups, but you must request a restore, which will take a least a day
for the staff to perform.
To be safe, it is best to assume deletion is FINAL.
Command:
Example:
Thus, the file called
To tell the difference between a file and a directory, use the command
Example:
Command:
The
The output to this command for user jones would be:
world% pwd
/home/ghar/jones
Command:
Use this command to change from the present directory to another
directory.
Example:
Example:
A / (slash) at the beginning of a pathname means "begin at the root
directory". This is similar to beginning at the desktop on a Macintosh,
or begining at C:\ on a PC.
Example:
The command
Command:
Use this command to change the directory back to your home directory
(the directory where your personal files are stored). The ~
(tilde) can always be used as a substitute for the path to your home
directory.
Command:
Example:
WARNING:
It is important to distinguish files from directories! Use the command "ls -F".
For example, if I type:
and these are both *files*, the file
Command:
Example:
Use this command to create a new directory.
Command:
Example:
Use this command to remove an empty directory. You must remove all
contents or the command won't work.
To remove EVERYTHING from a directory, type
Command:
Example:
Disk usage is the total amount of disk space your account is allocated
on World. If your saved mail or other files are large, you may go over
your quota and receive a warning message. Please see the help file
entitled "Diskspace limitations and your files" for further information
surrounding this important issue.
ls
ls *92
92. The * character allows you to save a great
deal of typing.
ls. These files are often called dot
files and are initialization files for the various programs. Some examples
might be:
.login .cshrc .newsrc .mailrc
ls -s
ls -s
1 activists.dir
2 chinese.food.brookline
12 emacs-command-summary
1 fun.internet.dir
27 Internet.books.list
1 key.letters.dir
1 mail
7 march.internet.hunt
ls -F
ls -F
In this example,
ACT_V.Macbeth
Cyberspace.discussion
News/
Alt.Internet.services
Mail/
Mail/ and News/ are directories.
The remaining items are files.
@
obi@
obi@ is a link, an alias which allows
one file or directory to have multiple placements. You can access
these aliases, just as if they were real, using the appropriate
commands.
*. This indicates the file is a World
binary format and can only be used as a World command.
ls -la
ls -la
-rw-rw-r-- 1 freduser freduser 371 Jul 27 1993 .login
-rw-rw-r-- 1 freduser freduser 729 Mar 17 23:07 .cshrc
-rw-r----- 1 freduser freduser 1558 Apr 17 12:43 sallys.humor
-rw-r----- 1 freduser freduser 9441 Mar 24 15:54 wired.info
more file1
more big.file
b for "back." You can search for a
specific word within the text by typing the following command at the
: prompt. You must be in the : program to
use the search command.
/search.pattern
cat file1
cat big.file
pico file1
pico memo.john
cat file1 >> file2
cp file1 ile2
cp roach-attack bugs
roach-attack with the
new name bugs. Another useful example follows.
/ftp/obi/Martin.Luther.King,
you could make a copy of a famous Martin Luther King speech to be placed
into your home directory with the command:
cp free.at.last ~
free.at.last is added your home directory.
rm file1
rm trash.this
mv file1 new-file1
mv file.moving.tips tech.tips
file.moving.tips will be renamed
tech.tips.
If the second name is an *existing* file, this command will
overwrite the first file over the contents of the second file,
thus eliminating the second file. Be sure this is what you want
to do! Look before you leap with the "ls" command.
If the second name is a directory (not a file), the file will be moved
into the directory. See "Move File Into Directory".
ls -F
pwd
pwd stands for "present working directory" and shows what
directory you are in. It indicates the exact path from the root. The
root is the top level of the unix file system, similar to the desktop
on a Macintosh, or C:\ on a PC.
cd directory
cd /pub
cd /sources/macintosh/archivers
cd ..
cd followed by two periods will take you to the
directory one level above the directory you are currently in. For example,
if the path to your current directory is /sources/macintosh,
typing cd .. would change it to /sources.
cd ~
mv file1 directory-name
mv file.moving.tips tech.tips.directory
If the second name is another
file, this command will write the first file over the contents of the second
file, thus eliminating the second file. Be sure this is what you want to do
before using this command.
mv my.speech speech.list
my.speech will overwrite
on top of the file speech.list If appending the contents of
the first file to the end of the contents in the second file is preferable
--not merely moving a file--use the command:
cat my.speech >> speech.list
mkdir name
mkdir tech.tips.collection
rmdir directory-name
rmdir old.files
rm directory-name/*
rm News/*
BE SURE YOU WANT TO DO THIS. You cannot undelete files on World.
HOME Top of Unix Eye On The World The World's Information Kiosk
For further assistance, please send an email
request to support@world.std.com
Copyright 1995 Software Tool & Die, Inc. All Rights Reserved.
Software Tool & Die, Inc., 1330 Beacon St. Suite 215 Brookline, MA 02146