IT training sobel m a practical guide to ubuntu linux prenice HallENG,2008

1.2K 483 0
IT training sobel m a practical guide to ubuntu linux prenice HallENG,2008

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

Praise for A Practical Guide to Ubuntu Linux ® “I am so impressed by how Mark Sobell can approach a complex topic in such an understandable manner His command examples are especially useful in providing a novice (or even advanced) administrator with a cookbook on how to accomplish real-world tasks on Linux He is truly an inspired technical writer!” —George Vish II Senior Education Consultant Hewlett-Packard Company “Overall, I think it’s a great, comprehensive Ubuntu book that’ll be a valuable resource for people of all technical levels.” —John Dong Ubuntu Forum Council Member Backports Team Leader “The JumpStart sections really offer a quick way to get things up and running, allowing you to dig into the details of his books later.” —Scott Mann Aztek Networks “Ubuntu is gaining popularity at the rate alcohol did during prohibition, and it’s great to see a well-known author write a book on the latest and greatest version Not only does it contain Ubuntu-specific information, but it also touches on general computer-related topics, which will help the average computer user to better understand what’s going on in the background Great work, Mark!” —Daniel R Arfsten Pro/ENGINEER Drafter/Designer “I read a lot of Linux technical information every day, but I’m rarely impressed by tech books I usually prefer online information sources instead Mark Sobell’s books are a notable exception They’re clearly written, technically accurate, comprehensive-and actually enjoyable to read.” —Matthew Miller Senior Systems Analyst/Administrator BU Linux Project Boston University Office of Information Technology “I would so love to be able to use this book to teach a class about not just Ubuntu or Linux but about computers in general It is thorough and well written with good illustrations that explain important concepts for computer usage.” —Nathan Eckenrode New York Local Community Team Praise for Other Books by Mark Sobell “I currently own one of your books, A Practical Guide to Linux® I believe this book is one of the most comprehensive and, as the title says, practical guides to Linux I have ever read I consider myself a novice and I come back to this book over and over again.” —Albert J Nguyen “Thank you for writing a book to help me get away from Windows XP and to never touch Windows Vista The book is great; I am learning a lot of new concepts and commands Linux is definitely getting easier to use.” —James Moritz “I have been wanting to make the jump to Linux but did not have the guts to so-until I saw your familiarly titled A Practical Guide to Red Hat® Linux® at the bookstore I picked up a copy and am eagerly looking forward to regaining my freedom.” —Carmine Stoffo Machine and Process Designer to pharmaceutical industry “I am currently reading A Practical Guide to Red Hat® Linux® and am finally understanding the true power of the command line I am new to Linux and your book is a treasure.” —Juan Gonzalez A Practical Guide to Ubuntu Linux ® This page intentionally left blank A Practical Guide to Ubuntu Linux Mark G Sobell Upper Saddle River, NJ • Boston • Indianapolis • San Francisco New York • Toronto • Montreal • London • Munich • Paris • Madrid Capetown • Sydney • Tokyo • Singapore • Mexico City ® Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks Where those designations appear in this book, and the publisher was aware of a trademark claim, the designations have been printed with initial capital letters or in all capitals Ubuntu is a registered trademark of Canonical Ltd The author and publisher have taken care in the preparation of this book, but make no expressed or implied warranty of any kind and assume no responsibility for errors or omissions No liability is assumed for incidental or consequential damages in connection with or arising out of the use of the information or programs contained herein The publisher offers excellent discounts on this book when ordered in quantity for bulk purchases or special sales, which may include electronic versions and/or custom covers and content particular to your business, training goals, marketing focus, and branding interests For more information, please contact: U.S Corporate and Government Sales (800) 382-3419 corpsales@pearsontechgroup.com For sales outside the United States, please contact: International Sales international@pearsoned.com Visit us on the Web: www.prenhallprofessional.com Library of Congress Cataloging-in-Publication Data Sobell, Mark G A practical guide Ubuntu Linux / Mark G Sobell p cm Includes index ISBN-13: 978-0-13-236039-5 (pbk : alk paper) Linux Operating systems (Computers) I Title QA76.76.O63S59497 2008 005.4'32—dc22 2007043244 Copyright © 2008 Mark G Sobell All rights reserved Printed in the United States of America This publication is protected by copyright, and permission must be obtained from the publisher prior to any prohibited reproduction, storage in a retrieval system, or transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise For information regarding permissions, write to: Pearson Education, Inc Rights and Permissions 501 Boylston Street, Suite 900 Boston, MA 02116 Fax (617) 671-3447 ISBN-13: ISBN-10: 978-0-13-236039-5 0-13-236039-X Text printed in the United States on recycled paper at Courier in Stoughton, Massachusetts First printing, December 2007 For my dad, Morton Sobell, who taught me to examine the world very carefully This page intentionally left blank Brief Contents Contents xi Preface xxxv Welcome to Linux PART I PART II Installing Ubuntu Linux 21 Installation Overview 23 Step-by-Step Installation 45 Getting Started with Ubuntu Linux Introduction to Ubuntu Linux The Linux Utilities 145 The Linux Filesystem 183 The Shell 219 PART III 85 87 Digging into Ubuntu Linux Linux GUIs: X and GNOME 251 The Bourne Again Shell 275 10 Networking and the Internet 353 11 Programming the Bourne Again Shell 249 395 ix Index 1129 parameter, 297 sudo utility, 88, 490 See also root privileges admin group, 496 configuring, 494 defaults (options), 497 environment, 492 redirect output, 492 root account password and, 498 root shell, spawning, 492 sudoers file, 494 tee utility and, 493 timestamp, 491 sudoers file, 494 Sun Microsystems, 369, 781, 799 Superblock, 1063 Supercomputers, Superserver See inetd daemon; xinetd daemon Superuser, 1063 See also root privileges; System administration Suspend key, 138, 178, 237, 291, 451 SVID See System, V Interface Definition Swap, 564, 1063 filesystem, 32, 564 RAM, and, 32, 564 space, 1063 swapon utility, 564 Swarm, BitTorrent, 605 swat utility, 828 swatch utility, 1008 Switch, network, 356, 357, 1050 Switcher, Workspace, 93, 94 sylpheed utility, 171 Symbolic hostname, 383 link, 212, 567, 1045, 1064 creating using ln, 213 deleting using rm, 214 symlink See Symbolic, link Symmetric key encryption, 994 Synaptic utility, 121 Syntax, command line, 220 sys file, 636 sysctl utility, 636 sysklogd init script, 690 syslog file, 872 syslog utility, 386 syslog.conf file, 386, 688 syslogd daemon, 386, 688 syslogd file, 690 System administration See System administration administrator See System administration booting, 511 bringing down, 518 call, 10 bad, trapping, 451 exec(), 285 fork(), 285, 310, 312, 963 gethostbyname(), 857 raw device and, 570 sleep(), 312 strtok(), 963 console See Console crash, 519 dataless, 800, 1032 diskless, 800 does not boot, 520 error messages, 565 initialization, customize, 507 logging in, 89 logs, 688 menu, 111 messages, 565, 688 mode, 1064 operation, 510 powering down, 519 rebooting, 133, 518 reports, 671 security, 682 shutting down, 133, 518 single-user, 1060 upgrading, 59 V See System V well-maintained, 486 System administration accept utility, 629 adduser utility, 660 aptitude utility See aptitude utility at utility, 671 back up files, 662, 666 backup, amanda, 663 client, specifying, 528 communicate with users, 677 configuration file rules, 528 dmesg utility, 511, 654 dump utility, 666 e2label utility, 525 1130 Index System administration, continued edquota utility, 687 files, growing, 683 filesystem integrity, 577 mounting remote, 803 repairing, 520 firestarter utility, 888 free space, disk, 683 fsck utility, 577 gdmsetup utility, 83 getty utility, 516 group, adding, 661 groupadd utility, 661 groupdel utility, 661 groupmod utility, 661 halt utility, 518, 519 host, specifying, 528 hosts.allow file, 531 hosts.deny file, 531 kill builtin, 524 log in problem, 679 log, machine, 681 login utility, 516 lpadmin utility, 627 lpinfo utility, 626 lshal utility, 697 lshw utility, 696 lsof utility, 681 lspci utility, 696 maintenance, 512 memtest86+ utility, 62 mkfs utility, 525 more information, 522 mounting a remote filesystem, 803 multiuser mode, 515 parted utility, 514, 673 password, modifying, 661 poweroff utility, 518 powers of the administrator, 485 problem solving, 982 problems, 679 ps utility, 238, 310, 680, 684 quota utility, 687 quotaon utility, 687 reboot utility, 518 recovery mode, 512 reject utility, 629 reports, 671 restore utility, 666 rpcinfo utility, 530 runlevels, 510 scheduling tasks, 668 setuid files, finding, 521 shares-admin utility, 658, 809, 827 shutdown utility, 518 single-user mode See Recovery mode slow system, 680 su utility, 499 subnet, specifying, 529 sudo, users who are allowed to run, 88 sudoers file, 494 syslogd daemon, 688 system does not boot, 520 telinit utility, 516, 519 top utility, 672 Trojan horse, 520 trouble alias, 681 tune2fs utility, 525, 578 umask builtin, 526 umount utility, 575 uname utility, 527 updating software packages, 119 user adding, 658, 660 cannot log in, 679 getting information to, 677 modifying, 661 removing, 661 useradd utility, 660 userdel utility, 661 usermod utility, 661 vmstat utility, 671 wget utility, 609 system services database, 1041 System V, 1064 init daemon, 500 init script See Init script Interface Definition, sysv filesystem, 572 SysVinit, 500 SysVinit scripts See Init script sysv-rc-conf utility, 508 T T-1 line, 356 T-3 line, 356 Index 1131 TAB key, 146 Table, hash, 1039 tail utility, 152, 238 talk utility, 372, 386 talk.politics newsgroup, 389 talkd daemon, 386 Tanenbaum, Andrew, 4, 571 Tape archive See tar utility device, 666, 668 mt utility, 668 nonrewinding, 668 streaming, 1062 tar file, 161 tar utility, 161, 289, 663, 665 tar.bz2 filename extension, 162 tar.gz filename extension, 162 tar.Z filename extension, 162, 187 Tarball, 161 Task, Upstart, 501 tbz filename extension, 162 TC Shell, 1064 TCP, 1064 TCP wrappers, 532 TCP/IP, 361, 387 tcsh, 1064 tee utility, 236, 493 Teletypewriter, 1066 telinit utility, 510, 516, 519 telnet utility, 134, 354, 373, 374, 957, 998 telnetd daemon, 386, 1002 Temporary file, 425 Tera-, 1064 TERM signal, 138 TERM variable, 134, 554 Termcap, 988 termcap file, 1064 Terminal, 1064 ASCII, 1023 character-based, 1028 emulator, 114, 133, 270 failsafe, 132 file, 226 interrupt signal, 452 name ansi, 989 linux, 989 vt100, 989 vt102, 989 vt220, 989 xterm, 989 pseudo, 555 resetting, 526 Server Project, Linux, 800 specifying, 988 standard input, 227 standard output, 227 virtual, 64 X, 1070 Terminating a program, 96, 138 Terminfo, 988 terminfo database, 172 terminfo directory, 1064 Terminology Apache, 918 DNS, 858 firestarter, 887 folder and directory, 96 GNOME, 105 Nautilus and File Browser, 96 Upstart, 501 Ternary operator, 463, 465 test builtin, 397, 398, 399, 403, 407, 410, 412 test utility, 398 testparm utility, 842 Text box, 1064 echo, 157 file, 172 Textual installer, 67 interface, 27 partitioning, manual, 70 system, installing, 65 tftp utility, 800 tftpd daemon, 386 tgz filename extension, 187 Theme, 102, 1064 then control structure, 396, 400, 403 Thicknet, 357, 1064 Thinnet, 357, 1065 Thompson, Ken, 9, 1024 Thread safe See Reentrant code Three-finger salute, 518 Thumb, 1065 Tick, 1065 Tick box See check box tif filename extension, 188, 1065 1132 Index tiff filename extension, 188, 1065 Tilde expansion, 190, 301, 341 Tiled windows, 1065 time builtin, 458 Time to live See TTL Time zone, graphical installation, 50 timed daemon, 386 tin utility, 389 Titlebar, 96, 112 TLS, security, 997 tmp directory, 425, 684 Toggle, 1065 Token, 220, 338 Token ring network, 1065 Toolbar, 112 Toolbar, Nautilus, 263 Tooltip, 106, 1065 Top of form, 178 top utility, 672, 680 Top-down design, 472 torrent filename extension, 40, 605 Torrent, BitTorrent, 605 Torvalds, Linus, 1, 2, 3, 6, 1044 touch utility, 197 tput builtin, 417 tr utility, 159, 234, 281 traceroute utility, 376 traceroute6 utility, 377 Tracker, BitTorrent, 605 Transactions signatures, DNS See DNS, TSIG Transfer rate, network, 357 Transient window, 1065 Transmission Control Protocol See TCP Transmission Control Protocol/Internet Protocol See TCP/IP Transport Layer Security See TLS trap builtin, 417, 451, 458 Trash directory, 100 Trash vs deleting a file, 265 Trash, emptying, 100 Treachery, security tools, 1008 Tree structure, 184 tripwire utility, 1001, 1008 Trojan horse, 520, 1065 Trolltech, 259 Troubleshooting, DNS, 872 true utility, 453 Trusted host, 372 tset utility, 526 TTL, 1066 TTL, DNS, 853 tty file, 450 tty utility, 226 TTY See Teletypewriter tty? file, 506 tune2fs utility, 525, 578 Tunneling, 1066 Tunneling, OpenSSH, 725 Tutorial, ftp, 732 Tutorial, vim, 172 Twisted pair cable, 357 txt filename extension, 187, 241 type builtin, 445, 458 Type maps, 951 Type of file, display using ls, 200 Typeface conventions, 18 typescript file, 158 typeset builtin, 299, 436 Typo, correcting, 137 tz filename extension, 162 U U.S Library of Congress, 374 ubiquity See Installation, graphical Ubuntu Alternate CD See Alternate CD booting, 46 burning a CD/DVD, 40 Desktop CD See Desktop CD documentation, 124 download locations, 24 downloading See Downloading Ubuntu DVD See DVD, live/install editions, 28 Help Center window, 104 Help window, 124 history, 10 IRC channels, 131 live/install Desktop CD See Desktop CD LTS release, 28 recovery mode, 65 releases, 28 Server CD See Server CD upgrading, 59 X.org, 74 UCE See Spam uchroot.c program, 536 Index 1133 udev utility, 568 UDP, 361, 1066 UDP/IP, 387 ufs filesystem, 572 ufsdump utility, 557 UID, 1066 displaying, 499 effective, 1035 passwd file, in, 560 umask builtin, 458, 526 umount utility, 559, 575, 804 umsdos filesystem, 572 unalias builtin, 328, 331 uname utility, 527 uncompress utility, 187 Undecillion, 1066 Undeclared variable, 434 Unicast packet, 363, 1066 Unicast vs broadcast, 363 Unicode, 1066 uniq utility, 154 Unique filename, 425, 437 universe software package category, 588 University of Illinois, 391 UNIX Bourne Shell, 276 philosophy, 370 printing, traditional, 622 System V, 6, 1064 unix2dos utility, 159, 736 Unlocking the root account, 499 Unmanaged window, 1066 Unmounting a busy filesystem, 575 Unpacking an archive file using tar, 161 unset builtin, 299, 332, 458 Unshielded twisted pair See UTP until control structure, 416 unzip utility, 161 Update Manager window, 101 Update Notifier, 100 updatedb utility, 166 update-exim4.conf file, 766 update-grub utility, 651 Updating software package index, 594 Updating software packages, 100, 119 Upgrading software packages, 594 Upgrading Ubuntu, 59 Upstart, 500 event, 501 future of, 501 init daemon, 502, 511 initctl utility, 502 job, 501, 503 job definition file, 504 rc2 task, 505 runlevel emulation, 502 service, 502 status utility, 503 task, 501 terminology, 501 tty? tasks, 506 Uptime, display using w, 169 uptime utility, 169 urandom file, 556 URI, 1067 URL, 391, 1067 Usage message, 220, 400, 406, 424, 1067 Usenet, 388, 391 User accounts, manage, 658 adding, 658, 660 authentication, 516 cannot log in, 679 communication, network, 370 created variable, 295, 296 Datagram Protocol See UDP finger, 167 graphical installation, 51 ID See UID interface, 1042, 1067 map, Samba, 826 mode, 1067 modifying, 661 name, Samba, 826 name See Username private groups, 558 removing, 661 Superuser See root account w, 169 who, 167 useradd utility, 660 userdel utility, 661 usermod utility, 661 Username, 560, 562, 1067 Userspace, 1067 usr partition, 33 UTC, 1067 1134 Index Utility, 1067 accept, 629 accton, 1002 adduser, 660 AIDE, 521, 1001, 1006 amanda, 663 anacrontab, 384 apache2ctl, 917, 956 apropos, 126, 165 apt-cache, 596 aptitude See aptitude utility aspell, 413, 415 at, 384, 557, 671 automount, 818 basename, 423, 424, 453 bison, 17 BitTorrent See BitTorrent btdownloadcurses, 605 btshowmetainfo, 606 builtin versus, 398 bunzip2, 160, 164 bzcat, 161 bzip2, 160, 164, 665 bzip2recover, 161 cancel, 623 cat, 147, 227, 229, 230, 280, 402 chkrootkit, 1006 chmod, 200, 284 chsh, 525 clear, 525 compress, 161, 187 cp, 149, 198, 289 cpio, 664, 665 crack, 682 crontab, 385, 557 cut, 343 date, 157, 233 depmod, 645 df, 800 dhclient, 539 diff, 154, 715 dig, 378, 856, 859, 872 displayconfig-gtk, 75 dmesg, 511, 654 dos2unix, 159, 736 dpkg, 600 dpkg-reconfigure, 768 DragonSquire, 1001 dsniff, 1006 dump, 666 e2label, 525 edquota, 687 egrep, 977 emacs, 171 Evolution, 109, 171 eximon, 765 eximstats, 765 exportfs, 817 fdformat, 574 fdisk See parted file, 155, 565, 684 find, 405, 408, 521, 684 find using whereis, 164 find using which, 164 finger, 167, 370, 371, 385, 411 flex, 17 fsck, 570, 577 ftp, 354, 730, 736 fuser, 575 fwtk, 1007 gawk, 411, 412 gcc, gdm (GNOME), 82 gdmsetup, 83 getfacl, 204 getty, 310, 516 gksudo, 491 gnome-search-tool, 269 gnome-terminal, 270 gopher, 390 gparted, 53 gprof, 17 grep, 151, 235, 427 groupadd, 661 groupdel, 661 groupmod, 661 groups, 558 grub, 647 grub-install, 653 gunzip, 161 gzip, 161 halt, 518, 519 head, 152 host, 378, 857 hostname, 149, 370 hping, 1007 id, 492, 499 ifconfig, 541 Index 1135 info, 126, 243, 983 init, 310, 559 initctl, 502 insmod, 645 ipchains, 896 iptables, 885 iptables-restore, 907 iptables-save, 907 iwconfig, 700 John the Ripper, 1007 mkdir, 191, 192, 193, 803 mkfifo, 568 mkfs, 525, 574 mkswap, 564 modinfo, 645 modprobe, 645 more, 148, 236, 402 mount, 559, 572, 573, 803, 841 mt, 668 mv, 150, 197, 566 jwhois, 378 kdesu, 491 kerberos, 1003, 1007 killall, 524 L6, 1007 ldd, 532 less, 125, 148, 236, 288, 402 lftp, 718 lids, 1007 links, 392 ln, 210, 213, 566 lock, 417 login, 310, 516 logresolve, 938 logrotate, 684 lp, 623 lpadmin, 627 lpinfo, 626 lpq, 151, 623 lpr, 151, 235, 237, 623 lprm, 151, 623 lpstat, 151, 623 ls, 147, 192, 199, 202, 211, 240, 284 lshal, 697 lshw, 525, 696 lsmod, 645 lsof, 681 lspci, 696 lynx, 392 mail, 171 mailq, 765 make, 162 makedbm, 793 man, 14, 124, 128 mandb, 165 md5sum, 40 memtest86+, 62 mesg, 171 mingetty, 310 names, typeface, 18 nessus, 1007 net, 824 net use (Windows), 842 net view (Windows), 842 netcat, 1007 netstat, 365 network, 354, 372 newaliases, 764 newlist, 775 nisdomainname, 786 nmap, 1007 nm-applet, 700 nmblookup, 842, 843 nn, 389 nologin, 561 od, 556 OPIE, 1002, 1007 option, 221 parted, 514, 673 passwd, 562, 789 pdbedit, 824 pidgin, 105 pidof, 524 pinfo, 128 ping, 375, 526, 562, 842 ping6, 376 portmap, 802, 808, 818 poweroff, 518 procmail, 171 ps, 238, 310, 437, 680, 684 pstree, 311 pwd, 192, 213 qmail, 998 quota, 687 quotaon, 687 rbac, 1008 rcp, 372 readnews, 389 1136 Index Utility, continued reboot, 518 reject, 629 reset, 526 resolvconf, 858 restore, 666 rlogin, 354 rm, 148, 214, 330, 402, 567 rmdir, 196 rmmod, 645 rn, 389 rpcinfo, 530, 788 rsh, 354, 372 runlevel, 510, 519 run-parts, 669 ruptime, 680 S/Key, 1002 saint, 1008 samhain, 1001, 1008 sara, 1008 scp, 354, 569, 711 See also OpenSSH script, 158 sed, 684 sendmail, 779 setfacl, 205 setserial, 526 sftp, 718 shares-admin, 658, 809, 812, 827 showmount, 816 shutdown, 518, 564 slocate, 166 smbclient, 824, 840, 843 smbpasswd, 828 smbstatus, 824 smbtar, 824 smbtree, 824, 839 snort, 1008 sort, 14, 153, 235, 236 spamc, 769 squirrelmail-configure, 774 srp, 1008 ssh, 134, 354, 384, 569, 708, 711, 714, 715, 1003, 1008 See also OpenSSH ssh-keygen, 712, 713, 721 startx, 254 stat, 526 status, 503 stty, 417, 554 su, 489, 499 sudo, 88 swapon, 564 swat, 828 swatch, 1008 sylpheed, 171 Synaptic, 121 sysctl, 636 syslog, 386 sysv-rc-conf, 508 tail, 152, 238 talk, 372, 386 tar, 161, 289, 663, 665 tee, 236, 493 telinit, 510, 516, 519 telnet, 134, 354, 373, 374, 957, 998 test, 397, 398, 403, 407 testparm , 842 tftp, 800 tin, 389 top, 672, 680 touch, 197 tr, 159, 234, 281 traceroute, 376 traceroute6, 377 tripwire, 1001, 1008 true, 453 tset, 526 tty, 226 tune2fs, 525, 578 typeset, 299 ubiquity See Installation, graphical udev, 568 ufsdump, 557 umount, 559, 575, 804 uname, 527 uncompress, 187 uniq, 154 unix2dos, 159, 736 unzip, 161 updatedb, 166 update-grub, 651 uptime, 169 useradd, 660 userdel, 661 usermod, 661 uucp, 389 vimtutor, 172 vmstat, 671 w, 169, 680 Index 1137 wall, 677 wc, 343 webalizer, 964 wget, 609 whatis, 166 whereis, 164 which, 164 who, 167, 226, 233, 235, 560, 686 whois See Utility, jwhois wireshark, 1008 write, 167, 170, 677 X server, 252 xargs, 684 xev, 254 xhost, 255 Xinerama, 1070 xmodmap, 258 xrn, 389 xvnews, 389 ypinit, 795 yppasswd, 788 yppush, 793 ypwhich, 787 ypxfr, 795 zcat, 161 zip, 161 UTP cable, 357 uucp utility, 389 UUID, 576, 1067 V var filename extension, 951 var partition, 33 Variable, 295, 1067 braces, 298 completion, 325 default value, assigning, 443 displaying an error message, 444 environment, 295 expansion, 342, 443 exported, 449 global, 295, 449 keyword, 296 local, 312, 449 modifiers, 443 naming, 295 readonly, 295 removing, 299 shell, 295 substitute default value, 443 substitution, 297 undeclared, 434 unsetting, 299 user created, 295, 296 VeriSign, 994 Version control, Bazaar, 584 vfat filesystem, 572 vi bash command line editor, 322 Video card, configure, 76 View pane, Nautilus, 261 Viewport See Workspace vim bash command line editor, 322 case sensitivity, 1027 Command mode, 174 correcting a mistake, 176, 178 creating a file, 172 d command, 177 dd command, 177 deleting text, 177 editing a file, 172 end a session, 178 enter text, 175 exit from, 178 exit, emergency, 172 getting started, 172 Input mode, 174, 175 inserting text, 178 Last Line mode, 175 moving the cursor, 177 Normal mode See vim, Command mode page break, 178 quitting, 178 replacement string, 980 safedit script, 423 special characters, 980 starting, 172 terminal specification, 988 u command, 177 undoing changes, 177 vimtutor utility, 172 Work buffer, 178 x command, 177 ZZ command, 178 vimtutor utility, 172 1138 Index Virtual console, 64, 136, 1068 filesystem, 572 memory, 564 package, software, 592 private network See VPN software package, 592 terminal See Virtual, console Virtual machine KVM, VirtualBox, Xen, VirtualBox, Virus, 1004, 1068 Visual effects, 103 Visual effects, required hardware, 25 VLAN, 1068 vmstat utility, 671 Volume label, 525, 576 VPN, 355, 1068 vsftpd See also FTP chroot jail, 744 configuration file, 742 connection parameters, 750 display, 748 downloading files, 746 files, 752 init script, 740 log, 749 logging in (users), 743 messages, 748 PASV connections, 750 PORT connections, 750 prerequisites, 740 security, 746 server, 740 stand-alone mode, 740, 743 starting, 741 testing, 741 uploading files, 746 vsftpd.chroot_list file, 752 vsftpd.log file, 752 vsftpd.user_list file, 752 vt100 terminal, 989 vt102 terminal, 989 vt220 terminal, 989 Vulcan death grip, 518 VxFS filesystem, 572 W w utility, 169, 680 W2K, 1068 W3 See World Wide Web W3C, 1068 wait builtin, 458 Wake up a process, 312 wall utility, 677 WAN, 17, 356, 358, 359, 1068 WAP, 694, 1068 wc utility, 343 Web See also World Wide Web crawler, 392 of trust, 996 ring, 1068 webalizer utility, 964 Webmail, 772 wget utility, 609 whatis database, 165 whatis utility, 166 wheel group, 549 whereis utility, 164 which utility, 164 while control structure, 412, 448, 453, 456 Whitespace, 146, 1068 command line, 287 quoting, 297 who am i, 167 who utility, 167, 226, 233, 235, 560, 686 whois utility See jwhois utility whos shell script, 411 whoson shell script, 283 Wide area network See WAN Widget, 1068 See also GUI Wi-Fi, 1069 See also Wireless Wiggly windows, 103 Wildcard, 239, 1068 See also Metacharacter Window, 106, 111, 1069 active, 139 Add/Remove Applications, 120 Index 1139 Appearance Preferences, 102 Browse, 99 cascading, 1027 clipboard, 113 cut and paste, 113 cycling, 112 decorations, 141 file, 226 File Browser See Nautilus focus, input, 112, 139 ignored, 1041 input focus, 112, 139 List applet, 109 Login Window Preferences, 82 manager, 16, 141, 259, 1069 Compiz, 103, 141 GNUStep, 260 Metacity, 103, 141 WindowMaker, 260 minimize, 1048 mouse buttons, remap, 258 Object Properties, 116 Operations menu, 112 Panel Properties, 108 Pick a Color, 268 Pick a Font, 268 Preferences window, 140 root, 106, 113, 1058 Run Application, 92, 269 Save, 99 Screen and Graphics Preferences, 75 scrollbar, 1059 Search for Files, 269 share See Samba, share slider, 1060 snap, 1060 Software Sources, 119 thumb, 1065 tiled, 1065 titlebar, 96, 112 toolbar, 112 transient, 1065 Ubuntu Help Center, 104 unmanaged, 1066 Update Manager, 101 wiggly, 103 Window Preferences, 140 working with, 96 WindowMaker window manager, 260 Windows convert Linux files to, 159 dual-boot system, 61 filename limitation, 186 integration See Samba net use utility (Samba), 842 net view utility (Samba), 842 networks, browsing using Samba, 840 NTFS driver, 987 privileged port, 1054 Samba See Samba shares from Linux, accessing using Samba, 839 shares, connecting to using Samba, 840 shares, displaying using Samba, 839 shares, mounting, 841 winprinter, 617 WINS, 1069 Wiping a file, 556 Wire See Cable Wireless access point, 694, 1069 ad hoc mode, 695 bridge, 695 configuring, 700 infrastructure mode, 695 iwconfig utility, 700 NIC, 700 wireshark utility, 1008 Word, 137, 1069 defined, 220, 446 deleting, 137 designator, 318 erase key, 223 parse a command line, 338 splitting (bash), 305 Work buffer, 1069 Work buffer, vim, 178 Working directory, 188, 1069 change using cd, 193 execute a file in, 303 PATH, 283 relative pathnames and, 190 significance of, 190 versus home directory, 193 1140 Index Working with root privileges, 88 Workspace, 106, 1069 desktop, and the, 91 GNOME, 16 Switcher, 93, 94 Workstation, 7, 1069 World Wide Web, 390 Berners-Lee, Tim, 390 CERN, 390 Consortium, 1068 Enquire, 390 HTML, 390 hypermedia, 391 hypertext, 391 link, hypertext, 391 Mosaic browser, 391 search engine, 392 URL, 391 Web crawler, 392 Worm, 1004, 1068, 1069 Write access, 199 write utility, 167, 170, 677 wtmp file, 196, 686 www directory, 918, 924, 925 www file, 920 WWW See World Wide Web WYSIWYG, 1069 X X Consortium, 252 server, 1070 terminal, 1070 utility, 252 X Window System, 15, 74, 252, 1070 client and server, 253 color depth, 257 configuring, 75 display number, 256 DISPLAY variable, 256 display, access to, 255 emergency exit, 257 event, 253 exiting from, 257 freedesktop.org group, 260 ID string, 256 library, 141 Mouse See Mouse multiple X servers, 257 remote computing and local displays, 254 resolution, changing, 140 screen number, 256 server, 253 server process, 680 stack, 252 starting, 254 X stack, 252 X.org versus XFree86, 252 X11 forwarding, OpenSSH, 712, 718, 719, 724, 725 X11R6.6, 252 X11R7.2, 74 XFree86 versus X.org, 252 Xinerama, 1070 Xlib, 252 xorg.conf file, 77 X.org, 74 X11 directory, 74, 195 X11R6.6, 252 X11R7.2, 74 x86 processor architecture, 27 xargs utility, 684 XDMCP, 1070 xDSL, 1070 Xen, xev utility, 254 Xfce desktop, 10 xforcevesa boot parameter, 62 xfs filesystem, 572 xhost utility, 255 xhtml filename extension, 931 Xinerama, 1070 xinetd daemon, 386, 531, 741 XINU, Xlib, 252 XML, 1070 xmodmap utility, 258 xorg.conf file, 74, 77 Xremote, 363 xrn utility, 389 XSM, 1070 Index 1141 xterm terminal name, 989 Xubuntu, 10, 26 xvnews utility, 389 ypxfr utility, 795 ypxfrd daemon, 795 Z Y Yellow Pages, 782 yp.conf file, 787 ypbind daemon, 788 ypinit utility, 795 yppasswd utility, 788 yppasswdd daemon, 797 yppush utility, 793 ypserv.conf file, 791 ypwhich utility, 787 Z filename extension, 161, 187 Z Shell, 1070 zcat utility, 161 zero file, 556 Zeroconf, 699 Zimmerman, Phil, 996 zip utility, 161 Zone, DNS, 848 zsh shell, 1070 Zulu time See UTC This page intentionally left blank ALSO AVAILABLE FROM MARK G SOBELL AND PRENTICE HALL The Most Useful Linux Tutorial and Reference Ever, with Hundreds of High-Quality Examples Covering Every Linux Distribution! To be truly productive with Linux, you need to thoroughly master the shells and the command line Until now, you had to buy two books to gain that mastery: a tutorial on fundamental Linux concepts and techniques, plus a separate reference Worse, most Linux references offer little more than prettiedup man pages Now, there’s a far better solution Renowned Linux expert Mark G Sobell has brought together comprehensive, insightful guidance on the tools system administrators, developers, and power users need most, and an outstanding day-to-day reference, both in the same book ISBN-13: 978-0-13-147823-7 ©2006 · 1,008 pages This book is 100 percent distribution and release agnostic: You can use it on any Linux system, now and for years to come What’s more, it’s packed with hundreds of high-quality examples: better examples than you’ll find in any other Linux guidebook This is Linux from the ground up—the clearest explanations and most useful knowledge about everything from filesystems to shells, editors to utilities, and programming tools to regular expressions And when you need instant answers, you’ll constantly turn to Sobell’s comprehensive command reference section—organized and tabbed for easy, fast access! Don’t settle for yesterday’s Linux guidebook Get the one book that meets today’s challenges—and tomorrow’s! A Practical Guide to Linux® Commands, Editors, and Shell Programming is the most useful, most comprehensive Linux tutorial and reference you can find Visit us online for more information about this book and to read sample chapters www.informit.com/ph ...Praise for A Practical Guide to Ubuntu Linux ® “I am so impressed by how Mark Sobell can approach a complex topic in such an understandable manner His command examples are especially useful... explains how to use Linux from a graphical interface and from the command line (a textual interface), A Practical Guide to Linux? ? Commands, Editors, and Shell Programming works exclusively with... “I am currently reading A Practical Guide to Red Hat® Linux? ? and am finally understanding the true power of the command line I am new to Linux and your book is a treasure.” —Juan Gonzalez A Practical

Ngày đăng: 05/11/2019, 16:10

Mục lục

  • A PRACTICAL GUIDE TO UBUNTU LINUX

    • CONTENTS

    • PREFACE

    • CHAPTER 1: WELCOME TO LINUX

      • The GNU–Linux Connection

        • The History of GNU–Linux

        • The Code Is Free

        • Have Fun!

      • The Linux 2.6 Kernel

      • The Heritage of Linux: UNIX

      • What Is So Good About Linux?

        • Why Linux Is Popular with Hardware Companies and Developers

        • Linux Is Portable

        • Standards

        • The C Programming Language

        • Ubuntu Linux

      • Overview of Linux

        • Linux Has a Kernel Programming Interface

        • Linux Can Support Many Users

        • Linux Can Run Many Tasks

        • Linux Provides a Secure Hierarchical Filesystem

        • The Shell: Command Interpreter and Programming Language

        • A Large Collection of Useful Utilities

        • Interprocess Communication

        • System Administration

      • Additional Features of Linux

        • GUIs: Graphical User Interfaces

        • (Inter)Networking Utilities

        • Software Development

      • Conventions Used in This Book

      • Chapter Summary

      • Exercises

    • PART I: INSTALLING UBUNTU LINUX

      • CHAPTER 2: INSTALLATION OVERVIEW

        • The Live/Install Desktop CD/DVD

        • More Information

        • Planning the Installation

        • The Installation Process

        • Downloading and Burning a CD/DVD

        • Gathering Information About the System

        • Chapter Summary

        • Exercises

        • Advanced Exercises

      • CHAPTER 3: STEP-BY-STEP INSTALLATION

        • Basic Installation from the Live/Install Desktop CD/DVD

        • Graphical Partitioners

        • Upgrading to a New Release

        • Installing KDE

        • Setting Up a Dual-Boot System

        • Advanced Installation

        • The X Window System

        • Chapter Summary

        • Exercises

        • Advanced Exercises

    • PART II: GETTING STARTED WITH UBUNTU LINUX

      • CHAPTER 4: INTRODUCTION TO UBUNTU LINUX

        • Curbing Your Power: root Privileges/sudo

        • A Tour of the Ubuntu Linux Desktop

        • Getting the Most out of the Desktop

        • Updating, Installing, and Removing Software Packages

        • Where to Find Documentation

        • More About Logging In

        • Working from the Command Line

        • Controlling Windows: Advanced Operations

        • Chapter Summary

        • Exercises

        • Advanced Exercises

      • CHAPTER 5: THE LINUX UTILITIES

        • Special Characters

        • Basic Utilities

        • Working with Files

        • | (Pipe): Communicates Between Processes

        • Four More Utilities

        • Compressing and Archiving Files

        • Locating Commands

        • Obtaining User and System Information

        • Communicating with Other Users

        • Email

        • Tutorial: Creating and Editing a File with vim

        • Chapter Summary

        • Exercises

        • Advanced Exercises

      • CHAPTER 6: THE LINUX FILESYSTEM

        • The Hierarchical Filesystem

        • Directory Files and Ordinary Files

        • Pathnames

        • Directory Commands

        • Working with Directories

        • Access Permissions

        • ACLs: Access Control Lists

        • Links

        • Chapter Summary

        • Exercises

        • Advanced Exercises

      • CHAPTER 7: THE SHELL

        • The Command Line

        • Standard Input and Standard Output

        • Running a Program in the Background

        • Filename Generation/Pathname Expansion

        • Builtins

        • Chapter Summary

        • Exercises

        • Advanced Exercises

    • PART III: DIGGING INTO UBUNTU LINUX

      • CHAPTER 8: LINUX GUIS: X AND GNOME

        • X Window System

        • The Nautilus File Browser Window

        • GNOME Utilities

        • Chapter Summary

        • Exercises

        • Advanced Exercises

      • CHAPTER 9: THE BOURNE AGAIN SHELL

        • Background

        • Shell Basics

        • Parameters and Variables

        • Special Characters

        • Processes

        • History

        • Aliases

        • Functions

        • Controlling bash Features and Options

        • Processing the Command Line

        • Chapter Summary

        • Exercises

        • Advanced Exercises

      • CHAPTER 10: NETWORKING AND THE INTERNET

        • Types of Networks and How They Work

        • Communicate Over a Network

        • Network Utilities

        • Distributed Computing

        • Usenet

        • WWW: World Wide Web

        • Chapter Summary

        • Exercises

        • Advanced Exercises

      • CHAPTER 11: PROGRAMMING THE BOURNE AGAIN SHELL

        • Control Structures

        • File Descriptors

        • Parameters and Variables

        • Builtin Commands

        • Expressions

        • Shell Programs

        • Chapter Summary

        • Exercises

        • Advanced Exercises

    • PART IV: SYSTEM ADMINISTRATION

      • CHAPTER 12: SYSTEM ADMINISTRATION: CORE CONCEPTS

        • Running Commands with root Privileges

        • The Upstart Event-Based init Daemon

        • System Operation

        • Avoiding a Trojan Horse

        • Getting Help

        • Textual System Administration Utilities

        • Setting Up a Server

        • nsswitch.conf: Which Service to Look at First

        • PAM

        • Chapter Summary

        • Exercises

        • Advanced Exercises

      • CHAPTER 13: FILES, DIRECTORIES, AND FILESYSTEMS

        • Important Files and Directories

        • File Types

        • Filesystems

        • Chapter Summary

        • Exercises

        • Advanced Exercises

      • CHAPTER 14: DOWNLOADING AND INSTALLING SOFTWARE

        • JumpStart: Installing and Removing Packages Using aptitude

        • Finding the Package That Holds a File You Need

        • APT: Keeps the System Up-to-Date

        • dpkg: The Debian Package Management System

        • BitTorrent

        • Installing Non-dpkg Software

        • wget: Downloads Files Noninteractively

        • Chapter Summary

        • Exercises

        • Advanced Exercises

      • CHAPTER 15: PRINTING WITH CUPS

        • Introduction

        • JumpStart I: Configuring a Local Printer

        • system-config-printer: Configuring a Printer

        • JumpStart II: Configuring a Remote Printer Using the CUPS Web Interface

        • Traditional UNIX Printing

        • Configuring Printers

        • Printing from Windows

        • Printing to Windows

        • Chapter Summary

        • Exercises

        • Advanced Exercises

      • CHAPTER 16: BUILDING A LINUX KERNEL

        • Prerequisites

        • Downloading the Kernel Source Code

        • Read the Documentation

        • Configuring and Compiling the Linux Kernel

        • Installing the Kernel, Modules, and Associated Files

        • Rebooting

        • grub: The Linux Boot Loader

        • dmesg: Displays Kernel Messages

        • Chapter Summary

        • Exercises

        • Advanced Exercises

      • CHAPTER 17: ADMINISTRATION TASKS

        • Configuring User and Group Accounts

        • Backing Up Files

        • Scheduling Tasks

        • System Reports

        • parted: Reports on and Partitions a Hard Disk

        • Keeping Users Informed

        • Creating Problems

        • Solving Problems

        • Chapter Summary

        • Exercises

        • Advanced Exercises

      • CHAPTER 18: CONFIGURING A LAN

        • Setting Up the Hardware

        • Configuring the Systems

        • Setting Up Servers

        • More Information

        • Chapter Summary

        • Exercises

        • Advanced Exercises

    • PART V: USING CLIENTS AND SETTING UP SERVERS

      • CHAPTER 19: OPENSSH: SECURE NETWORK COMMUNICATION

        • Introduction

        • About OpenSSH

        • OpenSSH Clients

        • sshd: OpenSSH Server

        • Troubleshooting

        • Tunneling/Port Forwarding

        • Chapter Summary

        • Exercises

        • Advanced Exercises

      • CHAPTER 20: FTP: TRANSFERRING FILES ACROSS A NETWORK

        • Introduction

        • More Information

        • FTP Client

        • FTP Server (vsftpd)

        • Chapter Summary

        • Exercises

        • Advanced Exercises

      • CHAPTER 21: exim4: SETTING UP MAIL SERVERS, CLIENTS, AND MORE

        • Introduction to exim4

        • JumpStart I: Configuring exim4 to Use a Smarthost

        • JumpStart II: Configuring exim4 to Send and Receive Email

        • How exim4 Works

        • Configuring exim4

        • SpamAssassin

        • Additional Email Tools

        • Authenticated Relaying

        • Alternatives to exim4

        • Chapter Summary

        • Exercises

        • Advanced Exercises

      • CHAPTER 22: NIS: NETWORK INFORMATION SERVICE

        • Introduction to NIS

        • How NIS Works

        • Setting Up an NIS Client

        • Setting Up an NIS Server

        • Chapter Summary

        • Exercises

        • Advanced Exercises

      • CHAPTER 23: NFS: SHARING FILESYSTEMS

        • Introduction

        • More Information

        • Setting Up an NFS Client

        • Setting Up an NFS Server

        • automount: Mounts Directory Hierarchies on Demand

        • Chapter Summary

        • Exercises

        • Advanced Exercises

      • CHAPTER 24: SAMBA: LINUX AND WINDOWS FILE AND PRINTER SHARING

        • Introduction

        • About Samba

        • JumpStart: Configuring a Samba Server Using shares-admin

        • swat: Configures a Samba Server

        • smb.conf: Manually Configuring a Samba Server

        • Accessing Linux Shares from Windows

        • Accessing Windows Shares from Linux

        • Troubleshooting

        • Chapter Summary

        • Exercises

        • Advanced Exercises

      • CHAPTER 25: DNS/BIND: TRACKING DOMAIN NAMES AND ADDRESSES

        • Introduction to DNS

        • About DNS

        • JumpStart I: Setting Up a DNS Cache

        • Setting Up BIND

        • Troubleshooting

        • A Full-Functioned Nameserver

        • A Slave Server

        • A Split Horizon Server

        • Chapter Summary

        • Exercises

        • Advanced Exercises

      • CHAPTER 26: firestarter AND iptables: SETTING UP A FIREWALL

        • About firestarter

        • JumpStart: Building a Firewall Using the firestarter Firewall Wizard

        • firestarter: Maintains a Firewall

        • How iptables Works

        • About iptables

        • Anatomy of an iptables Command

        • Building a Set of Rules

        • Copying Rules to and from the Kernel

        • Sharing an Internet Connection Using NAT

        • Chapter Summary

        • Exercises

        • Advanced Exercises

      • CHAPTER 27: APACHE: SETTING UP A WEB SERVER

        • Introduction

        • About Apache

        • JumpStart: Getting Apache Up and Running

        • Configuring Apache

        • Configuration Directives

        • The Ubuntu apache2.conf File

        • The Ubuntu default Configuration File

        • Redirects

        • Content Negotiation

        • Server-Generated Directory Listings (Indexing)

        • Virtual Hosts

        • Troubleshooting

        • Modules

        • webalizer: Analyzes Web Traffic

        • MRTG: Monitors Traffic Loads

        • Error Codes

        • Chapter Summary

        • Exercises

        • Advanced Exercises

    • PART VI: APPENDIXES

      • APPENDIX A: REGULAR EXPRESSIONS

        • Characters

        • Delimiters

        • Simple Strings

        • Special Characters

        • Rules

        • Bracketing Expressions

        • The Replacement String

        • Extended Regular Expressions

        • Appendix Summary

      • APPENDIX B: HELP

        • Solving a Problem

        • Finding Linux-Related Information

        • Specifying a Terminal

      • APPENDIX C: SECURITY

        • Encryption

        • File Security

        • Email Security

        • Network Security

        • Host Security

        • Security Resources

        • Appendix Summary

      • APPENDIX D: THE FREE SOFTWARE DEFINITION

      • APPENDIX E: THE LINUX 2.6 KERNEL

        • Native Posix Thread Library (NPTL)

        • IPSecurity (IPSec)

        • Asynchronous I/O (AIO)

        • O(1) Scheduler

        • OProfile

        • kksymoops

        • Reverse Map Virtual Memory (rmap VM)

        • HugeTLBFS: Translation Look-Aside Buffer Filesystem

        • remap_file_pages

        • 2.6 Network Stack Features (IGMPv3, IPv6, and Others)

        • Internet Protocol Virtual Server (IPVS)

        • Access Control Lists (ACLs)

        • 4GB-4GB Memory Split: Physical Address Extension (PAE)

        • Scheduler Support for HyperThreaded CPUs

        • Block I/O (BIO) Block Layer

        • Support for Filesystems Larger Than 2 Terabytes

        • New I/O Elevators

        • Interactive Scheduler Response Tuning

    • GLOSSARY

      • A

      • B

      • C

      • D

      • E

      • F

      • G

      • H

      • I

      • J

      • K

      • L

      • M

      • N

      • O

      • P

      • Q

      • R

      • S

      • T

      • U

      • V

      • W

      • X

      • Z

    • INDEX

      • A

      • B

      • C

      • D

      • E

      • F

      • G

      • H

      • I

      • J

      • K

      • L

      • M

      • N

      • O

      • P

      • Q

      • R

      • S

      • T

      • U

      • V

      • W

      • X

      • Y

      • Z

Tài liệu cùng người dùng

  • Đang cập nhật ...

Tài liệu liên quan