Teach Yourself UNIX in 24 Hours

Total Page:16

File Type:pdf, Size:1020Kb

Teach Yourself UNIX in 24 Hours Teach Yourself UNIX in 24 Hours Dave Taylor James C. Armstrong, Jr. 201 West 103rd Street Indianapolis, Indiana 46290 iv Teach Yourself UNIX in 24 Hours Decimilli accipitrae Raptor Regina.—JA Acquisitions Editor Grace M. Buechlein To the newest light of my life: Ashley Elizabeth.—DT Development Editor Brian-Kent Proffitt Copyright Ó 1997 by Sams Publishing Production Editor FIRST EDITION Kristi Hart All rights reserved. No part of this book shall be reproduced, stored in a Indexer retrieval system, or transmitted by any means, electronic, mechanical, photo- Greg Pearson copying, recording, or otherwise, without written permission from the publisher. No patent liability is assumed with respect to the use of the informa- Technical Reviewer tion contained herein. Although every precaution has been taken in the Raj Mangal preparation of this book, the publisher and author assume no responsibility for Editorial Coordinators errors or omissions. Neither is any liability assumed for damages resulting from the use of the information contained herein. For information, address Sams Mandi Rouell Publishing, 201 W. 103rd St., Indianapolis, IN 46290. Katie Wise Technical Edit Coordinator International Standard Book Number: 0-672-31107-0 Lynette Quinn Library of Congress Catalog Card Number: 97-66198 Resource Coordinator 2000 99 98 97 4 3 2 1 Deborah Frisby Interpretation of the printing code: the rightmost double-digit number is the Editorial Assistants year of the book’s printing; the rightmost single-digit, the number of the book’s Carol Ackerman printing. For example, a printing code of 97-1 shows that the first printing of Andi Richter the book occurred in 1997. Rhonda Tinch-Mize Composed in AGaramond and MCPdigital by Macmillan Computer Publishing Cover Designer Tim Amrhein Printed in the United States of America Book Designer All terms mentioned in this book that are known to be trademarks or service Gary Adair marks have been appropriately capitalized. Sams Publishing cannot attest to the accuracy of this information. Use of a term in this book should not be regarded Copy Writer as affecting the validity of any trademark or service mark. David Reichwein Production Team Supervisors Brad Chinn Charlotte Clapp Production Brad Lenser President, Sams Publishng Richard K. Swadley Chris Livengood Publishing Manager Dean Miller Gene Redding Director of Editorial Services Cindy Morrow Janet Seib Director of Marketing Kelli Spencer Product Marketing Manager Wendy Gilbride Assistant Marketing Managers Jen Pock, Rachel Wolfe Overview Introduction xvi Hour 1 What Is this UNIX Stuff? 1 2 Getting onto the System and Using the Command Line 21 3 Moving About the File System 43 4 Listing Files and Managing Disk Usage 63 5 Ownership and Permissions 87 6 Creating, Moving, Renaming, and Deleting Files and Directories 113 7 Looking into Files 127 8 Filters and Piping 145 9 Wildcards and Regular Expressions 161 10 Power Filters and File Redirection 187 11 An Introduction to the vi Editor 199 12 Advanced vi Tricks, Tools, and Techniques 245 13 An Overview of the emacs Editor 281 14 Introduction to Command Shells 305 15 Getting the Most Out of the C Shell 323 16 Basic Shell Programming 347 17 Job Control 361 18 Printing in the UNIX Environment 379 19 Searching for Information and Files 397 20 Communicating with Others 407 21 Using Netscape To See the World Wide Web 425 22 Internet E-Mail, Netnews, and IRC 443 23 Using telnet and ftp 479 24 Programming in C for UNIX 509 Glossary 531 Index 541 vi Teach Yourself UNIX in 24 Hours Contents Hour 1 What Is This UNIX Stuff? 1 Goals for This Hour ................................................................................... 1 What Is UNIX? .......................................................................................... 2 A Brief History of UNIX ............................................................................ 3 The C Programming Language .............................................................. 4 UNIX Becomes Popular ........................................................................ 5 What’s All This About Multiuser Systems? ................................................. 5 Cracking Open the Shell ............................................................................ 6 Getting Help .............................................................................................. 7 Task 1.1: Man Pages, UNIX Online Reference...................................... 7 Task 1.2: Other Ways to Find Help in UNIX ..................................... 14 Summary .................................................................................................. 17 Workshop ................................................................................................ 17 Key Terms ........................................................................................... 17 Questions ............................................................................................ 18 Preview of the Next Hour .................................................................... 19 2 Getting onto the System and Using the Command Line 21 Goals for This Hour ................................................................................. 21 Task 2.1: Logging In and Out of the System ....................................... 22 Task 2.2: Changing Passwords with passwd ........................................ 25 Task 2.3: Picking a Secure Password .................................................... 26 Task 2.4: Who Are You? ...................................................................... 28 Task 2.5: Finding Out What Other Users Are Logged in to the System................................................................................. 30 Task 2.6: What Is Everyone Doing on the Computer? ......................... 31 Task 2.7: Checking the Current Date and Time .................................. 33 Task 2.8: Looking at a Calendar .......................................................... 33 Simple Math with UNIX .......................................................................... 36 Task 2.9: Using the bc Infix Calculator ............................................... 36 Task 2.10: Using the dc Postfix Calculator .......................................... 38 Summary .................................................................................................. 40 Workshop ................................................................................................ 40 Key Terms ........................................................................................... 40 Questions ............................................................................................ 41 Preview of the Next Hour .................................................................... 41 3 Moving About the File System 43 Goals for This Hour ................................................................................. 43 What a Hierarchical File System Is All About ........................................... 44 Task 3.1: The UNIX File System Organization ................................... 45 The bin Directory ............................................................................... 46 The dev Directory ............................................................................... 47 The etc Directory ............................................................................... 47 The lib Directory ............................................................................... 47 The lost+found Directory .................................................................. 48 The mnt and sys Directories ............................................................... 48 The tmp Directory ............................................................................... 48 The usr Directory ............................................................................... 48 Other Miscellaneous Stuff at the Top Level ......................................... 49 How Mac and PC File Systems Differ from the UNIX File System .......... 50 Directory Separator Characters ................................................................. 50 The Difference Between Relative and Absolute Filenames ........................ 51 Task 3.2: Hidden Files in UNIX ......................................................... 52 Task 3.3: The Special Directories “.” and “..” ...................................... 55 Task 3.4: The env Command .............................................................. 56 Task 3.5: PATH and HOME ..................................................................... 57 Task 3.6: Find Where You Are with pwd ............................................. 58 Task 3.7: Move to Another Location with cd ...................................... 58 Summary .................................................................................................. 60 Workshop ................................................................................................ 60 Key Terms ........................................................................................... 60 Questions ............................................................................................ 62 Preview of the Next Hour .................................................................... 62 4 Listing Files and Managing Disk Usage 63 Goals for This Hour ................................................................................. 63 The ls Command ..............................................................................
Recommended publications
  • Configuring UNIX-Specific Settings: Creating Symbolic Links : Snap
    Configuring UNIX-specific settings: Creating symbolic links Snap Creator Framework NetApp September 23, 2021 This PDF was generated from https://docs.netapp.com/us-en/snap-creator- framework/installation/task_creating_symbolic_links_for_domino_plug_in_on_linux_and_solaris_hosts.ht ml on September 23, 2021. Always check docs.netapp.com for the latest. Table of Contents Configuring UNIX-specific settings: Creating symbolic links . 1 Creating symbolic links for the Domino plug-in on Linux and Solaris hosts. 1 Creating symbolic links for the Domino plug-in on AIX hosts. 2 Configuring UNIX-specific settings: Creating symbolic links If you are going to install the Snap Creator Agent on a UNIX operating system (AIX, Linux, and Solaris), for the IBM Domino plug-in to work properly, three symbolic links (symlinks) must be created to link to Domino’s shared object files. Installation procedures vary slightly depending on the operating system. Refer to the appropriate procedure for your operating system. Domino does not support the HP-UX operating system. Creating symbolic links for the Domino plug-in on Linux and Solaris hosts You need to perform this procedure if you want to create symbolic links for the Domino plug-in on Linux and Solaris hosts. You should not copy and paste commands directly from this document; errors (such as incorrectly transferred characters caused by line breaks and hard returns) might result. Copy and paste the commands into a text editor, verify the commands, and then enter them in the CLI console. The paths provided in the following steps refer to the 32-bit systems; 64-bit systems must create simlinks to /usr/lib64 instead of /usr/lib.
    [Show full text]
  • Types and Programming Languages by Benjamin C
    < Free Open Study > . .Types and Programming Languages by Benjamin C. Pierce ISBN:0262162091 The MIT Press © 2002 (623 pages) This thorough type-systems reference examines theory, pragmatics, implementation, and more Table of Contents Types and Programming Languages Preface Chapter 1 - Introduction Chapter 2 - Mathematical Preliminaries Part I - Untyped Systems Chapter 3 - Untyped Arithmetic Expressions Chapter 4 - An ML Implementation of Arithmetic Expressions Chapter 5 - The Untyped Lambda-Calculus Chapter 6 - Nameless Representation of Terms Chapter 7 - An ML Implementation of the Lambda-Calculus Part II - Simple Types Chapter 8 - Typed Arithmetic Expressions Chapter 9 - Simply Typed Lambda-Calculus Chapter 10 - An ML Implementation of Simple Types Chapter 11 - Simple Extensions Chapter 12 - Normalization Chapter 13 - References Chapter 14 - Exceptions Part III - Subtyping Chapter 15 - Subtyping Chapter 16 - Metatheory of Subtyping Chapter 17 - An ML Implementation of Subtyping Chapter 18 - Case Study: Imperative Objects Chapter 19 - Case Study: Featherweight Java Part IV - Recursive Types Chapter 20 - Recursive Types Chapter 21 - Metatheory of Recursive Types Part V - Polymorphism Chapter 22 - Type Reconstruction Chapter 23 - Universal Types Chapter 24 - Existential Types Chapter 25 - An ML Implementation of System F Chapter 26 - Bounded Quantification Chapter 27 - Case Study: Imperative Objects, Redux Chapter 28 - Metatheory of Bounded Quantification Part VI - Higher-Order Systems Chapter 29 - Type Operators and Kinding Chapter 30 - Higher-Order Polymorphism Chapter 31 - Higher-Order Subtyping Chapter 32 - Case Study: Purely Functional Objects Part VII - Appendices Appendix A - Solutions to Selected Exercises Appendix B - Notational Conventions References Index List of Figures < Free Open Study > < Free Open Study > Back Cover A type system is a syntactic method for automatically checking the absence of certain erroneous behaviors by classifying program phrases according to the kinds of values they compute.
    [Show full text]
  • Solaris 10 807 Release Notes
    Solaris 10 8/07 Release Notes Oracle Corporation 500 Oracle Parkway Redwood City, CA 94065 U.S.A. Part No: 820–1259–13 August 2007 Copyright © 2008, 2011, Oracle and/or its affiliates. All rights reserved. License Restrictions Warranty/Consequential Damages Disclaimer This software and related documentation are provided under a license agreement containing restrictions on use and disclosure and are protected by intellectual property laws. Except as expressly permitted in your license agreement or allowed by law, you may not use, copy, reproduce, translate, broadcast, modify, license, transmit, distribute, exhibit, perform, publish or display any part, in any form, or by any means. Reverse engineering, disassembly, or decompilation of this software, unless required by law for interoperability, is prohibited. Warranty Disclaimer The information contained herein is subject to change without notice and is not warranted to be error-free. If you find any errors, please report them to us in writing. Restricted Rights Notice If this is software or related documentation that is delivered to the U.S. Government or anyone licensing it on behalf of the U.S. Government, the following notice is applicable: U.S. GOVERNMENT RIGHTS Programs, software, databases, and related documentation and technical data delivered to U.S. Government customers are "commercial computer software" or "commercial technical data" pursuant to the applicable Federal Acquisition Regulation and agency-specific supplemental regulations. As such, the use, duplication, disclosure, modification, and adaptation shall be subject to the restrictions and license terms set forth in the applicable Government contract,and, to the extent applicable by the terms of the Government contract, the additional rights set forth in FAR 52.227-19, Commercial Computer Software License (December 2007).
    [Show full text]
  • Cisco Telepresence ISDN Link API Reference Guide (IL1.1)
    Cisco TelePresence ISDN Link API Reference Guide Software version IL1.1 FEBRUARY 2013 CIS CO TELEPRESENCE ISDN LINK API REFERENCE guide D14953.02 ISDN Link API Referenec Guide IL1.1, February 2013. Copyright © 2013 Cisco Systems, Inc. All rights reserved. 1 Cisco TelePresence ISDN Link API Reference Guide ToC - HiddenWhat’s in this guide? Table of Contents text The top menu bar and the entries in the Table of Introduction ........................................................................... 4 Description of the xConfiguration commands ......................17 Contents are all hyperlinks, just click on them to go to the topic. About this guide ...................................................................... 5 Description of the xConfiguration commands ...................... 18 User documentation overview.............................................. 5 We recommend you visit our web site regularly for Technical specification ......................................................... 5 Description of the xCommand commands .......................... 44 updated versions of the user documentation. Support and software download .......................................... 5 Description of the xCommand commands ........................... 45 What’s new in this version ...................................................... 6 Go to:http://www.cisco.com/go/isdnlink-docs Description of the xStatus commands ................................ 48 Automatic pairing mode ....................................................... 6 Description of the
    [Show full text]
  • An Introduction to the X Window System Introduction to X's Anatomy
    An Introduction to the X Window System Robert Lupton This is a limited and partisan introduction to ‘The X Window System’, which is widely but improperly known as X-windows, specifically to version 11 (‘X11’). The intention of the X-project has been to provide ‘tools not rules’, which allows their basic system to appear in a very large number of confusing guises. This document assumes that you are using the configuration that I set up at Peyton Hall † There are helpful manual entries under X and Xserver, as well as for individual utilities such as xterm. You may need to add /usr/princeton/X11/man to your MANPATH to read the X manpages. This is the first draft of this document, so I’d be very grateful for any comments or criticisms. Introduction to X’s Anatomy X consists of three parts: The server The part that knows about the hardware and how to draw lines and write characters. The Clients Such things as terminal emulators, dvi previewers, and clocks and The Window Manager A programme which handles negotiations between the different clients as they fight for screen space, colours, and sunlight. Another fundamental X-concept is that of resources, which is how X describes any- thing that a client might want to specify; common examples would be fonts, colours (both foreground and background), and position on the screen. Keys X can, and usually does, use a number of special keys. You are familiar with the way that <shift>a and <ctrl>a are different from a; in X this sensitivity extends to things like mouse buttons that you might not normally think of as case-sensitive.
    [Show full text]
  • Technical Data Specifications & Capacities
    5669 (supersedes 5581)-0114-L9 1 Technical Data Specifications & Capacities Crawler Crane 300 Ton (272.16 metric ton) CAUTION: This material is supplied for reference use only. Operator must refer to in-cab Crane Rating Manual and Operator's Manual to determine allowable crane lifting capacities and assembly and operating procedures. Link‐Belt Cranes 348 HYLAB 5 5669 (supersedes 5581)-0114-L9 348 HYLAB 5 Link‐Belt Cranes 5669 (supersedes 5581)-0114-L9 Table Of Contents Upper Structure ............................................................................ 1 Frame .................................................................................... 1 Engine ................................................................................... 1 Hydraulic System .......................................................................... 1 Load Hoist Drums ......................................................................... 1 Optional Front-Mounted Third Hoist Drum................................................... 2 Boom Hoist Drum .......................................................................... 2 Boom Hoist System ........................................................................ 2 Swing System ............................................................................. 2 Counterweight ............................................................................ 2 Operator's Cab ............................................................................ 2 Rated Capacity Limiter System .............................................................
    [Show full text]
  • Unix/Linux Command Reference
    Unix/Linux Command Reference .com File Commands System Info ls – directory listing date – show the current date and time ls -al – formatted listing with hidden files cal – show this month's calendar cd dir - change directory to dir uptime – show current uptime cd – change to home w – display who is online pwd – show current directory whoami – who you are logged in as mkdir dir – create a directory dir finger user – display information about user rm file – delete file uname -a – show kernel information rm -r dir – delete directory dir cat /proc/cpuinfo – cpu information rm -f file – force remove file cat /proc/meminfo – memory information rm -rf dir – force remove directory dir * man command – show the manual for command cp file1 file2 – copy file1 to file2 df – show disk usage cp -r dir1 dir2 – copy dir1 to dir2; create dir2 if it du – show directory space usage doesn't exist free – show memory and swap usage mv file1 file2 – rename or move file1 to file2 whereis app – show possible locations of app if file2 is an existing directory, moves file1 into which app – show which app will be run by default directory file2 ln -s file link – create symbolic link link to file Compression touch file – create or update file tar cf file.tar files – create a tar named cat > file – places standard input into file file.tar containing files more file – output the contents of file tar xf file.tar – extract the files from file.tar head file – output the first 10 lines of file tar czf file.tar.gz files – create a tar with tail file – output the last 10 lines
    [Show full text]
  • README for X11R7.5 on Netbsd Rich Murphey David Dawes Marc Wandschneider Mark Weaver Matthieu Herrb Table of Contents What and Where Is X11R7.5?
    README for X11R7.5 on NetBSD Rich Murphey David Dawes Marc Wandschneider Mark Weaver Matthieu Herrb Table of Contents What and Where is X11R7.5?..............................................................................................3 New OS dependent features...............................................................................................3 Configuring X for Your Hardware.....................................................................................4 Running X..............................................................................................................................5 Kernel Support for X............................................................................................................5 Rebuilding the X Distribution...........................................................................................7 Building New X Clients.......................................................................................................8 Thanks.....................................................................................................................................8 What and Where is X11R7.5? X11R7.5 is an Open Source version of the X Window System that supports several UNIX(R) and UNIX-like operating systems (such as Linux, the BSDs and Solaris x86) on Intel and other platforms. This version is compatible with X11R6.6, and is based on the XFree86 4.4.0RC2 code base, which, in turn was based on the X consortium sample implementation. See the Copyright Notice1. The sources for X11R7.5
    [Show full text]
  • Introduction to Tivoli Enterprise Data Warehouse
    Front cover Introduction to Tivoli Enterprise Data Warehouse Insider’s guide to Tivoli Enterpise Data Warehouse Best practices for creating data marts Integration with all major OLAP tools Vasfi Gucer William Crane Chris Molloy Sven Schubert Roger Walker ibm.com/redbooks International Technical Support Organization Introduction to Tivoli Enterprise Data Warehouse May 2002 SG24-6607-00 Take Note! Before using this information and the product it supports, be sure to read the general information in “Notices” on page xvii. First Edition (May 2002) This edition applies to Tivoli Enterprise Data Warehouse Version 1.1. Comments may be addressed to: IBM Corporation, International Technical Support Organization Dept. JN9B Building 003 Internal Zip 2834 11400 Burnet Road Austin, Texas 78758-3493 When you send information to IBM, you grant IBM a non-exclusive right to use or distribute the information in any way it believes appropriate without incurring any obligation to you. © Copyright International Business Machines Corporation 2002. All rights reserved. Note to U.S Government Users – Documentation related to restricted rights – Use, duplication or disclosure is subject to restrictions set forth in GSA ADP Schedule Contract with IBM Corp. Contents Figures . .ix Tables . xv Notices . xvii Trademarks . xviii Preface . xix The team that wrote this redbook. xx Notice . xxi Comments welcome. xxii Chapter 1. Introducing building blocks. 1 1.1 Business Intelligence. 2 1.2 Business driving forces . 2 1.3 Main Business Intelligence terms . 3 1.3.1 Operational databases . 4 1.3.2 Online transaction processing (OLTP) . 4 1.3.3 Data warehouse . 5 1.3.4 Data mart .
    [Show full text]
  • Hitachi Command Suite Dynamic Link Manager (For Windows®) User Guide
    Hitachi Command Suite Dynamic Link Manager (for Windows®) 8.6.4 User Guide This document describes how to use the Hitachi Dynamic Link Manager for Windows. The document is intended for storage administrators who use Hitachi Dynamic Link Manager to operate and manage storage systems. Administrators should have knowledge of Windows and its management functionality, storage system management functionality, cluster software functionality, and volume management software functionality. MK-92DLM129-45 April 2019 © 2014, 2019 Hitachi, Ltd. All rights reserved. No part of this publication may be reproduced or transmitted in any form or by any means, electronic or mechanical, including copying and recording, or stored in a database or retrieval system for commercial purposes without the express written permission of Hitachi, Ltd., or Hitachi Vantara Corporation (collectively "Hitachi"). Licensee may make copies of the Materials provided that any such copy is: (i) created as an essential step in utilization of the Software as licensed and is used in no other manner; or (ii) used for archival purposes. Licensee may not make any other copies of the Materials. "Materials" mean text, data, photographs, graphics, audio, video and documents. Hitachi reserves the right to make changes to this Material at any time without notice and assumes no responsibility for its use. The Materials contain the most current information available at the time of publication. Some of the features described in the Materials might not be currently available. Refer to the most recent product announcement for information about feature and product availability, or contact Hitachi Vantara Corporation at https://support.hitachivantara.com/en_us/contact-us.html.
    [Show full text]
  • UNIX/Linux Server – Red Hat 1
    EXEMPTION TEST INFORMATION FORM CIST 2432 – UNIX/Linux Server – Red Hat 1 A currently enrolled or accepted program student may receive course credit by passing the CIST 2432 exemption examination administered by the Gwinnett Technical College Assessment Center. The policy regarding Experiential Credit and Credit by Examination is in the College catalog. The examination must be completed prior to registration for the class for which the student is seeking credit by examination. Students may not request exemption tests for courses in which they have been enrolled nor may they take an exemption test more than once. The CIST 2432 exemption examination will cover these competencies: 1. UNIX/Linux Server Installation Process, Software Packages and Kernel Building 2. Manage Run Levels 3. UNIX/Linux Server Users and Groups 4. UNIX/Linux Server Security Permissions 5. UNIX/Linux Server File System 6. UNIX/Linux Server Memory and Process Management 7. UNIX/Linux Server System Log Files 8. UNIX/Linux Server Boot Process 9. UNIX/Linux Server System Configuration Files 10. UNIX/Linux Server File Backup and Restore 11. UNIX/Linux Server Compression 12. UNIX/Linux Server Fault Tolerance 13. UNIX/Linux Server Printing A student needs to score an 80% or higher on the CIST 2432 exemption examination to receive exemption credit. A student may want to review the below Red Hat textbook before taking the exemption exam: Product Name: Red Hat System Administration I Workbook (Guide) – English. Product Code: RH124-EN-SG-H. The Workbook uses a Product Code instead of an ISBN Number. In order to obtain your student guide, you must access the below link and create a Student account: https://www.gilmore.ca/redhat/registeruser.aspx?fcfca7159e743576c6d3a252fe1dfe1e.
    [Show full text]
  • Appendix A. Installation and Troubleshooting
    The Almagest A-1 Appendix A. Installation and Troubleshooting Authors: Joseph T. Buck Christopher Hylands Alan Kamas Other Contributors: Stephen Edwards Edward A. Lee Kennard White A.1 Introduction This appendix consists of the following sections: • “Obtaining Ptolemy” on page A-1 discusses how to obtain Ptolemy. • “Ptolemy mailing lists and the Ptolemy newsgroup” on page A-2, discusses various forums for discussion about Ptolemy. • “Installation” on page A-3 discusses how to install Ptolemy. • “Troubleshooting” on page A-15 discusses how to find and fix problems in Ptolemy. • “Known bugs” on page A-32 lists known problems in Ptolemy. • “Additional resources” on page A-39 discusses other resources. A.2 Obtaining Ptolemy Ptolemy binaries are currently available for the following architectures: HP running HPUX10.20, Sun 4 (Sparc) running Solaris2.5.1,. In addition, Ptolemy has been compiled on SunOS4.x HPUX9.x, Linux RedHat 5.0, NetBSD_i386, IBM RS/6000 AIX4.x, SGI Irix6.x and the DEC Alpha Digital Unix 4 platforms. These additional platforms are not supported in- house and thus these ports are not tested and may not be complete. Installing the full system requires about 150 Megabytes of disk space (more if you optionally remake). The demonstration version of Ptolemy, “Ptiny,” only requires 12 Mega- bytes of disk space. All versions requires at least 8 Megabytes of physical memory. For the latest information on Ptolemy, get the Frequently Asked Questions list. Send electronic mail to [email protected] with the message: get ptolemy-hackers.FAQ in the body (not the subject) of the message.
    [Show full text]