pdf > ebook > pobieranie > do ÂściÂągnięcia > download

[ Pobierz całość w formacie PDF ]

set path = (/bin /usr/bin /usr/local/bin .)
/usr/games
date
umask 002
stty erase ^H intr ^C
As you can see, these sample setup files contain commands to print a "fortune" and the date - just what
happened earlier when we logged in! (/usr/games/fortune is a useless but entertaining program that prints
a randomly selected saying from its collection. fortune isn't available on all systems.)
But what are these other commands?
file:///C|/Documents%20and%20Settings/nmyers/Desktop/learn_unix/ch03_06.htm (1 of 3) [6/30/2002 3:41:10 PM]
[Chapter 3] 3.6 Customizing Your Account
The line with PATH= or set path = tells the shell which directories to search for UNIX
commands. This saves you the trouble of typing the complete pathname for each program you
run. (Notice that /usr/games isn't part of the path, so we had to use the absolute pathname to get
our daily dose of wisdom from the fortune command.)
The umask command sets the default file permissions assigned to all files you create. Briefly, a
value of 022 sets the permissions rw-r--r-- (read-write by owner, but read-only by everyone
else), and 002 will produce rw-rw-r-- (read-write by owner and group, but read-only by
everyone else). If this file is a program or a directory, both umasks will also give execute (x)
permission to all users. See one of the books in Appendix A or your UNIX documentation for
details.
The stty command sets your terminal control characters - for example, the erase and interrupt
characters we discussed earlier.
You can execute any of these commands from the command line, as well. For example, to change your
erase character from [BACKSPACE] [(CTRL-H)] to [DEL] [CTRL-?] you would enter:
% stty erase ^?
(The [DEL] key actually generates the control code [CTRL-?] so that's what you'll see on your
screen.)
Now pressing [DEL] will backspace and erase characters you type. (If your account is already set up to
use [DEL] as the erase character, reverse this example, and change the erase character to
[BACKSPACE].
If you experiment with stty, be careful not to reset the erase or interrupt character to a character you'll
need otherwise. If you do, though, simply log out and then log back in; you'll get the default erase and
interrupt characters again.
UNIX has many other configuration commands to learn about; the references in Appendix A list some of
them. One popular configuration is to change your screen colors. On some Linux systems (and others),
for example, the command setterm -background blue makes a blue background. Unfortunately,
different systems do this in different ways; ask a local expert or someone who has a colored screen.
Just as you can execute the setup commands from the command line, the converse is true: any command
that you can execute from the command line can be executed automatically when you log in by placing it
in your setup file. (Running interactive commands like mail from your setup file isn't a good idea,
though.)
You probably shouldn't edit your setup files yet, but it's good to know what's in them. Later, when you
know more about UNIX, feel free to add or change commands in this file.
file:///C|/Documents%20and%20Settings/nmyers/Desktop/learn_unix/ch03_06.htm (2 of 3) [6/30/2002 3:41:10 PM]
[Chapter 3] 3.6 Customizing Your Account
Previous: 3.5 Changing Learning the Unix Next: 4. File Management
Your Password Operating System
3.5 Changing Your Password 4. File Management
Book Index
The UNIX CD Bookshelf
Navigation
file:///C|/Documents%20and%20Settings/nmyers/Desktop/learn_unix/ch03_06.htm (3 of 3) [6/30/2002 3:41:10 PM]
[Chapter 4] File Management
Chapter 4
Previous: 3.6 Customizing Next: 4.2 File and Directory
Your Account Names
4. File Management
Contents:
Methods of Creating Files
File and Directory Names
File and Directory Wildcards
Managing Your Files
Printing Files
4.1 Methods of Creating Files
You'll usually create a text file with a text editor. An editor lets you add, change, and rearrange text
easily. Two common UNIX editors are vi (pronounced "vee-eye") and emacs ("ee-macs").
Neither of those editors has the same features as popular word processing software on personal
computers. Instead of being designed for making documents, envelopes, and so on, vi and emacs are
very sophisticated, extremely flexible editors for all kinds of text files: programs, email messages, and so
on. Many UNIX systems also support easy-to-use word processors. Ask your system administrator what's
available. Pico is a simple editor (not word processor) that has been added to many UNIX systems.
Since there are several editor programs, you can choose one you're comfortable with. vi is probably the
best choice because almost all UNIX systems have it, but emacs is also widely available. The O'Reilly &
Associates books Learning the vi Editor and Learning GNU Emacs cover those editors in detail. If you'll
be doing only simple editing, however, pico is a great choice. Although pico is much less powerful than
emacs or vi, it's also a lot easier to learn.
You can also create a file by using a UNIX feature called input/output redirection, as Chapter 5,
Redirecting I/O , explains. This sends the output of a command directly to a file - to make a new file or
make an existing file larger.
file:///C|/Documents%20and%20Settings/nmyers/Desktop/learn_unix/ch04_01.htm (1 of 2) [6/30/2002 3:41:10 PM]
[Chapter 4] File Management
Previous: 3.6 Customizing Learning the Unix Next: 4.2 File and Directory
Your Account Operating System Names
3.6 Customizing Your 4.2 File and Directory Names
Book Index
Account
The UNIX CD Bookshelf
Navigation
file:///C|/Documents%20and%20Settings/nmyers/Desktop/learn_unix/ch04_01.htm (2 of 2) [6/30/2002 3:41:10 PM]
[Chapter 4] 4.2 File and Directory Names
Chapter 4
Previous: 4.1 Methods of Next: 4.3 File and Directory
File Management
Creating Files Wildcards
4.2 File and Directory Names [ Pobierz całość w formacie PDF ]

  • zanotowane.pl
  • doc.pisz.pl
  • pdf.pisz.pl
  • cyklista.xlx.pl
  • Cytat

    Do wzniosłych (rzeczy) poprzez (rzeczy) trudne (ciasne). (Ad augusta per angusta). (Ad augusta per angusta)

    Meta