Linux Level 1. Student Manual.

Size: px
Start display at page:

Download "Linux Level 1. Student Manual."

Transcription

1 Linux Level 1 Student Manual

2 Copyright One Course Source, 2007 ALL RIGHTS RESERVED This publication contains proprietary and confidential information, which is the property of One Course Source, 2340 Tampa Ave, Suite J, El Cajon, CA No part of this publication is be reproduced, copied, disclosed, transmitted, stored in a retrieval system or translated into any human or computer language, in any form, by any means, in whole or in part, without the prior express written consent of One Course Source. THIS PUBLICATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. REFERENCES TO CORPORATIONS, THEIR SERVICES AND PRODUCTS, ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED. IN NO EVENT SHALL ONE COURSE SOURCE BE LIABLE FOR ANY SPECIAL, INCIDENTAL, INDIRECT, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ARISING OUT OF OR IN CONNECTION WITH THE USE OF THIS INFORMATION. Descriptions of, or references to, products or publications within this publication do not imply endorsement of that product or publication. One Course Source makes no warranty of any kind with respect to the subject matter included herein, the products listed herein, or the completeness or accuracy of this publication. One Course Source specifically disclaims all warranties, express, implied or otherwise, including without limitation, all warranties of merchantability and fitness for a particular purpose. THIS PUBLICATION COULD INCLUDE TECHNICAL INACCURACIES OR TYPOGRAPHICAL ERRORS. CHANGES ARE PERIODICALLY ADDED TO THE INFORMATION HEREIN; THESE CHANGES WILL BE INCORPORATED IN NEW EDITIONS OF THE PUBLICATION. ONE COURSE SOURCE MAY MAKE IMPROVEMENTS AND/OR CHANGES IN THE PRODUCT(S) AND/OR THE PROGRAM(S) DESCRIBED IN THIS PUBLICATION AT ANY TIME. This notice may not be removed or altered. ver /21/ Q1

3 Module Table of Contents Introduction Unit One Basic Linux Concepts Page Definition of Linux History of Linux Basic Linux Terms Accessing a Linux Machine Logging In Passwords Additional Resources Summary of Commands and Files Certification Notes Lab Exercises 37 Unit Two Using the GUIs Page Linux GUI s Using Gnome Configuring Gnome Virtual Terminals Fixing Gnome Problems Additional Resources Certification Notes Lab Exercises 65 Table of Contents 2007 One Course Source Page 2

4 Unit Three The Filesystem Page Definition of Filesystem Filesystem Terms Using Pathnames Listing Files Making Directories Removing Directories Accessing CD-ROM and Floppy Drives Additional Resources Summary of Commands and Files Certification Notes Lab Exercises 90 Unit Four Handling Files Page Copying Files Moving Files Removing Files Looking at the Contents of Files Useful Commands Additional Resources Summary of Commands and Files Certification Notes Lab Exercises 112 Table of Contents 2007 One Course Source Page 3

5 Unit Five File Manipulation Page Word Count Man Pages Filter Commands sort cmp diff comm Finding Files Finding Commands Additional Resources Summary of Commands and Files Certification Notes Lab Exercises 174 Unit Six Metacharacters Page Definition of Metacharacters The ; Character "Wildcards" Redirection Using tee Additional Resources Summary of Commands and Files Certification Notes Lab Exercises 196 Table of Contents 2007 One Course Source Page 4

6 Unit Seven Shell Features Page Variables Variable Usage in the BASH Shell Variables Usage in the TCSH Shell Aliases Quoting Name Completion Command Line Editing Additional Resources Summary of Commands and Files Certification Notes Lab Exercises 230 Unit Eight File Security Page Basic Linux Permissions Setting Default Permissions Additional Resources Summary of Commands and Files Certification Notes Lab Exercises 246 Table of Contents 2007 One Course Source Page 5

7 Unit Nine The vi Editor Page What is vi? vi Modes Movement Commands Input Commands Delete and Search Commands Advanced Commands Advanced Commands Additional Resources Certification Notes Lab Exercises 260 Unit Ten Jobs and Processes Page Starting Jobs Pausing Jobs Restarting Jobs Stopping Jobs Using nohup Controlling Job Priority Additional Resources Summary of Commands and Files Certification Notes Lab Exercises 283 Table of Contents 2007 One Course Source Page 6

8 Unit Eleven File Compression Page tar gzip zip Additional Compression Commands Additional Resources Summary of Commands and Files Certification Notes Lab Exercises 305 Unit Twelve Installation Page Hardware Requirements for Linux Installation Methods Installation Additional Resources Summary of Commands and Files Certification Notes Lab Exercises 349 Unit Thirteen Advanced Installation Page Kickstart Expert Installation Network Installation Additional Resources Summary of Commands and Files Certification Notes Lab Exercises 365 Table of Contents 2007 One Course Source Page 7

9 Unit Fourteen Post Installation Page LILO & GRUB Basic Network Configuration Post Install File Displaying Disk Usage by Directory Displaying Disk Usage by File System Configuring the X Window System Additional Configurations (keyboard, mouse, etc.) Additional Resources Summary of Commands and Files Certification Notes Lab Exercises 419 Table of Contents 2007 One Course Source Page 8

10 Unit Fifteen Software Administration Page Using RPM Listing Package Information Removing Packages Installing Packages Updating Packages Verifying Package Additional RPM Features Red Hat Network GUI Tools Installing Non-Packaged Software Finding software Package management with Debian Additional Resources Summary of Commands and Files Certification Notes Lab Exercises 454 Table of Contents 2007 One Course Source Page 9

11 Unit Sixteen Maintaining User Accounts Page The /etc/passwd File The /etc/shadow File The /etc/group File The /etc/gshadow File The groupadd Command The groupdel Command The groupmod Command The gpasswd Command The grpck Command The useradd Command The userdel Command The usermod Command Additional Change User Commands GUI Tools Additional Resources Summary of Commands and Files Certification Notes Lab Exercises 496 Table of Contents 2007 One Course Source Page 10

12 Unit Seventeen Administrating Initialization Files Page What are Initialization Files? A Review of Common Customizations The bash Shell Initialization Files The tcsh Shell Initialization Files Testing Initialization Files Additional login files Additional Resources Summary of Commands and Files Certification Notes Lab Exercises 517 Unit Eighteen The Boot Process Page The Boot Sequence Run Levels The init Phase Changing to Different Run Levels Modifying Run Levels Additional Resources Summary of Commands and Files Certification Notes Lab Exercises 552 Table of Contents 2007 One Course Source Page 11

13 Unit Nineteen crontab and at Page Using crontab The anacron script The at command Summary of commands and files Additional Resources Certification Notes Lab Exercises 576 Page Appendix A...Preparing for Certification Exams 577 Appendix B...Preparing for RHCE and RHCT Exams 578 Appendix C...reparing for the LPI Exams 579 Appendix D...Preparing for the Linux+ Exam 580 Table of Contents 2007 One Course Source Page 12

14 Introduction About this course The series of manuals that this manual is a part of was designed with two goals in mind: 1. Prepare the student to be able to accomplish tasks on a Linux Operating System. 2. Prepare the student to take and pass Linux certification exams. The authors of this series of Linux manuals are firm believers in preparing students to not only pass certification exams, but to also to develop the experience to perform the tasks on the Linux OS. As a result, we have taken a very "hands on" and practical approach towards presenting the material as opposed to a "memorize facts" approach. We firmly believe that obtaining a certification without the ability to perform the tasks on a live system does not result in any benefit to the student. Introduction 2007 One Course Source Page 13

15 Typographical syntax Examples in this text of commands will appear in bold text and the output of the commands will appear in italic text. The commands and the output of the commands will be placed in a box to separate them from other text. Example: [student@ocs1 student]$ pwd /home/student Note: "[student@ocs1 student]$" is a prompt, a method the shell uses to say I m ready for a new command. Bold text within a sentence will indicate an important term or a command. Files and directories are highlighted by being placed in courier font. Introduction 2007 One Course Source Page 14

16 Using this manual while in class In many ways, class manuals are different from textbooks. Textbooks are often filled with lengthy paragraphs that explain a topic in detail. Unfortunately, this style doesn t work well in a classroom environment. Class manuals often are much more concise than textbooks. Its difficult to follow the instructor s example and read lengthy paragraphs in a book at the same time. For this purpose, class manuals are often more terse. You may consider referring to the manual occasionally while focusing primarily on the instructor's presentation. Using this manual after class The manual was designed to be used as a reference after class. If you are studying for a certification exam, each Unit has a section called "Certification Notes". This section shows you which topics in the Unit prepare you for the exam that you plan to take. You can also use this manual to assist you while working with Linux at home or at work. In addition to the information in the lecture part of the unts, each Unit has a "Additional Resources" section as well as a " Summary of Commands and Files" section to aid you in finding information. Introduction 2007 One Course Source Page 15

17 Lab Exercises The lab exercises provided in this class are intended to provide practical, hands on experience with a Linux Operating System. Students are strongly encouraged to perform the labs provided at the end of each Unit to reinforce the knowledge provided in class. Students are also encouraged to perform the labs that accompany this manual during class (if time permits) or after class is complete. These labs are also designed to reinforce the material provided in class. The class files also include solutions for the lab exercises found in this manual. Introduction 2007 One Course Source Page 16

18 Which Linux distribution should you use? If your organization has already chosen a distribution of Linux, you may not have a choice in which distribution to use at work. However, you do have the choice of what distribution to use at home or what distribution to use to study for the certification exams. While just about all users and administrators have their own "favorite" distribution of Linux, the suggestions that we make here are based primarily on several practical criteria such as overall popularity, relevance to certification exams and the cost of the distribution. Choice based on popularity and cost: This criteria is by far the most difficult one as the popularity of Linux distributions is difficult to determine. Our experience tells us that Red Hat Enterprise Linux ( and SUSE ( roductsmenu_sles) are the two most popular Linux distributions in the business world. Since these two distributions are not free, other distributions are more popular in the "home" Linux world. Fedora (fedora.redhat.com/), a Red Hat-sponsored distribution and Gentoo ( are two popular free Linux distributions Introduction 2007 One Course Source Page 17

19 Choice based on relevance to certification exams: If you are taking the LPI or Linux+ certification exams, your choice of which distribution to use to practice should not matter. Both of these exams attempt to be "distribution neutral". You should be aware, however, that the LPI exams do have one area that is somewhat "not neutral": software installation. There are two sets of utilities used to install software on Linux: Red Hat Package Management (rpm) and Debian Package Management (dpkg). At one, you could choose to take an exam that has either rpm or dpkg questions. As of now, you must know both rpm and dpkg With the RHCT and RHCE exams, the distribution choice is very important and clear. You don't want to practice on a SUSE distribution and then go take the RHCT or RHCE exam. For these exams, you want to practice on the Red Hat Enterprise Linux distribution that the exam will be given on. If you don't want to pay for this distribution, consider using either White Box Enterprise Linux ( or Fedora. Very important: If you use one of these distributions, make sure that you get one that is "close" to the Red Hat Enterprise Linux distribution that the exam is based on. Check the release dates of the distributions to make sure you have a distribution that is similar to Red Hat Enterprise Linux. Introduction 2007 One Course Source Page 18

20 A mention on Live Linux distributions: One additional factor you may consider when choosing a Linux distribution is the availability of machines or hard drive space. If you don't have a spare machine or a hard drive with "extra" space to dual boot, you may consider using a "Live" Linux distribution. Typically these are referred to as "Live CD" distributions, but some are also available on DVD. A "Live" Linux distribution is one that doesn't require any installation; you can boot the OS directly from the CD or DVD. The most popular and flexible of these distributions is Knoppix ( SUSE also has a "Live" distribution ( html). Additional "Live" distributions (as well as many other "regular" distributions) can be found on by clicking on the "distributions" link and filling out the form towards the bottom of the page. Introduction 2007 One Course Source Page 19

21 Installation instructions for after class labs If you are practicing after class, you will want to install your system in a manner that will be best for performing labs. While you may use any distribution of Linux, the labs will work best for either Red Hat Enterprise Linux or Fedora. To provide as much flexibility as possible, install your system using the following parameters: 1. Leave enough hard disk space free to allow you to add partitions as required. 2. Install the default software packages only - add packages later as needed 3. Don't modify the boot loader. 4. Don't implement a firewall Other than these general parameters, use values that work best for your environment. Introduction 2007 One Course Source Page 20

22 Floppy contents The class data files that accompanies this course contains the following: All of the examples files required for examples displayed in this manual All of the answers to the labs provided in the manual Additional exercises Introduction 2007 One Course Source Page 21

23 Unit One Basic Linux Concepts Unit topics: Page Definition of Linux History of Linux Basic Linux Terms Accessing a Linux Machine Logging In Passwords Additional Resources Summary of Commands and Files Certification Notes Lab Exercises 37 1 Basic Linux Concepts 2007 One Course Source Page 22

24 1.1 Definition of Linux Linux is an operating system much like DOS, Microsoft Windows or the Macintosh OS. Like most operating systems, it provides two forms of interface: 1. Command line interface (called a shell) 2. Graphical User Interface (called a GUI) This manual will focus primarily on the command line interface due to the power this interface provides. Unit 2 will give general information about the primary GUIs available for Linux. Additional GUI-based programs will also be reviewed when appropriate in other Units. One of best way to begin to understand Linux is to explore (briefly) the history of Linux. 1 Basic Linux Concepts 2007 One Course Source Page 23

25 1.2 History of Linux In 1970 Bell Labs released the first version of the UNIX Operating System (OS). During the 1970s UNIX became a very popular OS for mainframes and minicomputers. When "personal computers" started making their way into the marketplace, UNIX was modified to run on them (this process is called "porting"). Unfortunately, UNIX was an expensive bit of software and most PC users didn't want to pay the price. Linus Torvalds was a student at the University of Helsinki in the early 1990's. While he liked UNIX, he didn't like the price tag. He started creating an UNIXlike OS that ran on PC's and, with the help of many others, it eventually grew into what Linux is today. While UNIX users may claim that Linux is "just like UNIX", this is an oversimplification. Linus Torvalds did indeed base Linux off of Minix (a PCbased UNIX OS itself). However, the source code that is the heart of Linux was written "from scratch", not modified from the original UNIX source code as UNIX vendors have done in the past. 1 Basic Linux Concepts 2007 One Course Source Page 24

26 When first released in 1991, Linux didn't compare with the powerful Operating Systems of the time. However, as Linus provided the source code of Linux to anyone who wanted it, Linux's power grew as more people created software for it. As Linux grew it became a more powerful OS. Organizations created commercial versions of the Linux OS. There are, in fact, hundreds of different releases of Linux. You can see the latest distributions at Important features of Linux development A great deal of Linux's core software cames from the GNU project. Linux core software is licensed under the GNU General Public License. The license allows anyone the legal right to copy, modify or redistribute Linux. This sort of license is often called "copyleft". Today there are many different "varieties" of Linux called "distributions" or "distros" (FYI: UNIX varieties are called "flavors"). They are based on the same core software (the Linux kernel and associated GNU programs) but are different in that they provide different additional features. 1 Basic Linux Concepts 2007 One Course Source Page 25

27 1.3 Basic Linux Terms The primary method that users utilize to interface with the Linux Operating System is a shell. There are many shells available in most Linux systems The Bourne shell (/bin/sh): The original shell, not often used by the average user due to its limited capabilities. Many Linux distros no longer provide the Bourne shell. While the file /bin/sh may exist on some distributions, it is normally a link to /bin/bash (the Bourne Again Shell). The Bourne Again Shell (/bin/bash): A superset of the Bourne shell; All of the commands and syntax (how you type a command) that work in the Bourne shell also work in bash, but additional features have been added. The Korn shell (/bin/ksh): Another superset of the Bourne shell (bash has more features than the Korn shell). The C shell (/bin/csh): Based upon the syntax of the C programming language, the C shell has many of the same capabilities as the Korn shell, although the syntax is different. Note: Many Linux distros no longer provide the C shell. While the file /bin/csh does exist in some distributions, it is normally just a link to /bin/tcsh. The T-C shell (/bin/tcsh): A superset of the C shell, the T-C shell provides additional functionality such as bringing up previous commands for editing via the up arrow key. Note: Additional shells may be available in your Linux distribution. 1 Basic Linux Concepts 2007 One Course Source Page 26

28 Important note on shells: This manual will be taught primarily using the bash shell. This is due to the fact that the Linux certification exams favor the bash shell. Most of the material in the manual is "shell independent" since the differences between the shells is primarily the features that are provided, not the way that the Linux commands work. Kernel: The shell acts as an interface between the user and a program called the kernel. The kernel is the core of the Linux operating system. It translates users commands into a language that the machine hardware can understand: shell kernel hardware The user types a command in the shell the kernel translates the command the machine hardware performs the action requested. Note: The kernel provides additional functions as well. These additional functions will be explored in another class. The root user: The root user (or superuser) is the user who has absolute control over the machine. Other Operating Systems may refer to this user as the administrator. 1 Basic Linux Concepts 2007 One Course Source Page 27

29 Swap space: Space on the hard drive the system can use to store RAM data during times of heavy system use. Swap space is also known as virtual memory. Daemons: Processes that run in the background "waiting" for an activity to take place. Once this activity occurs, the daemon "awakes" and performs a function. Normally administrators handle the task of managing daemons. 1 Basic Linux Concepts 2007 One Course Source Page 28

30 1.4 Accessing a Linux Machine Linux is an environment in which networking plays a powerful role. Since its inception, the Linux environment has supported networking. Logging into a Linux machine can take place in a number of different ways: At the console: In order to log into the console, you must sit down at the monitor that is directly attached to the machine. At a remote terminal: A remote terminal is a monitor that is connected to the network that is, in turn, connected to the host you are logging into. Terminals typically have keyboards, but no other devices (like hard drives, memory or CPU). From a remote host: Once you have logged into one host, you can log into another host through the network. From a PC or Mac: PC s and Mac s have the capability to allow you to connect and log into a Linux host. The most common type of program for this process is called telnet. 1 Basic Linux Concepts 2007 One Course Source Page 29

31 1.5 Logging In There are typically two methods of logging into a Linux machine. One method is via a GUI login screen. The second method, shown below, is the command line login. Both methods require two bits of data from you: your login name (commonly referred to as a username) and your password. Your system administrator will provide you with both a username and a password. Example of logging in: ocs1 login: student Password: Last login: Mon Aug 10 17:01:14 on tty [student@ocs1 student] After you log in, the system will display some information, followed by a prompt. The prompt will typically be the user's name and the machine's name followed by the directory you are currently in ([student@ocs1 student] in the example above). The prompt is configurable as we will learn in a later Unit. 1 Basic Linux Concepts 2007 One Course Source Page 30

32 1.6 Passwords Many Linux distributions have rules for passwords. In addition, administrators can modify the password rules. The most common password rules define that a password: 1. Must have at least 6 characters 2. Can't be a word in the dictionary or any variation of a word in the dictionary 3. Must have 2 alphabetic characters 4. Must have 1 numeric or special character 5. Must be different than user's login name Good passwords are hard to create. The password #FW&31z is a good password in the sense that it is fairly complex, but it is not an easy one to remember. Here are a couple of techniques you can use to come up with a complex, yet easy-to-remember password: The sentence password: Pick a sentence from a book (or make one up) that is easy to remember. For example, The old, lazy dog ate his food. Now take the first letter of each word of the sentence (you might want to include punctuation also) and there is your password (To,ldahf. in this case). 1 Basic Linux Concepts 2007 One Course Source Page 31

33 The flip-flop password: Take a word that is six or seven characters. Split it in half and flip the second half in front of the first half. Lastly, add a number or special character in the middle before you rejoin the two half. For example, the word windows could become dows4win. The Translation password: This one takes a bit of practice. The basic concept is to take a word and substitute the letters for similar characters on the keyboard. For example, take the word password. The "o" is similar to "0" (zero), so substitute o for 0 and you get passw0rd. The "s" looks similar to a "5", so you get pa55w0rd. The "w" looks similar to the "~" (or so some people think), so you get pa55~0rd. You can probably make this password even more complex by making the first and last letters capitals, but even the small changes made so far makes it fairly complex. 1 Basic Linux Concepts 2007 One Course Source Page 32

34 Using the passwd command Users change their password with the passwd command. This command first prompts for the current (old) password then twice for the new password: student]$ passwd Changing password for student (current) UNIX password: New password: Retype new password: passwd: all authentication tokens updated successfully If you provide a bad password, you will get an error message: [student@ocs1 student]$ passwd Changing password for student (current) UNIX password: New password: BAD PASSWORD: it is based on a dictionary word 1 Basic Linux Concepts 2007 One Course Source Page 33

35 1.7 Additional Resources Books Red Hat Fedora Linux 3 Bible by Christopher Negus Publisher: John Wiley & Sons ISBN: Chapter #1 Learning Red Hat Enterprise Linux & Fedora, 4th Edition By Bill McCarty Publisher: O'Reilly ISBN: X Chapter #1 Web sites - "Introduction to Linux - A Hands on Guide" Man pages passwd 1 Basic Linux Concepts 2007 One Course Source Page 34

36 1.8 Summary of Commands and Files Command passwd Description Allows users to modify their password 1 Basic Linux Concepts 2007 One Course Source Page 35

37 1.9 Certification Notes Review the following charts to determine what sections in this Unit are relevant for the exam that you are preparing for: Topic RHCT RHCE Linux+ LPI 1-1 LPI 1-2 LPI 2-1 LPI Definition of Linux B B B B B B B 1.2 History of Linux B B B B B B B 1.3 Basic Linux terms B B B B B B B 1.4 Accessing a Linux machine B B B B B B B 1.5 Logging in B B B B B B B 1.6 Passwords X X B B X B B B X N Key Background - May not be on exam itself, but contains information that aids in the understanding of other topics. exam - A topic that is "testable" for this exam Not on exam - Indicates that this topic isn't on the exam and isn't needed to understand other topics on the exam. 1 Basic Linux Concepts 2007 One Course Source Page 36

38 1.10 Lab Exercises 1. Using one of the password creating techniques discussed (or one of your own) and the passwd command, create a new password for your account. 2. After changing your password on the system to the new password you created in step #1, log out of the system. 3. Log back into the system using your new password. For answers to these exercises see the "answers" directory in your class data files. For additional exercises, see the "exercises" directory in your class data files. 1 Basic Linux Concepts 2007 One Course Source Page 37

39 Unit Eleven File Compression Unit topics: Page tar gzip zip Additional Compression Commands Additional Resources Summary of Commands and Files Certification Notes Lab Exercises File Compression 2007 One Course Source Page 285

40 11.1 tar The tar command is used to combine multiple files into a single file. This is useful to archive files or to prepare multiple files for transport (ftp, , etc.). Creating tar files Use the -c option to create tar files: [student@ocs1 student] cd /tmp [student@ocs1 tmp] tar -cvf mail.tar /etc/mail tar: Removing leading `/' from member names etc/mail/ etc/mail/local-host-names etc/mail/makefile etc/mail/access etc/mail/domaintable etc/mail/helpfile etc/mail/trusted-users {remaining output omitted} Option Meaning -c Create a tar file -v Verbose mode. With the -c option this displays which files are being archived. -f Specify the tar file's name 11 File Compression 2007 One Course Source Page 286

41 Listing table of contents List the table of contents of an existing tar file with the -t option: tmp] tar -tvf mail.tar drwxr-xr-x root/root :24:05 etc/mail/ -rw-r--r-- root/root :29:18 etc/mail/local-host-names -rw-r--r-- root/root :29:19 etc/mail/makefile -rw-r--r-- root/root :29:19 etc/mail/access -rw-r--r-- root/root :29:19 etc/mail/domaintable -rw-r--r-- root/root :29:16 etc/mail/helpfile -rw-r--r-- root/root :29:18 etc/mail/trusted-users -rw-r--r-- root/root :29:19 etc/mail/mailertable -rw-r--r-- root/root :29:18 etc/mail/sendmail.mc -rw-r--r-- root/root :03:18 etc/mail/statistics -rw-r--r-- root/root :24:02 etc/mail/virtusertable.db -rw-r--r-- root/root :29:18 etc/mail/virtusertable -rw-r--r-- root/root :24:03 etc/mail/access.db -rw-r--r-- root/root :24:04 etc/mail/domaintable.db -rw-r--r-- root/root :24:05 etc/mail/mailertable.db Option Meaning -t List a tar file's table of contents -v Verbose mode. With the -t option this displays details of each file within the tar file -f Specify the tar file's name 11 File Compression 2007 One Course Source Page 287

42 Extracting tar files Use the -x option to extract files from a tar file: [student@ocs1 tmp] tar -xvf mail.tar etc/mail/ etc/mail/local-host-names etc/mail/makefile etc/mail/access etc/mail/domaintable etc/mail/helpfile etc/mail/trusted-users etc/mail/mailertable etc/mail/sendmail.mc etc/mail/statistics etc/mail/virtusertable.db etc/mail/virtusertable etc/mail/access.db etc/mail/domaintable.db etc/mail/mailertable.db Option Meaning -x Extract files from a tar file -v Verbose mode. With the -x option this displays the file names that are extracted. -f Specify the tar file's name 11 File Compression 2007 One Course Source Page 288

43 Is it a tar file? While it is considered good "tar etiquette" to name tar files with the ".tar" extension, this is not enforced by the command. Most users do use this convention; however, some completely ignore it. When in doubt about a file, use the file command to determine what kind of file it is: [student@ocs1 tmp] file mail.tar mail.tar: GNU tar archive 11 File Compression 2007 One Course Source Page 289

44 11.2 gzip The gzip command can be used to compress files. The method that gzip uses to compress the files the same method that many other compression utilities use (such as Winzip on PC s). Create a gzip file [student@ocs1 student]$ cp /usr/share/dict/linux.words. [student@ocs1 student]$ ls linux.words [student@ocs1 student]$ gzip linux.words [student@ocs1 student]$ ls linux.words.gz Important note: By default, the resulting gzip file will replace the original file. 11 File Compression 2007 One Course Source Page 290

45 Viewing compression ratio To see how much the file is compressed, use the -v option to the gzip command when you compress the file: student]$ gzip -v linux.words linux.words: 67.9% -- replaced with linux.words.gz If the file is already compressed, use the -l option to the gzip command to view compression ratio information: student]$ gzip -l linux.words compressed uncompressed ratio uncompressed_name % linux.words 11 File Compression 2007 One Course Source Page 291

46 Avoiding replacing original file You can use the -c option to avoid replacing the original file with the compressed file. By default, the -c option will send output to STDOUT (standard output). Since the output of gzip is binary in format, you will want to redirect this output back into a file: [student@ocs1 student]$ ls linux.words [student@ocs1 student]$ gzip -c linux.words > linux.words.gz [student@ocs1 student]$ ls linux.words linux.words.gz 11 File Compression 2007 One Course Source Page 292

47 Compressing multiple files You can have the gzip command compress files within directory structures by using the -r option: student]$ cp -r /etc/mail. student]$ ls mail access domaintable.db mailertable sendmail.mc virtusertable access.db helpfile mailertable.db statistics virtusertable.db domaintable local-host-names Makefile trusted-users student]$ gzip -r mail student]$ ls mail access.db.gz helpfile.gz Makefile.gz virtusertable.db.gz access.gz local-host-names.gz sendmail.mc.gz virtusertable.gz domaintable.db.gz mailertable.db.gz statistics.gz domaintable.gz mailertable.gz trusted-users.gz 11 File Compression 2007 One Course Source Page 293

48 Extracting gzip files To unzip a gzip file, use the gunzip command: [student@ocs1 student]$ ls linux.words.gz [student@ ocs1 student]$ gunzip linux.words.gz [student@ ocs1 student]$ ls linux.words 11 File Compression 2007 One Course Source Page 294

49 11.3 zip The zip utility performs the same function as the gzip command in that it can compress files. In addition it can also merge multiple files into a single, compressed file. Create a zip file [student@ocs1 student] cd /tmp [student@ocs1 tmp] zip mail /etc/mail/* adding: etc/mail/access (deflated 40%) adding: etc/mail/access.db (deflated 99%) adding: etc/mail/domaintable (stored 0%) adding: etc/mail/domaintable.db (deflated 99%) adding: etc/mail/helpfile (deflated 55%) adding: etc/mail/local-host-names (deflated 5%) adding: etc/mail/mailertable (stored 0%) adding: etc/mail/mailertable.db (deflated 99%) adding: etc/mail/makefile (deflated 52%) adding: etc/mail/sendmail.mc (deflated 54%) adding: etc/mail/statistics (deflated 93%) adding: etc/mail/trusted-users (deflated 25%) adding: etc/mail/virtusertable (stored 0%) adding: etc/mail/virtusertable.db (deflated 99%) The result of the above command is a file called mail.zip. 11 File Compression 2007 One Course Source Page 295

50 Creating zip directories If you need to create a zip file that contains a directory structure, use the -r option: [student@ocs1 tmp] zip -r maildir /etc/mail adding: etc/mail/ (stored 0%) adding: etc/mail/local-host-names (deflated 5%) adding: etc/mail/makefile (deflated 52%) adding: etc/mail/access (deflated 40%) adding: etc/mail/domaintable (stored 0%) adding: etc/mail/helpfile (deflated 55%) adding: etc/mail/trusted-users (deflated 25%) adding: etc/mail/mailertable (stored 0%) adding: etc/mail/sendmail.mc (deflated 54%) adding: etc/mail/statistics (deflated 93%) adding: etc/mail/virtusertable.db (deflated 99%) adding: etc/mail/virtusertable (stored 0%) adding: etc/mail/access.db (deflated 99%) adding: etc/mail/domaintable.db (deflated 99%) adding: etc/mail/mailertable.db (deflated 99%) 11 File Compression 2007 One Course Source Page 296

51 Other options when zipping files The following zip options may also be useful: Option Purpose -c Add a comment for each archived file -e Encrypt the zip file with a password (enter password when prompted) -g Grow (expand on) an existing zip file -j Don t Include path with filename -k Attempt to convert filenames to DOS compatible names -u Update (replace) files in an existing zip file -v Verbose mode 11 File Compression 2007 One Course Source Page 297

52 Listing table of contents To list the table of contents of an existing zip file with the unzip command, use the -l option: tmp] unzip -l mail.zip Archive: mail.zip Length Date Time Name :24 etc/mail/ :29 etc/mail/access :24 etc/mail/access.db :29 etc/mail/domaintable :24 etc/mail/domaintable.db :29 etc/mail/helpfile :29 etc/mail/local-host-names :29 etc/mail/mailertable :24 etc/mail/mailertable.db :29 etc/mail/makefile :29 etc/mail/sendmail.mc :08 etc/mail/statistics :29 etc/mail/trusted-users :29 etc/mail/virtusertable :24 etc/mail/virtusertable.db files 11 File Compression 2007 One Course Source Page 298

53 To see additional information, use the -v option: tmp] unzip -v mail.zip Archive: mail.zip Length Method Size Ratio Date Time CRC-32 Name Stored 0 0% : etc/mail/ 345 Defl:N % :29 812eb6d7 etc/mail/access Defl:N % : etc/mail/access.db 0 Stored 0 0% : etc/mail/domaintable Defl:N 94 99% : e389 etc/mail/domaintable.db 5573 Defl:N % :29 797aad3b etc/mail/helpfile 64 Defl:N 61 5% :29 a3682cdb etc/mail/local-host-names 0 Stored 0 0% : etc/mail/mailertable Defl:N 93 99% :24 641d48a7 etc/mail/mailertable.db 611 Defl:N % :29 b0a729ab etc/mail/makefile 2479 Defl:N % :29 6c6e650e etc/mail/sendmail.mc 628 Defl:N 45 93% :08 f0ee1d54 etc/mail/statistics 127 Defl:N 95 25% :29 c3455cc5 etc/mail/trusted-users 0 Stored 0 0% : etc/mail/virtusertable Defl:N 93 99% : e0cc etc/mail/virtusertable.db % 15 files 11 File Compression 2007 One Course Source Page 299

54 Extracting zip files Use the unzip command to extract files from a zip file: [student@ocs1 tmp] unzip mail.zip Archive: mail.zip replace etc/mail/access? [y]es, [n]o, [A]ll, [N]one, [r]ename: n replace etc/mail/access.db? [y]es, [n]o, [A]ll, [N]one, [r]ename: n Note: if you don t want to have to respond to replace? prompts, use the -o option. This option will automatically overwrite existing files. 11 File Compression 2007 One Course Source Page 300

55 11.4 Additional Compression Commands In addition to gzip and zip, the following compression commands are available on many Linux distributions: Command pack compress bzip2 Comment A very old command ported from UNIX. Files compressed with pack typically have an extension of ".z". Some modern compression commands, such as gzip, can uncompress "packed" files. A old command ported from UNIX. Files compressed with compress typically have an extension of ".Z". Some modern compression commands, such as gzip, can uncompress "compressed" files. A compression command that works very much like the gzip command. The bzip2 command uses a different compression algorithm than gzip does. 11 File Compression 2007 One Course Source Page 301

56 11.5 Additional Resources Books None Web sites - gzip manual - bzip2 HOWTO Man pages bzip2 compress file gunzip gzip pack tar unzip zip 11 File Compression 2007 One Course Source Page 302

57 11.6 Summary of Commands and Files Command bzip2 compress file gunzip gzip pack tar unzip zip Description Compresses files using a modern compression algorithm Compresses files using an older compression algorithm Provides the type of a file's contents Uncompresses files compressed with the gzip command Compresses files using a modern compression algorithm Compresses files using an old compression algorithm Merges multiple files into a single file Uncompresses files compressed with the zip command Compresses files using a modern compression algorithm 11 File Compression 2007 One Course Source Page 303

58 11.7 Certification Notes Review the following charts to determine what sections in this Unit are relevant for the exam that you are preparing for: Topic RHCT RHCE Linux+ LPI 1-1 LPI 1-2 LPI 2-1 LPI tar B B X X B B B 11.2 gzip B B X X B B B 11.3 zip B B X X B B B 11.4 Additional Compression Commands B B X X B B B B X N Key Background - May not be on exam itself, but contains information that aids in the understanding of other topics. exam - A topic that is "testable" for this exam Not on exam - Indicates that this topic isn't on the exam and isn't needed to understand other topics on the exam. 11 File Compression 2007 One Course Source Page 304

59 11.8 Lab Exercises 1. Copy the directory structure /etc/log.d into your home directory Command: 2. Using the tar command, merge all of the files in the log.d directory into one tar file. Command: 3. Copy the new tar file into the /tmp directory. Command: 4. Change to the /tmp directory and list the contents of the tar file. Command: 5. Untar the file Command: 6. Using the gzip command, gizp each file in the /tmp/log.d directory Command: 11 File Compression 2007 One Course Source Page 305

60 7. Unzip the gzip files in the /tmp/log.d directory Command: 8. Delete the log.d directory in your home directory Command: 9. Using the zip command, zip the /tmp/log.d directory Command: 10. Copy the zip file into your home directory Command: 11. Unzip the zip file into your home directory Command: For answers to these exercises see the "answers" directory in your class data files. For additional exercises, see the "exercises" directory in your class data files. 11 File Compression 2007 One Course Source Page 306

61 Unit Eighteen The Boot Process Unit topics: Page The Boot Sequence Run Levels The init Phase Changing to Different Run Levels Modifying Run Levels Additional Resources Summary of Commands and Files Certification Notes Lab Exercises The Boot Process 2007 One Course Source Page 518

62 18.1 The Boot Sequence There are four major stages to the Linux boot process: #1. BIOS initialization stage #2. Boot loader stage #3. Kernel initialization stage #4. The init stage As an administrator, most of the work that you will do on the boot process will take place in the init stage. However, for troubleshooting purposes, administrators should be aware of what steps take place in the other stages. The BIOS initialization stage The BIOS (Basic Input/Output System) is a part of the system itself (not Linux). This small program acts as an translator between the Linux OS and hardware. The BIOS also keeps track of what hardware is attached to the system. During the boot process, it performs the following operations: POST (Power On Self Test) Probes for peripherals Determines boot device (floppy, cdrom, hard drive, etc.) Starts boot loader from boot device 18 The Boot Process 2007 One Course Source Page 519

63 The Boot loader stage The boot loader (GRUB or LILO) will allow the user to choose what OS to boot. After the choice has been made, the boot loader will start loading the kernel. The Kernel initialization stage During the kernel initialization stage, the kernel performs the following functions: Probes for devices Loads device drivers Mounts the / filesystem as read-only to access files Loads the init process The init process loads all other processes. 18 The Boot Process 2007 One Course Source Page 520

64 18.2 Run Levels In order to understand the init stage, we first need to understand run levels. Consider run levels to be like different functional states of the system. The following chart describes run levels found on most distributions: Run Level State of system 0 Halt the system 1 Single user mode: only the system administrator can log in and must use the console. Many daemons are not running and some file systems may not be mounted 2 Multi-user, no shared resources: The system is at a fully functional state with the exception that it can not be an NFS server 3 Multi-user, shared resources allowed: The system is at a fully functional state and it can be a NFS server 4 Not defined: this run level can be created by the system administrator to make a custom run level 5 X11 (run level 3 + graphics) 6 Will reboot the machine The exact definition of the run levels on your distribution may vary from the run levels described above. You can also create new run levels. Levels 7, 8 and 9 are available for you to use as you wish. 18 The Boot Process 2007 One Course Source Page 521

65 18.3 The init Phase The init daemon handles how the system moves from one run level to another. In order to determine how to perform this function, the init daemon reads the /etc/inittab file. The /etc/inittab file /root]# more /etc/inittab # inittab This file describes how the INIT process should set up # the system in a certain run-level. # # Author: Miquel van Smoorenburg, <miquels@drinkel.nl.mugnet.org> # Default runlevel. The runlevels used by RHS are: # 0 - halt (Do NOT set initdefault to this) # 1 - Single user mode # 2 - Multiuser, without NFS (The same as 3, if you do not have networking) # 3 - Full multiuser mode # 4 - unused # 5 - X11 # 6 - reboot (Do NOT set initdefault to this) id:5:initdefault: # System initialization. si::sysinit:/etc/rc.d/rc.sysinit 18 The Boot Process 2007 One Course Source Page 522

66 l0:0:wait:/etc/rc.d/rc 0 l1:1:wait:/etc/rc.d/rc 1 l2:2:wait:/etc/rc.d/rc 2 l3:3:wait:/etc/rc.d/rc 3 l4:4:wait:/etc/rc.d/rc 4 l5:5:wait:/etc/rc.d/rc 5 l6:6:wait:/etc/rc.d/rc 6 # Trap CTRL-ALT-DELETE ca::ctrlaltdel:/sbin/shutdown -t3 -r now # When our UPS tells us power has failed, assume we have a few minutes of power left. Schedule a # shutdown for 2 minutes from now. This does, of course, assume you have power installed and your # UPS connected and working correctly. pf::powerfail:/sbin/shutdown -f -h +2 "Power Failure; System Shutting Down" # If power was restored before the shutdown kicked in, cancel it. pr:12345:powerokwait:/sbin/shutdown -c "Power Restored; Shutdown Cancelled" # Run gettys in standard runlevels 1:2345:respawn:/sbin/mingetty tty1 2:2345:respawn:/sbin/mingetty tty2 3:2345:respawn:/sbin/mingetty tty3 4:2345:respawn:/sbin/mingetty tty4 5:2345:respawn:/sbin/mingetty tty5 6:2345:respawn:/sbin/mingetty tty6 # Run xdm in runlevel 5 x:5:respawn:/etc/x11/prefdm -nodaemom 18 The Boot Process 2007 One Course Source Page 523

67 Each line in this file defines an action for the init daemon to take. Each line has four fields: id:rstate:keyword:process_to_run Field Purpose id A field used only by administrators to identify the line. Can be between 1-4 characters long. rstate States what run level to run the process. keyword States how to run the process (see on next page). process_to_run The process to run. 18 The Boot Process 2007 One Course Source Page 524

68 The keyword field tells the system how to run the process. Here are the most typical keywords: Keyword ctrlaltdel initdefault powerfail powerokwait respawn sysinit wait Meaning Tells the system what actions to take if a user performs a Control-Alt-Delete. The run level to take the system to by default. This keyword should only appear once in the file. If this line is removed, the system will prompt the administrator to specify a run level during boot. Run the process only if the system receives a powerfail signal. If the power is restored prior to powerfail's command being fully executed, then this entry is executed. Start the process and, if it dies out, restart it. Run this process when the system boots up regardless of the run level the system goes to. A "sysinit" process is executed prior to any "respawn" or "wait" process. Start the process and wait until it is complete before continuing to the next line in the /etc/inittab file. 18 The Boot Process 2007 One Course Source Page 525

69 How init reads the inittab The init daemon makes four passes through the inittab: 1. It first looks at the default run level (is:5:initdefault:) to determine what run level to take the system. 2. It next looks for "sysinit" in the keyword field and runs those processes. 3. Lastly, it looks at all lines that have the same run level as the "initdefault" line and starts those processes. Example: Default boot Based on the previous /etc/inittab file, here are the actions that the init process would take: #1. Set default run level to 5 #2. Run the /etc/rc.d/rc.sysinit command #3. Run the /etc/rc.d/rc 5 command #4. Run the /sbin/mingetty ttyx (tt1, tty2, etc.) commands #5. Run the /etc/x11/prefdm -nodaemon command 18 The Boot Process 2007 One Course Source Page 526

70 The /etc/rc.d/rc.sysinit script The rc.sysinit command is only during the boot process. It is executed prior to any additional scripts and performs the following actions: #1. Sets some environment variables for the system including those found in the /etc/sysconfig/network file (basic networking data). #2. Sources (reads into system) the /etc/rc.d/init.d/functions file which contains useful shell functions. These functions are primarily used by the other scripts in the /etc/init.d directory (see later in this Unit for more details about these scripts). #3. Displays the welcome banner and informs the user of interactive startup. #4. Starts up boot logging (boot log can be read at a later time with the dmesg command). #5. Mounts the /proc filesystem which is used as an interface to kernel data structures. #6. Configures kernel parameters. #7. Sets system clock. #8. Loads keyboard mappings. #9. Sets the default system font. 18 The Boot Process 2007 One Course Source Page 527

71 #10. Actives swap partitions based on /etc/fstab file. #11. Sets the system's host name and NIS domain. #12. Probes the root filesystem for errors. If errors occur it will prompt the user to fix the errors. #13. Sets up plug-and-play devices #14. Mounts root filesystem and checks user's disk quotes for root filesystem. #15. Loads sound module (if configured) #16. Loads RAID devices (if specified in /etc/raidtab) #17. After checking for errors, mounts and checks disk quotas for non-root filesystems. #18. Initializes serial ports. #19. Copies boot messages to /var/log/dmesg for future reading. Note: Not every step was outlined above! Some steps were omitted and vary from one distribution to another. 18 The Boot Process 2007 One Course Source Page 528

72 The /sbin/mingetty ttyx commands The /sbin/mingetty command creates virtual consoles. These commands are executed with the "respawn" option so that they will be restarted if a user closed (stops) them (typically the result of logging off). Note: These are the virtual consoles that you access via Ctrl-Alt-FX (Where X represents the number of the terminal that you wish to switch to). The /etc/x11/prefdm -nodaemon command This script will set the system's preferred login manager (Gnome, KDE, etc.). Further details regarding the functionality of this script is deferred to another class. 18 The Boot Process 2007 One Course Source Page 529

73 Run control scripts The heart of what makes up a run level is the run control script (/etc/rc.d/rc). The primary functions of this script are: Run all files in /etc/rc.d/rcx.d that start with a "K" with a "stop" option Run all files in /etc/rc.d/rcx.d that start with a "S" with a "start" option In "/etc/rc.d/rcx.d" the X stands for the run level number that the system is "going to". [root@ocs1 /root]# cat /etc/rc.d/rc #!/bin/bash # # rc This file is responsible for starting/stopping # services when the runlevel changes. It is also # responsible for the very first setup of basic # things, such as setting the hostname. # # First, run the KILL scripts. for i in /etc/rc.d/rc$runlevel.d/k*; do {output omitted} # Now run the START scripts. for i in /etc/rc.d/rc$runlevel.d/s*; do {output omitted} 18 The Boot Process 2007 One Course Source Page 530

74 Run Level directories The "S" and "K" scripts typically either start (or stop) a daemon or perform some sort of system task. Example: A typical /etc/rc.d/rc2.d directory [root@ocs1 /root]# ls /etc/rc.d/rc2.d K05innd K20rusersd K45named K80nscd S30syslog S85gpm K08autofs K20rwalld K50inet K85netfs S40crond S90xfs K15httpd K20rwhod K50snmpd K88ypserv S45pcmcia S99linuxconf K15sound K25squid K55routed K89portmap S60lpd S99local K20bootparamd K28amd K60atd S05apmd S65dhcpd K20nfs K30mcserv K60mars-new S10network S75keytable K20rstatd K34yppasswdd K75gated S20random S80sendmail The order of execution of these scripts is dependant on the script names. All "K" scripts are executed first in order depending on the number that appears after the "K". All "S" scripts are executed after all "K" scripts. They are also executed in order depending on the number that follows the "S". If two scripts have the same number after the "K" or "S" (such as "K60atd" and "K60mars-new" in the output above), the fourth character in the file names are compared. Since "a" comes before "m" in the ASCII text table, the "K60atd" script will be executed before the "K60mars-new" script. Typically, the order that you see when you run ls on the directory is the order in which the commands will be executed. 18 The Boot Process 2007 One Course Source Page 531

75 Note: almost all of the files in the aforementioned directories are links to files in the /etc/rc.d/init.d directory: root]# ls -l /etc/rc.d/rc2.d/s10network lrwxr-xr-x 1 root root 11 Aug 21 22:05 /etc/rc.d/rc3.d/s99local ->../init.d/network There are two reasons why most of the /etc/rc.d/rcx.d files are links to files in the /etc/rc.d/init.d directory: #1 One purpose behind having all of the files in this directory is so you can access them without having to remember which run level they exist in. You can run these scripts manually to stop daemons: [root@ocs1 root]# /etc/rc.d/init.d/nfs stop Shutting down NFS mountd: [OK] Shutting down NFS daemon: [OK] Shutting down NFS services: [OK] Shutting down NFS quotas: [OK] Or to start daemons: [root@ocs1 root]# /etc/rc.d/init.d/nfs start Starting NFS services: [OK] Starting NFS quotas: [OK] Starting NFS mountd: [OK] Starting NFS daemon: [OK] 18 The Boot Process 2007 One Course Source Page 532

76 Some of these scripts will allow you to stop and restart them with one command: root]# /etc/rc.d/init.d/nfs restart Restarting NFS services: rpc.mountd [OK] Sometimes you just need a daemon to reread its initialization script. To do this, use the following syntax: [root@ocs1 root]# /etc/rc.d/init.d/nfs reload {no output} The script may also allow you to get the status of the daemon that is associated with the script: [root@ocs1 root]# /etc/rc.d/init.d/nfs status rpc.mountd (pid 24540) is running... nfsd (pid ) is running... rpc.rquotad (pid 24492) is running... None: Some Linux distributions also provide a shell script called "service". This script is a front end to the /etc/rc.d/init.d scripts. Example syntax: service nfs stop 18 The Boot Process 2007 One Course Source Page 533

77 #2. The second reason for the linking of the files is that it makes it easier to maintain the files. Suppose you want to modify the script that starts the network? If the files in the /etc/rc.d/rcx.d directory were all copies of each other, then you would need to modify each of the following files: /etc/rc.d/rc0.d/k90network /etc/rc.d/rc1.d/k90network /etc/rc.d/rc2.d/s10network /etc/rc.d/rc3.d/s10network /etc/rc.d/rc4.d/s10network /etc/rc.d/rc5.d/s10network /etc/rc.d/rc6.d/k90network By having all of these files linked (or pointing to) the /etc/rc.d/init.d/network file, you can modify "all" of them by just modifying the /etc/rc.d/init.d/network file. 18 The Boot Process 2007 One Course Source Page 534

78 The following chart gives a brief explanation of what most of the scripts in the /etc/rc.d/init.d directory does: Script amd anacron apmd arpwatch atd autofs bootparamd crond dhcpd functions gated grm halt httpd inet innd ipchains iptables keytable kudzu Function Starts daemon (automountd) that handles automounting Runs cron jobs that didn't run because the system was down Starts daemon (apmd) that monitors battery status Starts daemon (arpwatch) that keeps track of ethernet address pairings Starts daemon (atd) that runs at jobs Uses "Sun style" master maps for automount daemon Allows Sun workstations to perform a network boot Starts daemon (crond) that handles cron jobs Starts daemon (dhcp) that handles DHCP Contains functions used by other /etc/init.d scripts Starts daemon (gated) that handles routing Starts daemon (gpm) that allows mouse use in text programs Used to halt the system Starts the Apache Web Server daemon (httpd) Starts daemon (identd) that handles TCP ports Starts daemon (innd) that handles Usenet servers Used to create a packet filtering firewall Used to create a packet filtering firewall Used to load keyboard mapping Used to probe for new hardware 18 The Boot Process 2007 One Course Source Page 535

79 Script ldap lpd mars-new mcserv named netfs network nfs & nfslock nscd pcmcia portmap routed rusersd rwalld rwhod sendmail single smb snmpd Function Starts daemon (sldap) that handles LDAP (Lightweight Directory Access Protocol) Starts daemon (lpd) that handles printing on system Starts daemons that allow NetWare compatible file and printer server services Starts daemon (mcserv) that starts Midnight Commander server Starts daemon (named) that handles DNS Starts daemon (netfs) that handles NFS client actions Used to bring the network up Starts daemons that handle NFS server actions Starts daemon (nscd) that handles naming services such as NIS, NIS+, LDAP, etc. Starts daemon (cardmgr) that handles PCMCIA devices Starts daemon (portmap) that handles RPC connections Starts daemon (routed) that handles routing Allows remote rusers command Allows remote rwall command Allows remote rwho command Starts daemon (sendmail) that handles mail on the system Defines single user mode Starts daemon (smbd) that handles Samba Starts daemon (snmpd) that handles Simple Network Management Protocol 18 The Boot Process 2007 One Course Source Page 536

80 Script sshd syslog xfs xinetd Function Starts daemon (sshd) that handles ssh server Starts daemons that handle system logs Starts X Font Server Starts daemon (xinetd), a replacement for inetd Note: Scripts in the /etc/rc.d/init.d directory will vary depending on installation options taken as well as the distribution of Linux you have installed. In most cases, you should be able to look at the file to see what it does (most of them have comments that describe what they do). If the comments don't explain the script's function well enough, look at the man or info pages of the commands that are executed. These scripts highlight how important it is for a System Administer to know how to read BASH scripts (a topic taught in a later class). 18 The Boot Process 2007 One Course Source Page 537

81 The /etc/xinetd directory The xinetd daemon provides services that are referred to as "Internet services". These services may include ftp, telnet and some network printer access. When a client machine attempts to connect to a xinetd-based service, the xinetd daemon starts the service based on configuration information found in the /etc/xinetd directory. In most cases you will not need to edit these files directly. One setting that you may consider changing is the "disable" setting. Setting "disable" to yes turns the service off. Setting "disable" to no turns the service off. You can also turn these services on an off via commands that we will see in a later section of this manual. Further details regarding settings in these files will be covered in a later class. [root@ocs1 root]# more /etc/xinetd.d/telnet # description: The telnet server serves telnet sessions; it uses # unencrypted username/password pairs for authentication. service telnet { disable = no flags = REUSE socket_type = stream wait = no user = root server = /usr/sbin/in.telnetd log_on_failure += USERID } 18 The Boot Process 2007 One Course Source Page 538

82 The /etc/rc.d/rc.local script One of the last scripts executed in each of the /etc/rc.d/rcx.d directories is the S99local script. This script is linked to the /etc/rc.d/rc.local script. The purpose behind the rc.local script is to provide an easy to edit file where the System Administrator can place commands that need to be executed whenever the system goes from one run level to another (including booting the machine). Note: By giving it a name that starts with "S99", it typically will be the last script executed, however a script that starts with S99 and its fourth character has a higher ACSII value than "l", then the S99local script may not be the last script executed. 18 The Boot Process 2007 One Course Source Page 539

83 18.4 Changing to Different Run Levels There are two methods of changing to different run levels. One method is to use the traditional Linux commands (halt, reboot, poweroff, shutdown). The other method is to use the init command (init 0, init 1, etc.). On most distributions, the halt, reboot and poweroff commands really just call the shutdown command. The shutdown command ends up calling the init (see section on shutdown a in a few pages). The init command used the /etc/inittab file to determine what actions to take to bring the system to another run level. It follows the same rules at the init daemon does during the boot process. Note: On older versions of Linux, the halt, poweroff, reboot and shutdown command do not end up calling the init process and should never be used if you modify how run levels are defined (see future section in this Unit for modifying run levels). 18 The Boot Process 2007 One Course Source Page 540

84 The telinit command Instead of using the init command, you might want to consider using telinit instead (especially if you are going to run levels 0 or 6). The telinit command works just like the init command except with telinit you can use the -t option specify a "time delay" before the run level change. For example, the following command will reboot the system after a 120 second time delay: [root@ocs1 root]# telinit -t The shutdown command There are a few advantages of using the shutdown command: #1. It notifies all of the users on the system that the system is being shut down. #2. You can delay the shutdown by using the -t option. #3. During the delay, all login attempts are blocked. When the -a option is used with the shutdown command, the /etc/shutdown.allow file is consulted. If the username of the user running the shutdown command is in the shutdown.allow file (or if the user is root), the shutdown command will proceed to bring the system down. 18 The Boot Process 2007 One Course Source Page 541

85 Choosing a run level at boot If your boot loader is LILO When the boot prompt appears, type "linux single". This will take you to single user mode and automatically log you in as root (This is similar to run level 1). To choose a different run level, type "linux x" where "x" is the numeric value of the run level you want to go to. If your boot loader is GRUB When the menu screen appears, select "Red Hat Linux" from the menu. Then follow the steps: #1. Press the "e" key to enter the edit mode. #2. Move the selection to the line that contains "kernel" by using your arrow keys. #3. Press the "e" key to edit this line. #4. Add "single" at the end of the line (or the numeric value of the run level that you want to go to). #5. Press the <ENTER> key to finish editing the line #6. Press the "b" key to boot the system. The system will be booted to single user mode and automatically log you in as root. 18 The Boot Process 2007 One Course Source Page 542

86 Displaying your current run level To display your current (and previous) run level, use the runlevel command: root]# runlevel N 5 The first character indicates the previous run level (N=None, system boot) and the second character indicates the current run level. 18 The Boot Process 2007 One Course Source Page 543

87 18.5 Modifying Run Levels There are many methods that you can use to modify run levels: #1. Modify them manually #2. Using the chkconfig command #3. Using the ntsysv command #4. Using Gnome's "Service Configuration" program. Modify run levels manually The idea behind modifying a run level manually is to link (not copy) files from the /etc/rc.d/init.d directory into the appropriate /etc/rcx.d directory. For example, the following command will set up NFS server services for run level 5: [root@ocs1 root]# ln -s /etc/rc.d/init.d/nfs /etc/rc5.d/s60nfs {no output} While this method seems fine, there is a concern that you want to be aware of. You can't just name the script whatever you want. Some daemons must be started before other daemons can be started. In most cases the other methods that we will cover in the following pages are better for modifying run levels. However, if you want to add something new to the system, using this manual method is sometimes the only method you can use. 18 The Boot Process 2007 One Course Source Page 544

88 Using the chkconfig command The chkconfig command will list active services as well as allow you to specify which services to activate when entering a run level. To list active services: [root@ocs1 root]# chkconfig --list keytable 0:off 1:on 2:on 3:on 4:on 5:on 6:off atd 0:off 1:off 2:off 3:on 4:on 5:on 6:off kdcrotate 0:off 1:off 2:off 3:off 4:off 5:off 6:off syslog 0:off 1:off 2:on 3:on 4:on 5:on 6:off gpm 0:off 1:off 2:on 3:on 4:on 5:on 6:off {output omitted} To specify a service be started automatically when entering a run level: [root@ocs1 root]# chkconfig --level 345 autofs on {no output} To "turn off" a service for a run level, run the following command: [root@ocs1 root]# chkconfig --level 345 autofs off {no output} How does chkconfig know how to name the files? See the next page The Boot Process 2007 One Course Source Page 545

89 Another technique you can use is the --add and --del options. These options (as well as the on and off arguments described on the previous page) look at the script for a line that looks like this: # chkconfig: The "345" says "configure this service for run levels 3, 4 and 5. The "28" is the "start priority". This means that the name of the file will be S28xxxxx. The "72" is the "stop priority" (K72xx). The --add command will create start scripts and the --del command will create the kill scripts. To have chkconfig perform both features, use the following syntax: [root@ocs1 root]# chkconfig --level 345 autofs reset {no output} 18 The Boot Process 2007 One Course Source Page 546

90 Using the ntsysv command The ntsysv command allows you to make simple changes to a run level. It's a command-line, menu-driven program that lists services: By default, the current level is modified. Use the --level option to modify other run levels. 18 The Boot Process 2007 One Course Source Page 547

91 Using Gnome's "Service Configuration" program Gnome's Service Configuration program provides a GUI-based method of modifying run levels: [root@ocs1 root]# serviceconf Important notes: #1. Don't forget to save changes before exiting out of Service Configuration. #2. Changes occur immediately for xinetd services. 18 The Boot Process 2007 One Course Source Page 548

client X11 Linux workstation

client X11 Linux workstation LPIC1 LPIC Linux: System Administrator LPIC 1 LPI command line LPIC-1 Linux LPIC-1 client X11 Linux workstation Unix GNU Linux Fundamentals Unix and its Design Principles FSF and GNU GPL - General Public

More information

Prerequisites: General computing knowledge and experience. No prior knowledge with Linux is required. Supported Distributions:

Prerequisites: General computing knowledge and experience. No prior knowledge with Linux is required. Supported Distributions: This course prepares students to take the 101 exam of the LPI level 1 certification. The Linux Professional Institute (LPI) is the go to certification body for vendor independent Linux certifications.

More information

Linux+ Guide to Linux Certification, Third Edition. Chapter 2 Linux Installation and Usage

Linux+ Guide to Linux Certification, Third Edition. Chapter 2 Linux Installation and Usage Linux+ Guide to Linux Certification, Third Edition Chapter 2 Linux Installation and Usage Objectives Install Red Hat Fedora Linux using good practices Outline the structure of the Linux interface Enter

More information

NETW 110 Lab 3 Post-Installation Configuration Page 1

NETW 110 Lab 3 Post-Installation Configuration Page 1 NETW 110 Lab 3 Post-Installation Configuration Page 1 Objective At the conclusion of this lab, the student will learn some very basic functions of vi, use vi to perform some post-installation configuration

More information

Instructions: Step 1: Respond to the following: IT131 Linux+

Instructions: Step 1: Respond to the following: IT131 Linux+ IT131 Linux+ Course Objectives Upon completion of this course, the student will be able to: 1. Create a new installation of Fedora/RHEL; 2. Use utilities to manage the Fedora/RHEL system; 3. Describe how

More information

System Administration. Startup Process

System Administration. Startup Process System Administration Startup Process Why Care? Every process on your system comes about by following a specific chain of events from the machine startup You may want to disable processes You may want

More information

This is Lab Worksheet 13 - not an Assignment. Boot Process and GRUB

This is Lab Worksheet 13 - not an Assignment. Boot Process and GRUB This is Lab Worksheet 13 - not an Assignment This Lab Worksheet contains some practical examples that will prepare you to complete your Assignments. You do not have to hand in this Lab Worksheet. Make

More information

Overview LEARN. History of Linux Linux Architecture Linux File System Linux Access Linux Commands File Permission Editors Conclusion and Questions

Overview LEARN. History of Linux Linux Architecture Linux File System Linux Access Linux Commands File Permission Editors Conclusion and Questions Lanka Education and Research Network Linux Architecture, Linux File System, Linux Basic Commands 28 th November 2016 Dilum Samarasinhe () Overview History of Linux Linux Architecture Linux File System

More information

JPdfBookmarks Manual. by Flaviano Petrocchi

JPdfBookmarks Manual. by Flaviano Petrocchi JPdfBookmarks Manual by Flaviano Petrocchi JPdfBookmarks Manual 1 Introduction 3 Installation and Uninstallation 4 Linux Instructions 4 Debian Instructions 6 Windows Instructions 6 Universal Archive Instructions

More information

Certification. System Initialization and Services

Certification. System Initialization and Services Certification System Initialization and Services UNIT 3 System Initialization and Services UNIT 3: Objectives Upon completion of this unit the student should be able to: Describe BIOS functions with respect

More information

CST8207: GNU/Linux Operating Systems I Lab Ten Boot Process and GRUB. Boot Process and GRUB

CST8207: GNU/Linux Operating Systems I Lab Ten Boot Process and GRUB. Boot Process and GRUB Student Name: Lab Section: Boot Process and GRUB 1 Due Date - Upload to Blackboard by 8:30am Monday April 16, 2012 Submit the completed lab to Blackboard following the Rules for submitting Online Labs

More information

Linux Essentials Objectives Topics:

Linux Essentials Objectives Topics: Linux Essentials Linux Essentials is a professional development certificate program that covers basic knowledge for those working and studying Open Source and various distributions of Linux. Exam Objectives

More information

Runlevels, System Shutdown and Reboot

Runlevels, System Shutdown and Reboot Information These notes were originally written in the year 2000 as part of a set of LPI Exam 101 training materials. The LPI training course at Bromley College was subsequently discontinued and some of

More information

grub-md5-crypt --help Usage: grub-md5-crypt [OPTION] Encrypt a password in MD5 format.

grub-md5-crypt --help Usage: grub-md5-crypt [OPTION] Encrypt a password in MD5 format. (OS Hardening). Minimal.1. grub.2..3. DVD Update.4. root ssh.5 kernel grub kernel.6. comment vi /etc/grub.conf # grub.conf generated by anaconda # # Note that you do not have to rerun grub after making

More information

IBM Remote Support Manger for Storage

IBM Remote Support Manger for Storage IBM Remote Support Manger for Storage Installation Hints and Tips Version 4.273, December 1, 2011 This document is updated frequently. If viewing a hardcopy version of this document, please visit the RSM

More information

Linux Essentials. Smith, Roderick W. Table of Contents ISBN-13: Introduction xvii. Chapter 1 Selecting an Operating System 1

Linux Essentials. Smith, Roderick W. Table of Contents ISBN-13: Introduction xvii. Chapter 1 Selecting an Operating System 1 Linux Essentials Smith, Roderick W. ISBN-13: 9781118106792 Table of Contents Introduction xvii Chapter 1 Selecting an Operating System 1 What Is an OS? 1 What Is a Kernel? 1 What Else Identifies an OS?

More information

Please choose the best answer. More than one answer might be true, but choose the one that is best.

Please choose the best answer. More than one answer might be true, but choose the one that is best. Introduction to Linux and Unix - endterm Please choose the best answer. More than one answer might be true, but choose the one that is best. SYSTEM STARTUP 1. A hard disk master boot record is located:

More information

SysadminSG RHCSA Study Guide

SysadminSG RHCSA Study Guide SysadminSG RHCSA Study Guide This is the RHCSA Study Guide for the System Administration Study Group. The study guide is intended to be printed by those who wish to study common tasks performed by many

More information

Q) Q) What is Linux and why is it so popular? Answer - Linux is an operating system that uses UNIX like Operating system...

Q) Q) What is Linux and why is it so popular? Answer - Linux is an operating system that uses UNIX like Operating system... Q) Q) What is Linux and why is it so popular? Answer - Linux is an operating system that uses UNIX like Operating system... Q) Q) What is the difference between home directory and working directory? Answer

More information

Introduction to Linux Organizing Files

Introduction to Linux Organizing Files Introduction to Linux Organizing Files Computational Science and Engineering North Carolina A&T State University Instructor: Dr. K. M. Flurchick Email: kmflurch@ncat.edu Arranging, Organizing, Packing

More information

CS Fundamentals of Programming II Fall Very Basic UNIX

CS Fundamentals of Programming II Fall Very Basic UNIX CS 215 - Fundamentals of Programming II Fall 2012 - Very Basic UNIX This handout very briefly describes how to use Unix and how to use the Linux server and client machines in the CS (Project) Lab (KC-265)

More information

CompTIA Linux+ Guide to Linux Certification Fourth Edition. Chapter 2 Linux Installation and Usage

CompTIA Linux+ Guide to Linux Certification Fourth Edition. Chapter 2 Linux Installation and Usage CompTIA Linux+ Guide to Linux Certification Fourth Edition Chapter 2 Linux Installation and Usage Objectives Prepare for and install Fedora Linux using good practices Outline the structure of the Linux

More information

22-Sep CSCI 2132 Software Development Lecture 8: Shells, Processes, and Job Control. Faculty of Computer Science, Dalhousie University

22-Sep CSCI 2132 Software Development Lecture 8: Shells, Processes, and Job Control. Faculty of Computer Science, Dalhousie University Lecture 8 p.1 Faculty of Computer Science, Dalhousie University CSCI 2132 Software Development Lecture 8: Shells, Processes, and Job Control 22-Sep-2017 Location: Goldberg CS 127 Time: 14:35 15:25 Instructor:

More information

Perl and R Scripting for Biologists

Perl and R Scripting for Biologists Perl and R Scripting for Biologists Lukas Mueller PLBR 4092 Course overview Linux basics (today) Linux advanced (Aure, next week) Why Linux? Free open source operating system based on UNIX specifications

More information

Prerequisites: Students should be comfortable with computers. No familiarity with Linux or other Unix operating systems is required.

Prerequisites: Students should be comfortable with computers. No familiarity with Linux or other Unix operating systems is required. GL-120: Linux Fundamentals Course Length: 4 days Course Description: The GL120 is a challenging course that focuses on the fundamental tools and concepts of Linux and Unix. Students gain proficiency using

More information

RHCSA Rapid Track Course (RH199)

RHCSA Rapid Track Course (RH199) RHCSA Rapid Track Course (RH199) DESCRIPTION: Course overview On completion of course materials, students should be prepared to take the Red Hat Certified System Administrator (RHCSA) exam. Note: This

More information

The Linux IPL Procedure

The Linux IPL Procedure The Linux IPL Procedure SHARE - Tampa February 13, 2007 Session 9274 Edmund MacKenty Rocket Software, Inc. Purpose De-mystify the Linux boot sequence Explain what happens each step of the way Describe

More information

1Z Oracle Linux Fundamentals (Oracle Partner Network) Exam Summary Syllabus Questions

1Z Oracle Linux Fundamentals (Oracle Partner Network) Exam Summary Syllabus Questions 1Z0-409 Oracle Linux Fundamentals (Oracle Partner Network) Exam Summary Syllabus Questions Table of Contents Introduction to 1Z0-409 Exam on Oracle Linux Fundamentals (Oracle Partner Network)... 2 Oracle

More information

Chapter-3. Introduction to Unix: Fundamental Commands

Chapter-3. Introduction to Unix: Fundamental Commands Chapter-3 Introduction to Unix: Fundamental Commands What You Will Learn The fundamental commands of the Unix operating system. Everything told for Unix here is applicable to the Linux operating system

More information

Guide to Linux+, Fourth Edition Chapter 2 Solutions

Guide to Linux+, Fourth Edition Chapter 2 Solutions Guide to Linux+, Fourth Edition Chapter 2 Solutions Review Questions 1. What is the default shell in Linux called? a. SH b. BSH c. CSH d. BASH Answer: d 2. What equivalent to the man command generally

More information

How to Use This Lab Manual

How to Use This Lab Manual 3 Contents How to Use This Lab Manual........................................ 5 Lab 1: Setting Up the Student System.................................. 7 Lab 2: Installing Fedora............................................

More information

Please note that CNE 216 is a brand new course that has never been taught on the George campus; it will be taught for the first time in the fall of

Please note that CNE 216 is a brand new course that has never been taught on the George campus; it will be taught for the first time in the fall of Please note that CNE 216 is a brand new course that has never been taught on the George campus; it will be taught for the first time in the fall of 2015. The materials for this course are still being developed.

More information

Introduction to UNIX. Logging in. Basic System Architecture 10/7/10. most systems have graphical login on Linux machines

Introduction to UNIX. Logging in. Basic System Architecture 10/7/10. most systems have graphical login on Linux machines Introduction to UNIX Logging in Basic system architecture Getting help Intro to shell (tcsh) Basic UNIX File Maintenance Intro to emacs I/O Redirection Shell scripts Logging in most systems have graphical

More information

Some Ubuntu Practice...

Some Ubuntu Practice... Some Ubuntu Practice... SANOG 10 August 29 New Delhi, India 1. Get used to using sudo 2. Create an inst account 3. Learn how to install software 4. Install gcc and make 5. Learn how to control services

More information

Chapter 02 Linux Installation and Usage

Chapter 02 Linux Installation and Usage Chapter 02 Linux Installation and Usage TRUEFALSE 1. A swap partition contains a filesystem. 2. When a user interacts with his computer, he interacts directly with the kernel of the computer's operating

More information

INTRODUCTION TO LINUX

INTRODUCTION TO LINUX INTRODUCTION TO LINUX REALLY SHORT HISTORY Before GNU/Linux there were DOS, MAC and UNIX. All systems were proprietary. The GNU project started in the early 80s by Richard Stallman Goal to make a free

More information

HOW LINUX BOOTS. As it turns out, there isn t much to the boot process:

HOW LINUX BOOTS. As it turns out, there isn t much to the boot process: 3 HOW LINUX BOOTS You now know the physical structure of a Linux system, what the kernel is, and how to work with processes. This chapter teaches you how the system starts (boots) that is, how the kernel

More information

BIOINFORMATICS POST-DIPLOMA PROGRAM SUBJECT OUTLINE Subject Title: OPERATING SYSTEMS AND PROJECT MANAGEMENT Subject Code: BIF713 Subject Description:

BIOINFORMATICS POST-DIPLOMA PROGRAM SUBJECT OUTLINE Subject Title: OPERATING SYSTEMS AND PROJECT MANAGEMENT Subject Code: BIF713 Subject Description: BIOINFORMATICS POST-DIPLOMA PROGRAM SUBJECT OUTLINE Subject Title: OPERATING SYSTEMS AND PROJECT MANAGEMENT Subject Code: BIF713 Subject Description: This course provides Bioinformatics students with the

More information

CompTIA Linux Course Overview. Prerequisites/Audience. Course Outline. Exam Code: XK0-002 Course Length: 5 Days

CompTIA Linux Course Overview. Prerequisites/Audience. Course Outline. Exam Code: XK0-002 Course Length: 5 Days CompTIA Linux+ 2009 Exam Code: XK0-002 Course Length: 5 Days Course Overview This instructor-led course will prepare students for the 2009 CompTIA Linux+ certification exam. It provides a comprehensive

More information

Read the relevant material in Sobell! If you want to follow along with the examples that follow, and you do, open a Linux terminal.

Read the relevant material in Sobell! If you want to follow along with the examples that follow, and you do, open a Linux terminal. Warnings 1 First of all, these notes will cover only a small subset of the available commands and utilities, and will cover most of those in a shallow fashion. Read the relevant material in Sobell! If

More information

Linux Operating System

Linux Operating System Linux Operating System IT250 Unit 1 Chapters 1, 2, and 3 An Introduction to Linux Linux Operating Systems Wednesday, 9:00 am 1:20 pm Attendance is Mandatory! Each class may begin with a quiz from previous

More information

Linux Fundamentals (L-120)

Linux Fundamentals (L-120) Linux Fundamentals (L-120) Modality: Virtual Classroom Duration: 5 Days SUBSCRIPTION: Master, Master Plus About this course: This is a challenging course that focuses on the fundamental tools and concepts

More information

LINUX FUNDAMENTALS. Supported Distributions: Red Hat Enterprise Linux 6 SUSE Linux Enterprise 11 Ubuntu LTS. Recommended Class Length: 5 days

LINUX FUNDAMENTALS. Supported Distributions: Red Hat Enterprise Linux 6 SUSE Linux Enterprise 11 Ubuntu LTS. Recommended Class Length: 5 days LINUX FUNDAMENTALS The course is a challenging course that focuses on the fundamental tools and concepts of Linux and Unix. Students gain proficiency using the command line. Beginners develop a solid foundation

More information

LINUX FUNDAMENTALS (5 Day)

LINUX FUNDAMENTALS (5 Day) www.peaklearningllc.com LINUX FUNDAMENTALS (5 Day) Designed to provide the essential skills needed to be proficient at the Unix or Linux command line. This challenging course focuses on the fundamental

More information

Lecture # 2 Introduction to UNIX (Part 2)

Lecture # 2 Introduction to UNIX (Part 2) CS390 UNIX Programming Spring 2009 Page 1 Lecture # 2 Introduction to UNIX (Part 2) UNIX is case sensitive (lowercase, lowercase, lowercase) Logging in (Terminal Method) Two basic techniques: 1. Network

More information

Critical Analysis and last hour guide for RHCSA/RHCE Enterprise 7

Critical Analysis and last hour guide for RHCSA/RHCE Enterprise 7 Critical Analysis and last hour guide for RHCSA/RHCE Enterprise 7 Disclaimer: I haven t gone through RHCSA/RHCE EL 7. I am preparing for upgrade of my RHCE certificate from RHCE EL4 to RHCE EL7. I don

More information

OPERATING SYSTEMS LINUX

OPERATING SYSTEMS LINUX OPERATING SYSTEMS LINUX Božo Krstajić, PhD, University of Montenegro Podgorica bozok@cg.ac.yu Process management Linux operating systems work with processes. Basically a process consists of program code

More information

Veritas NetBackup Backup, Archive, and Restore Getting Started Guide. Release 8.1.2

Veritas NetBackup Backup, Archive, and Restore Getting Started Guide. Release 8.1.2 Veritas NetBackup Backup, Archive, and Restore Getting Started Guide Release 8.1.2 Veritas NetBackup Backup, Archive, and Restore Getting Started Guide Last updated: 2018-09-19 Legal Notice Copyright 2017

More information

The student will have the essential skills needed to be proficient at the Unix or Linux command line.

The student will have the essential skills needed to be proficient at the Unix or Linux command line. Table of Contents Introduction Audience At Course Completion Prerequisites Certified Professional Exams Student Materials Course Outline Introduction This challenging course focuses on the fundamental

More information

Introduction to Linux start-up. Hao-Ran Liu

Introduction to Linux start-up. Hao-Ran Liu Introduction to Linux start-up Hao-Ran Liu Boot process overview Hardware startup BIOS LILO or bootsect.s Linux kernel Mount root file system /sbin/init LILO is a versatile boot loader, but it is functional-equivalent

More information

Introduction: What is Unix?

Introduction: What is Unix? Introduction Introduction: What is Unix? An operating system Developed at AT&T Bell Labs in the 1960 s Command Line Interpreter GUIs (Window systems) are now available Introduction: Unix vs. Linux Unix

More information

CS 215 Fundamentals of Programming II Spring 2019 Very Basic UNIX

CS 215 Fundamentals of Programming II Spring 2019 Very Basic UNIX CS 215 Fundamentals of Programming II Spring 2019 Very Basic UNIX This handout very briefly describes how to use Unix and how to use the Linux server and client machines in the EECS labs that dual boot

More information

Introduction to Linux Workshop 1

Introduction to Linux Workshop 1 Introduction to Linux Workshop 1 The George Washington University SEAS Computing Facility Created by Jason Hurlburt, Hadi Mohammadi, Marco Suarez hurlburj@gwu.edu Logging In The lab computers will authenticate

More information

"Charting the Course... MOC B: Linux System Administration. Course Summary

Charting the Course... MOC B: Linux System Administration. Course Summary Description Course Summary This four-day instructor-led course is designed to provide students with the necessary skills and abilities to work as a professional Linux system administrator. The course covers

More information

IBM Remote Support Manger for Storage

IBM Remote Support Manger for Storage IBM Remote Support Manger for Storage Installation Hints and Tips Version 28, June 19, 2012 This document is updated frequently. If viewing a hardcopy version of this document, please visit the RSM for

More information

www highskills pt pt

www highskills pt pt Linux Basic Administration Objetivos Gerais Este curso é dirigido a todos os que pretendem tornar-se profissionais em Linux, e pretende dotar os participantes dos conhecimentos técnicos e experiência nas

More information

Installing AudioLinux (Alternative way with GUI)

Installing AudioLinux (Alternative way with GUI) Installing AudioLinux (Alternative way with GUI) By Maarten van Druten Version 1.0 6 September 2017 Disclaimer: THIS SOFTWARE INSTALLATION MANUAL IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,

More information

UNIT V. Dr.T.Logeswari. Unix Shell Programming - Forouzan

UNIT V. Dr.T.Logeswari. Unix Shell Programming - Forouzan UNIT V UNIX SYSTEM COMMUNICATION Dr.T.Logeswari 1 Electronic mail or email is easiest way of communication on unix. Fast and cheap Used to exchange graphics, sound and video files 2 3 Elements of a communication

More information

Computer Architecture Lab 1 (Starting with Linux)

Computer Architecture Lab 1 (Starting with Linux) Computer Architecture Lab 1 (Starting with Linux) Linux is a computer operating system. An operating system consists of the software that manages your computer and lets you run applications on it. The

More information

*nix Crash Course. Presented by: Virginia Tech Linux / Unix Users Group VTLUUG

*nix Crash Course. Presented by: Virginia Tech Linux / Unix Users Group VTLUUG *nix Crash Course Presented by: Virginia Tech Linux / Unix Users Group VTLUUG Ubuntu LiveCD No information on your hard-drive will be modified. Gives you a working Linux system without having to install

More information

9.2 Linux Essentials Exam Objectives

9.2 Linux Essentials Exam Objectives 9.2 Linux Essentials Exam Objectives This chapter will cover the topics for the following Linux Essentials exam objectives: Topic 3: The Power of the Command Line (weight: 10) 3.3: Turning Commands into

More information

Redhat Basic. Need. Your. What. Operation G U I D E. Technical Hand Note template version

Redhat Basic. Need. Your. What. Operation G U I D E. Technical Hand Note template version Redhat Basic Operation G U I D E What Need Your www.next-asia.com Readhat Basic Operation Guide, Prepared by Nazmul Khan Page 1 of 43 Redhat Basic Operation Guide RedHat Installation Guide... 2 Installation...

More information

RH-202. RedHat. Redhat Certified Technician on Redhat Enterprise Linux 4 (Labs)

RH-202. RedHat. Redhat Certified Technician on Redhat Enterprise Linux 4 (Labs) RedHat RH-202 Redhat Certified Technician on Redhat Enterprise Linux 4 (Labs) Download Full Version : https://killexams.com/pass4sure/exam-detail/rh-202 QUESTION: 159 Install the dialog-* Questions asking

More information

RedHat. Rh202. Redhat Certified Technician on Redhat Enterprise Linux 4 (Labs)

RedHat. Rh202. Redhat Certified Technician on Redhat Enterprise Linux 4 (Labs) RedHat Rh202 Redhat Certified Technician on Redhat Enterprise Linux 4 (Labs) http://killexams.com/exam-detail/rh202 QUESTION: 156 Who ever creates the files/directories on /data group owner should be automatically

More information

Exam Linux-Praxis - 1 ( From )

Exam Linux-Praxis - 1 ( From  ) Exam Linux-Praxis - 1 ( From http://www.linux-praxis.de ) (1)Which of the following commands results in mailing the content of the current directory to Bob? A. mail Bob < ls B. ls > mail Bob C. ls mail

More information

RHCE BOOT CAMP. The Boot Process. Wednesday, November 28, 12

RHCE BOOT CAMP. The Boot Process. Wednesday, November 28, 12 RHCE BOOT CAMP The Boot Process OVERVIEW The boot process gets a machine from the useless off state to the feature rich operating system we all know and love Requires cooperation between hardware and software

More information

At course completion. Overview. Audience profile. Course Outline. : 55187B: Linux System Administration. Course Outline :: 55187B::

At course completion. Overview. Audience profile. Course Outline. : 55187B: Linux System Administration. Course Outline :: 55187B:: Module Title Duration : 55187B: Linux System Administration : 4 days Overview This four-day instructor-led course is designed to provide students with the necessary skills and abilities to work as a professional

More information

Virtual Machine. Linux flavor : Debian. Everything (except slides) preinstalled for you. https://www.virtualbox.org/

Virtual Machine. Linux flavor : Debian. Everything (except slides) preinstalled for you. https://www.virtualbox.org/ Virtual Machine Anyone have problems installing it? VM: Virtual Box - allows you to run a different operating system within the current operating system of your machine. https://www.virtualbox.org/ Linux

More information

Using grub to Boot various Operating Systems

Using grub to Boot various Operating Systems Operating Systems and Systems Integration Using grub to Boot various Operating Systems Contents 1 Aim 2 2 What You Will Do 2 3 Background 2 3.1 Installing grub in MBR from a floppy, and from the OS........

More information

CS246 Spring14 Programming Paradigm Notes on Linux

CS246 Spring14 Programming Paradigm Notes on Linux 1 Unix History 1965: Researchers from Bell Labs and other organizations begin work on Multics, a state-of-the-art interactive, multi-user operating system. 1969: Bell Labs researchers, losing hope for

More information

Exam LFCS/Course 55187B Linux System Administration

Exam LFCS/Course 55187B Linux System Administration Exam LFCS/Course 55187B Linux System Administration About this course This four-day instructor-led course is designed to provide students with the necessary skills and abilities to work as a professional

More information

Lab 3a Using the vi editor

Lab 3a Using the vi editor Lab 3a Using the vi editor Objectives: Become familiar with the vi Editor Review the three vi Modes Review keystrokes to move between vi modes Create a new file with vi Editor Invoke vi with show mode

More information

Red Hat Linux 8 Unleashed. Copyright 2003 by Sams Publishing. International Standard Book Number: X. Warning and Disclaimer

Red Hat Linux 8 Unleashed. Copyright 2003 by Sams Publishing. International Standard Book Number: X. Warning and Disclaimer Red Hat Linux 8 Unleashed Copyright 2003 by Sams Publishing International Standard Book Number: 067232458X Warning and Disclaimer Every effort has been made to make this book as complete and as accurate

More information

Introduction To Linux. Rob Thomas - ACRC

Introduction To Linux. Rob Thomas - ACRC Introduction To Linux Rob Thomas - ACRC What Is Linux A free Operating System based on UNIX (TM) An operating system originating at Bell Labs. circa 1969 in the USA More of this later... Why Linux? Free

More information

Learning Linux! Labs and more labs!

Learning Linux! Labs and more labs! Developing Technology Professionals www.netdevgroup.com Thank you. Learning Linux! Labs and more labs! Speaker name: Richard Weeks Title : President Date : 7/26/16 Who is NDG? www.netdevgroup.com Focus:

More information

VISUAL QUICKPRO GUIDE

VISUAL QUICKPRO GUIDE VISUAL QUICKPRO GUIDE Red Hat Linux 6 Harold Davis Peachpit Press Visual QuickPro Guide Red Hat Linux 6 Harold Davis Peachpit Press 1249 Eighth Street Berkeley, CA 94710 510/524-2178 800/283-9444 510/524-2221

More information

UNIT 9 Introduction to Linux and Ubuntu

UNIT 9 Introduction to Linux and Ubuntu AIR FORCE ASSOCIATION S CYBERPATRIOT NATIONAL YOUTH CYBER EDUCATION PROGRAM UNIT 9 Introduction to Linux and Ubuntu Learning Objectives Participants will understand the basics of Linux, including the nature,

More information

Linux Operating System Environment Computadors Grau en Ciència i Enginyeria de Dades Q2

Linux Operating System Environment Computadors Grau en Ciència i Enginyeria de Dades Q2 Linux Operating System Environment Computadors Grau en Ciència i Enginyeria de Dades 2017-2018 Q2 Facultat d Informàtica de Barcelona This first lab session is focused on getting experience in working

More information

02. At the command prompt, type usermod -l bozo bozo2 and press Enter to change the login name for the user bozo2 back to bozo. => steps 03.

02. At the command prompt, type usermod -l bozo bozo2 and press Enter to change the login name for the user bozo2 back to bozo. => steps 03. Laboratory Exercises: ===================== Complete the following laboratory exercises. All steps are numbered but not every step includes a question. You only need to record answers for those steps that

More information

Introduction to Linux

Introduction to Linux Introduction to Linux Phil Mercurio The Scripps Research Institute mercurio@scripps.edu 1 Session Overview What is Linux Shells & Windows The Linux File System Assorted Commands 2 What Is Linux? Linux

More information

CST8207: GNU/Linux Operating Systems I Lab Seven Linux User and Group Management. Linux User and Group Management

CST8207: GNU/Linux Operating Systems I Lab Seven Linux User and Group Management. Linux User and Group Management Student Name: Lab Section: Linux User and Group Management 1 Due Date - Upload to Blackboard by 8:30am Monday April 2, 2012 Submit the completed lab to Blackboard following the Rules for submitting Online

More information

Linux Command Line and Shell Scripting Bible

Linux Command Line and Shell Scripting Bible Linux Command Line and Shell Scripting Bible Richard Blum Wiley Publishing, Inc. Linux Command Line and Shell Scripting Bible Linux Command Line and Shell Scripting Bible Richard Blum Wiley Publishing,

More information

CST8207: GNU/Linux Operating Systems I Lab Seven Linux User and Group Management. Linux User and Group Management

CST8207: GNU/Linux Operating Systems I Lab Seven Linux User and Group Management. Linux User and Group Management Student Name: YOUR NAME Lab Section: 011 012 013 or 014 Linux User and Group Management 1 Due Date - Upload to Blackboard by 8:30am Monday April 2, 2012 Submit the completed lab to Blackboard following

More information

Introduction to remote command line Linux. Research Computing Team University of Birmingham

Introduction to remote command line Linux. Research Computing Team University of Birmingham Introduction to remote command line Linux Research Computing Team University of Birmingham Linux/UNIX/BSD/OSX/what? v All different v UNIX is the oldest, mostly now commercial only in large environments

More information

Post Ubuntu Install Exercises

Post Ubuntu Install Exercises Post Ubuntu Install Exercises PacNOG 3 June 18 Rarotonga, Cook Islands 1. Get used to using sudo 2. Create an ainst account 3. Learn how to install software 4. Install gcc and make 5. Learn how to control

More information

Introduction. File System. Note. Achtung!

Introduction. File System. Note. Achtung! 3 Unix Shell 1: Introduction Lab Objective: Explore the basics of the Unix Shell. Understand how to navigate and manipulate file directories. Introduce the Vim text editor for easy writing and editing

More information

Linux Fundamentals (GL120) U8583S

Linux Fundamentals (GL120) U8583S Course data sheet Linux Fundamentals (GL120) U8583S HPE course number Course length Delivery mode View schedule, local pricing, and register View related courses Why HPE Education Services? U8583S 5 days

More information

CSE 265: System and Network Administration

CSE 265: System and Network Administration CSE 265: System and Network Administration User accounts The /etc/passwd file The /etc/shadow file Root powers Ownership of files and processes The superuser The /etc/group file Adding users Removing users

More information

Some useful UNIX Commands written down by Razor for newbies to get a start in UNIX

Some useful UNIX Commands written down by Razor for newbies to get a start in UNIX Some useful UNIX Commands written down by Razor for newbies to get a start in UNIX 15th Jan. 2000 / 3:55 am Part 1: Working with files and rights ------------------------------------- cp

More information

Prerequisites: Students must be proficient in general computing skills but not necessarily experienced with Linux or Unix. Supported Distributions:

Prerequisites: Students must be proficient in general computing skills but not necessarily experienced with Linux or Unix. Supported Distributions: This GL124 course is designed to follow an identical set of topics as the Red Hat RH124 course with the added benefit of very comprehensive lab exercises and detailed lecture material. The Red Hat Enterprise

More information

Week 2. Exp 2 (a) (b): Introduction to LINUX OS, Installation of LINUX OS, Basic DOS commands

Week 2. Exp 2 (a) (b): Introduction to LINUX OS, Installation of LINUX OS, Basic DOS commands Week 2 Exp 2 (a) (b): Introduction to LINUX OS, Installation of LINUX OS, Basic DOS commands mkdir, cd, cls, del, copy, attrib, date, path, type, format, exit. Basic commands in LINUX - cat, ls, pwd,,

More information

UNIX. The Very 10 Short Howto for beginners. Soon-Hyung Yook. March 27, Soon-Hyung Yook UNIX March 27, / 29

UNIX. The Very 10 Short Howto for beginners. Soon-Hyung Yook. March 27, Soon-Hyung Yook UNIX March 27, / 29 UNIX The Very 10 Short Howto for beginners Soon-Hyung Yook March 27, 2015 Soon-Hyung Yook UNIX March 27, 2015 1 / 29 Table of Contents 1 History of Unix 2 What is UNIX? 3 What is Linux? 4 How does Unix

More information

Using LINUX a BCMB/CHEM 8190 Tutorial Updated (1/17/12)

Using LINUX a BCMB/CHEM 8190 Tutorial Updated (1/17/12) Using LINUX a BCMB/CHEM 8190 Tutorial Updated (1/17/12) Objective: Learn some basic aspects of the UNIX operating system and how to use it. What is UNIX? UNIX is the operating system used by most computers

More information

Getting Started With UNIX Lab Exercises

Getting Started With UNIX Lab Exercises Getting Started With UNIX Lab Exercises This is the lab exercise handout for the Getting Started with UNIX tutorial. The exercises provide hands-on experience with the topics discussed in the tutorial.

More information

Introduction to Linux

Introduction to Linux Introduction to Linux University of Bristol - Advance Computing Research Centre 1 / 47 Operating Systems Program running all the time Interfaces between other programs and hardware Provides abstractions

More information

Console Redirection on VMware ESX Server Software and Dell PowerEdge Servers

Console Redirection on VMware ESX Server Software and Dell PowerEdge Servers Console Redirection on VMware ESX Server Software and Dell PowerEdge Servers October 2005 Notes, Notices, and Cautions NOTE: A NOTE indicates important information that helps you make better use of your

More information

SANOG VI IP Services Workshop: FreeBSD Install

SANOG VI IP Services Workshop: FreeBSD Install SANOG VI IP Services Workshop: FreeBSD Install FreeBSD is designed to be a server operating system. This becomes apparent during the installation process. The FreeBSD installer is a console-based (not

More information

Unit 2: Manage Files Graphically with Nautilus Objective: Manage files graphically and access remote systems with Nautilus

Unit 2: Manage Files Graphically with Nautilus Objective: Manage files graphically and access remote systems with Nautilus Linux system administrator-i Unit 1: Get Started with the GNOME Graphical Desktop Objective: Get started with GNOME and edit text files with gedit Unit 2: Manage Files Graphically with Nautilus Objective:

More information

CISC 220 fall 2011, set 1: Linux basics

CISC 220 fall 2011, set 1: Linux basics CISC 220: System-Level Programming instructor: Margaret Lamb e-mail: malamb@cs.queensu.ca office: Goodwin 554 office phone: 533-6059 (internal extension 36059) office hours: Tues/Wed/Thurs 2-3 (this week

More information

CSE 265: System and Network Administration

CSE 265: System and Network Administration CSE 265: System and Network Administration System startup and shutdown Bootstrapping Booting PCs Boot loaders Booting into single user mode Startup scripts Rebooting and shutting down Bootstrapping i.e.,

More information