Andrew Hudson - Fedora™ Unleashed, 2008 edition

Здесь есть возможность читать онлайн «Andrew Hudson - Fedora™ Unleashed, 2008 edition» весь текст электронной книги совершенно бесплатно (целиком полную версию без сокращений). В некоторых случаях можно слушать аудио, скачать через торрент в формате fb2 и присутствует краткое содержание. Город: Indianapolis, Год выпуска: 2008, ISBN: 2008, Издательство: Sams Publishing, Жанр: ОС и Сети, на английском языке. Описание произведения, (предисловие) а так же отзывы посетителей доступны на портале библиотеки ЛибКат.

Fedora™ Unleashed, 2008 edition: краткое содержание, описание и аннотация

Предлагаем к чтению аннотацию, описание, краткое содержание или предисловие (зависит от того, что написал сам автор книги «Fedora™ Unleashed, 2008 edition»). Если вы не нашли необходимую информацию о книге — напишите в комментариях, мы постараемся отыскать её.

Quick Glance Guide
Finding information you need is not always easy. This short index provides a list of common tasks discussed inside this book. Browse the table of contents or index for detailed listings and consult the specified chapter for in-depth discussions about each subject.
left How Do I…?
See…
How Do I…?
See…
left Back up my system?
Chapter 13
Partition a hard drive?
Appendix B, Chapters 1, 35
left Build a new Linux kernel?
Chapter 36
Play MP3s and other music?
Chapter 7
left Burn a CD?
Chapter 7
Print a file?
Chapter 8
left Change a password?
Chapter 4
Read a text file?
Chapter 4
left Change the date and time?
Chapter 32
Read or send email?
Chapter 21
left Compress a file?
Chapter 13
Read or post to newsgroups?
Chapter 5
left Configure a modem?
Chapter 2
Reboot Fedora?
Chapter 1
left Configure a printer?
Chapter 8
Rescue my system?
Chapter 13
left Configure a scanner?
Chapter 7
Set up a DNS server?
Chapter 23
left Configure a sound card?
Chapter 7
Set up a firewall?
Chapter 14
left Configure my desktop settings?
Chapter 3
Set up a web server?
Chapter 15
left Connect to the Internet?
Chapter 5
Set up an FTP server?
Chapter 20
left Control a network interface?
Chapter 14
Set up Samba with SWAT?
Chapter 19
left Copy files or directories?
Chapters 13, 32
Set up wireless networking?
Chapter 14
left Create a boot disk to boot Fedora?
Chapter 1
Shut down Fedora?
Chapter 1
left Create a database?
Chapter 16
Use a spreadsheet?
Chapter 6
left Create a user?
Chapter 4
Use Instant Messaging?
Chapter 5
left Delete a file or directory?
Chapter 32
Watch television on my computer?
Chapter 7
left Get images from a digital camera?
Chapter 7
Edit a text file?
Chapter 4
left Install Fedora?
Chapter 1
Make Fedora more secure?
Chapter 14
left Log in to Fedora?
Chapter 1
Mount a CD-ROM or hard drive?
Chapter 35

Fedora™ Unleashed, 2008 edition — читать онлайн бесплатно полную книгу (весь текст) целиком

Ниже представлен текст книги, разбитый по страницам. Система сохранения места последней прочитанной страницы, позволяет с удобством читать онлайн бесплатно книгу «Fedora™ Unleashed, 2008 edition», без необходимости каждый раз заново искать на чём Вы остановились. Поставьте закладку, и сможете в любой момент перейти на страницу, на которой закончили чтение.

Тёмная тема
Сбросить

Интервал:

Закладка:

Сделать

So, this time each line is made up of six fields: minute (0-59), hour (0-23), day of the month (1-31), month of the year (1-12), day of the week (0-7), and then the command to run. If you are using vimand are new to it, press i to enter insert mode to edit your text; then press Esc to exit insert mode. To save and quit, type a colon followed by wq and press Enter.

When programming, we tend to use a sandboxsubdirectory in our home directory where we keep all sorts of temporary files that we were just playing around with. We can use a personal job to empty that directory ever morning at 6 a.m. so that we get a fresh start each morning. Here is how that would look in our crontabfile:

0 6 * * * rm -rf /home/paul/sandbox/*

If you are not allowed to schedule jobs, you will be stopped from editing your crontabfile.

When your jobs are placed, you can use the command crontab -lto list your jobs. This just prints the contents of your crontabfile, so its output is the same as the line you just entered.

If you want to remove just one job, the easiest thing to do is type crontab -eto edit your crontabfile in vim; then, after having moved the cursor to the job you want to delete, type dd (two ds) to delete that line. If you want to delete all your jobs, you can use crontab -rto delete your crontabfile.

Basic Shell Control

Fedora includes a rich assortment of capable, flexible, and powerful shells. Each shell is different but has numerous built-in commands and configurable command-line prompts and might include features such as command-line history, the capability to recall and use a previous command line, and command-line editing. As an example, the bashshell is so powerful that it is possible to write a minimal web server entirely in bash'slanguage using 114 lines of script (see Chapter 33 for more information).

Although there are many shells to choose from, nearly everyone sticks with the default, bash.The bashshell does everything most people need to do, and more. Change your shell only if you really need to.

Table 11.1 lists each shell, along with its description and location, in your Fedora file system.

TABLE 11.1 Shells with Fedora

Name Description Location
ash A small shell ( sh-like) /bin/ash
ash.static A version of ashnot dependent on software libraries /bin/ash.static
bash The Bourne Again SHell /bin/bash
bsh A symbolic link to ash /bin/bsh
csh The C shell, a symbolic link to tcsh /bin/csh
ksh The Korn shell /bin/ksh, /usr/bin/ksh
pdksh A symbolic link to ksh /usr/bin/pdksh
rsh The restricted shell (for network operation) /usr/bin/rsh
sash A standalone shell /sbin/sash
sh A symbolic link to bash /bin/sh
tcsh A csh-compatible shell /bin/tcsh
zsh A compatible csh, ksh, and shshell /bin/zsh
Learning More About Your Shell

All the shells listed in Table 11.1 have accompanying man pages, along with other documentation under the /usr/share/docdirectory. Some of the documentation can be quite lengthy, but it is generally much better to have too much documentation than too little! The bashshell includes more than 100 pages in its manual, and the zshshell documentation is so extensive that it includes the zshallmeta man page (use man zshallto read this overview)!

The Shell Command Line

Having a basic understanding of the capabilities of the shell command line can help you write better shell scripts. If, after you have finished reading this short introduction, you want to learn more about the command line, check out Chapter 32, "Command-Line Master Class." You can use the shell command line to perform a number of different tasks, including

► Getting data from and sending data to a file or command, known as input and output redirection .

► Feeding or filtering a program's output to another command (called using pipes ).

A shell can also have built-in job-control commands to launch the command line as a background process, suspend a running program, selectively retrieve or kill running or suspended programs, and perform other types of process control.

Multiple commands can be run on a single command line, with a semicolon to separate commands:

$ w ; free ; df

6:02pm up 4 days, 24 min, 1 user, load average: 0.00, 0.00, 0.00

USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT

bball pts/0 shuttle.home.org 1:14pm 0.00s 0.57s 0.01s w

total used free shared buffers cached

Mem: 190684 184420 6264 76 17620 142820

-/+ buffers/cache: 23980 166704

Swap: 1277156 2516 1274640

Filesystem 1k-blocks Used Available Use% Mounted on

/dev/hda1 11788296 4478228 6711248 41% /

none 95340 0 95340 0% /dev/shm

This example displays the output of the w, free, and dfcommands. You can extend long shell command lines inside shell scripts or at the command line if you use the backslash character (\). For example,

$ echo ""this is a long \

> command line and"" ; echo ""shows that multiple commands \

> may be strung out.""

this is a long command line and

shows that multiple commands may be strung out.

The first three lines of this example are a single command line. In that single line are two instances of the echocommand. Note that when you use the backslash as a line-continuation character, it must be the last character on the command line (or in your shell script, as you will see later in this chapter).

Using the basic features of the shell command line is easy, but mastering use of all features can be difficult. Entire books have been devoted to using shells, writing shell scripts, and using pattern-matching expressions. The following sections provide an overview of some features of the shell command line relating to writing scripts.

Grokking grep

If you plan to develop shell scripts to expand the capabilities of pattern-matching commands such as grep,you will benefit from learning more about using expressions. One of the definitive guides to using the pattern-matching capabilities of Unix and Linux commands is Mastering Regular Expressions by Jeffrey E. F. Freidl (O'Reilly), ISBN: 0-596-00289-0.

Shell Pattern-Matching Support

The shell command line allows you to use strings of specially constructed character patterns for wildcard matches. This is a simpler capability than that supported by GNU utilities such as grep,which can use more complex patterns, known as expressions, to search through files or directories or to filter data input to or out of commands.

Читать дальше
Тёмная тема
Сбросить

Интервал:

Закладка:

Сделать

Похожие книги на «Fedora™ Unleashed, 2008 edition»

Представляем Вашему вниманию похожие книги на «Fedora™ Unleashed, 2008 edition» списком для выбора. Мы отобрали схожую по названию и смыслу литературу в надежде предоставить читателям больше вариантов отыскать новые, интересные, ещё непрочитанные произведения.


Отзывы о книге «Fedora™ Unleashed, 2008 edition»

Обсуждение, отзывы о книге «Fedora™ Unleashed, 2008 edition» и просто собственные мнения читателей. Оставьте ваши комментарии, напишите, что Вы думаете о произведении, его смысле или главных героях. Укажите что конкретно понравилось, а что нет, и почему Вы так считаете.

x