Your Internet Consultant - The FAQs of Life Online
3.31. What other important UNIX commands should I know about?
The following are some commands that are important.
- man. OK, I already mentioned this one, but I'm mentioning it
again to make sure that you know how to RTFM (read the manual). The man
command shows you the manual page for a particular command. For instance,
man grep will give you lots of information about the grep
command.
The following is an example of a manual page.
$ man grep
Reformatting page. Wait... done
GREP(1V) USER COMMANDS GREP(1V)
NAME
grep, egrep, fgrep - search a file for a string or regular
expression
SYNOPSIS
grep [ -bchilnsvw ] [ -e expression ] [ filename... ]
DESCRIPTION
Commands of the grep family search the input filenames (the
standard input default) for lines matching a pattern. Nor-
mally, each line found is copied to the standard output.
grep patterns are limited regular expressions in the style
of ed(1). egrep patterns are full regular expressions
including alternation. fgrep patterns are fixed strings -
no regular expression metacharacters are supported.
OPTIONS
-b Precede each line by the block number on which it was
found. This is sometimes useful in locating disk block
numbers by context.
- vi or emacs or others. Text editors, or programs that
allow you to create text files (such as e-mail messages, programs or letters to
Aunt Zelda). Ask your local guru what editor you should use. The vi
editor is simple but not exceptionally easy to learn. In contrast, emacs
is a software behemoth that will edit files, tell your fortune, and teach you
to make cookies. (Really.)
- lpr or print. May let you print a text file on a
printer connected to the UNIX computer. Two caveats: first, never try to print
a nontext file. Anything that looks like gibberish when viewed onscreen with
the cat command will look worse on paper. Second, if you're hacking from
a college computer lab or your office and you know there's a printer down the
hall, feel free to use the print command. If you're using a dial-up UNIX
system hundreds of miles away, however, don't use the printer unless you intend
to drive there to pick up your printout!
- grep. Stands for Global Regular Expression Print, which is a
verbose way of saying that this program will search through files and output
any lines that contain text that you specify. If you've ever read Usenet news,
your home directory contains a hidden file called .newsrc, which lists
all the newsgroups available to you. Typing grep amiga .newsrc will list
all the lines in the file that contain the word
amiga.
- passwd. Allows you to change your password.
Typing passwd will prompt you for your old password, then ask you
to type your new password twice. Passwords you type should never be visible on
your screen.
Table of Contents | Previous Section | Next Section