By Brian Jepson, Ernest E. Rothman
Cover | Table of Contents | Colophon
-C
to copy,
-V to paste. Even before you press
-C, the current text selection is contained
in a selection called the
pasteboard
.
One similarity between Terminal and xterm is
that selected text can be pasted in the same window with the middle
button of a three-button mouse. If you want to paste selected text
into another window, you must drag and drop it with the mouse or use
copy and paste. The operations described in Section 1.5, later in this
chapter, also use the pasteboard.$TERM
is
xterm-color when running under Terminal
(it's set to xterm under
xterm by default).
xterm & xterm -e -fg green -bg black -e pine -name pine -title pine &
-N or selecting File
→ New Shell from the menu
bar.$TERM), which is set as xterm-color
by default. The other choices for the environment variable
TERM are ansi,
rxvt, vt52, vt100, vt102, and xterm.
Among other things, the default setting for TERM allows you to take
advantage of the support for color output in ls
(via the -G
option) and color syntax highlighting in the
vim
editor.
-I), which brings up the
Terminal Inspector, shown in Figure 1-3. Table 1-1 lists the available window
settings. Changing these settings affects only the topmost Terminal
window. If you want to change the default settings for all future
Terminal windows, click the Use Settings As Defaults button at the
bottom of the Terminal Inspector window.
|
Pane
|
Description
|
|---|---|
|
Shell
|
Displays the shell used by the Terminal and lets you choose whether
to close the Terminal window when the shell exits.
|
|
Processes |
http://www.pollet.net/GLterm/) was developed
by Michael Pollet to use X11 .bdf fonts and
render them using OpenGL, provided that it's run on
a machine with a 3D accelerator supported by Mac OS X. GLterm
supports ANSI color, vt102/xterm emulations, and DEC function keys.open .
open ~/Public
open /Applications
open -a Xcode
open -a Xcode data.xml
open *.c
open -e *.c
$ sudo /Applications/TextEdit.app/Contents/MacOS/TextEdit
-V (the
"V" stands for
"verbose")
as
you start the computer. If you'd like to always boot
in verbose mode, you can specify a flag in the boot arguments that
are stored in your system's firmware. First, use the
command nvram boot-args
to make sure there aren't any flags already set (if
there are, and you didn't set them, you probably
should not change this setting). Set your boot arguments to
-v with this command:
sudo /usr/sbin/nvram boot-args="-v"
sudo /usr/sbin/nvram boot-args=
-S
as you start the computer. In single-user mode, your filesystem will
be mounted as read-only, and you will be limited in what you can do.
Single-user mode should generally be used only to repair a system
that has been damaged (for example, see Section 3.11 in Chapter 3).
Unlike
with other Unix systems, we do not suggest that you use single-user
mode to perform
-V (the
"V" stands for
"verbose")
as
you start the computer. If you'd like to always boot
in verbose mode, you can specify a flag in the boot arguments that
are stored in your system's firmware. First, use the
command nvram boot-args
to make sure there aren't any flags already set (if
there are, and you didn't set them, you probably
should not change this setting). Set your boot arguments to
-v with this command:
sudo /usr/sbin/nvram boot-args="-v"
sudo /usr/sbin/nvram boot-args=
-S
as you start the computer. In single-user mode, your filesystem will
be mounted as read-only, and you will be limited in what you can do.
Single-user mode should generally be used only to repair a system
that has been damaged (for example, see Section 3.11 in Chapter 3).
Unlike
with other Unix systems, we do not suggest that you use single-user
mode to perform fsck
repairs manually. Instead, boot from the
Mac OS X install CD or DVD and run the Disk Utility (Installer
→ Open Disk Utility) to
repair a problem disk volume.http://www.mysql.com)./etc/periodic/daily/100.clean-logs /etc/periodic/daily/500.daily /etc/periodic/monthly/500.monthly /etc/periodic/weekly/500.weekly
15 3 * * * root periodic daily 30 4 * * 6 root periodic weekly 30 5 1 * * root periodic monthly
sudo periodic daily weekly monthly
gethostent(
)
. The C library
connects to lookupd
, a thin shim that is the doorway to the
DirectoryService
daemon. The DirectoryService
daemon consults the available plug-ins until it finds the
one that can answer the directory query.getpw* family of
functions. However, those functions are not ideal for working with
systems that support multiple directories (flat files, NetInfo, LDAP,
etc.). Also, in the interest of thwarting
dictionary attacks against password files,
many operating systems have stopped returning encrypted passwords
through those APIs. Many Unix and Linux systems simply return an
"x" when you invoke a function like
getpwnam( ). However, those systems can return an
encrypted password through functions
like getspnam( ), which consult shadow password
entries, and can generally be invoked by the root user only. Example 3-1 shows the typical usage of such an API, where
the user enters her plaintext password, and the program encrypts it
and then compares it against the encrypted password stored in the
system.
|
Tool
|
Description
|
|---|---|
|
dscl
|
Provides a command-line interface to
Directory Services.
|
|
nicl
|
Provides a command-line interface to NetInfo.
|
|
nidump
|
Extracts flat file format data (such as
/etc/passwd) from NetInfo.
|
$ nireport . /groups gid name
-2 nobody
-1 nogroup
0 wheel
1 daemon
2 kmem
3 sys
4 tty
5 operator
6 mail
7 bin
20 staff
25 smmsp
26 lp
27 postfix
28 postdrop
31 guest
45 utmp
66 uucp
68 dialer
69 network
70 www
74 mysql
75 sshd
76 qtss
78 mailman
79 appserverusr
80 admin
81 appserveradm
99 unknown
nidump group . without that last
s.name:password:gid:members). To add a new group,
you can create a file that adheres to that format, and load it with
niload. For ad hoc work, you can use a
here document (an expression that
functions as a quoted string, but spans multiple lines) rather than a
separate file:$ sudo niload group . <<EOF > writers:*:1001: > EOF
$ nireport . /users uid name home realname shell
-2 nobody /var/empty Unprivileged User /usr/bin/false
0 root /var/root System Administrator /bin/sh
1 daemon /var/root System Services /usr/bin/false
99 unknown /var/empty Unknown User /usr/bin/false
25 smmsp /private/etc/mail Sendmail User /usr/bin/false
2 lp /var/spool/cups Printing Services /usr/bin/false
27 postfix /var/spool/postfix Postfix User /usr/bin/false
70 www /Library/WebServer World Wide Web Server /usr/bin/false
71 eppc /var/empty Apple Events User /usr/bin/false
74 mysql /var/empty MySQL Server /usr/bin/false
75 sshd /var/empty sshd Privilege separation /usr/bin/false
76 qtss /var/empty QuickTime Streaming Server /usr/bin/false
77 cyrus /var/imap Cyrus User /usr/bin/false
78 mailman /var/empty Mailman user /usr/bin/false
79 appserver /var/empty Application Server /usr/bin/false192.168.0.1 xyzzy
$ sudo niload hosts . <<EOF > 192.168.0.1 xyzzy > EOF
/Users -ro 192.168.0.134 192.168.0.106
-maproot=user
-maproot=user:
[
group
[
:group...
]]
-maproot=
username:,
it means the remote user should have no group credentials. You may
specify a username or numeric user ID for
user and a group name or numeric group ID
for group.-mapall=
user
-mapall=user
:[
group
[:group
...]]
|
Flat file
|
NetInfo directory
|
Important properties
|
Flat files or local database?
|
|---|---|---|---|
|
/etc/exports
|
/exports
|
name, clients (list), opts (list)
|
-S as the system starts up.
Next, check to see if you have a backup of the
NetInfo database. The
/etc/daily
cron job backs up the database each time it is
run. You can find the backup in
/var/backups/local.nidump. If you
don't have a backup, you won't be
able to restore. The local.nidump file is
overwritten each time the cron job runs, so make
sure you back it up regularly (preferably to some form of removable
media).root# prompt to come up.# /sbin/fsck -y
# /sbin/mount -uw /
# cd /var/db/netinfo/
# mv local.nidb/ local.nidb.broken