Guide to Linux Installation and Administration1 Chapter 4 Running a Linux System.

  • Published on
    03-Jan-2016

  • View
    214

  • Download
    0

Transcript

  • Chapter 4Running a Linux System

    Planning, Developing and Marketing Successful Websites

  • ObjectivesIn this chapter, you will:Manage files and directories on a Linux system using basic commandsLaunch programs and manage corresponding software packagesAdd and remove features from the Linux kernelReview and change the initialization process that starts a Linux-based computerShut down a Linux system in an orderly way

    Planning, Developing and Marketing Successful Websites

  • Working with Linux Files and DirectoriesInformation in Linux is stored in files organized in directoriesParent directory contains child directories and filesThe parent directory for all directories is the root directoryAll Linux configuration files are located in subdirectories of the root directory

    Planning, Developing and Marketing Successful Websites

  • Standard Linux Subdirectories of the Root Directory

    Planning, Developing and Marketing Successful Websites

  • Working at a Command LineLogging in to Linux at a text-mode console launches a command-line environmentWithin a graphical environment, you can a command-line window by using the xterm programThe command-line window is also called a terminal emulator window

    Planning, Developing and Marketing Successful Websites

  • A Command-Line Window in a Graphical Environment

    Planning, Developing and Marketing Successful Websites

  • Managing Files with Command-Line UtilitiesThe command-line environment is provided by a shell Shell: program that accepts and acts on the commands that you enterAbsolute path: complete description of the directory in absolute termsRelative path: partial description of the directory relative to another location

    Planning, Developing and Marketing Successful Websites

  • Managing Files with Command-Line UtilitiesLinux commands are case sensitivecan include options and parameters Information about the date and time when an event occurred is stored in the form of a timestamp

    Planning, Developing and Marketing Successful Websites

  • Commands for Managing Files and Directories

    Planning, Developing and Marketing Successful Websites

  • Commands for Managing Files and Directories

    Planning, Developing and Marketing Successful Websites

  • Managing Files with Command-Line UtilitiesFilenamesAre case-sensitiveCan be up to 256 charactersCan include file extensions

    Planning, Developing and Marketing Successful Websites

  • Managing Files with Graphical UtilitiesLinux desktop includes a file managerFile manager: graphical program to display the contents of a directory and manage files and directories The file manager in Red Hat Linux 7.3 is called NautilusTo perform basic file management tasks, you can drag and drop file icons

    Planning, Developing and Marketing Successful Websites

  • The Nautilus File Manager Window

    Planning, Developing and Marketing Successful Websites

  • File PropertiesEach file in Linux has several basic properties:Type Name SizeLocationTimestampEach file has the owner of the file, the group assigned to the file, and the permissions granted to access the file

    Planning, Developing and Marketing Successful Websites

  • The Properties Dialog Box

    Planning, Developing and Marketing Successful Websites

  • File PermissionsFile permissions define the access that the owner has granted to others on the Linux systemTypes of permissions:Read permission (r)Write permission (w)Execute permission (x)Permissions can be assigned in three different ways:User permissionGroup permissionOther permissions

    Planning, Developing and Marketing Successful Websites

  • File PermissionsYou can alter file ownership and file permissions using the chown and chmod commandsThe chmod command uses letters or numeric codes to define the file permissions assigned to a file or directoryThe umask command determines the file permissions assigned when you create a new file

    Planning, Developing and Marketing Successful Websites

  • Commonly Used File Permission Settings

    Planning, Developing and Marketing Successful Websites

  • The Permissions Tab of the Properties Dialog Box

    Planning, Developing and Marketing Successful Websites

  • Running and Managing SoftwareEnvironment variables: defined by the Linux shell so that all programs can access their valuesVariable: memory location used by a program to store a valueThe PATH environment variable includes a list of all the directories where programs on the system are locatedYou can display values of the PATH using the echo command

    Planning, Developing and Marketing Successful Websites

  • Function LibrariesA function is a small task that a computer program performsA function library is a file that contains commonly used functionsThe ldd command lists the libraries that a program requires

    Planning, Developing and Marketing Successful Websites

  • Using rpm to Manage Software Packagesrpm commandManages all of the rpm software packagesMaintains a database for all the software installed on the Linux systemYou can use the rpm command to query the software package database or to install or erase software packages from the systemHundreds of options are supported by the rpm command

    Planning, Developing and Marketing Successful Websites

  • Using Graphical Tools to Manage Software PackagesGNOME and KDE include graphical programs to manage software packagesThe GnoRPM package management utility is included with GnomeThe KDE Desktop includes a package management tool called kPackageBoth GmoRPM and kPackage provide menu items

    Planning, Developing and Marketing Successful Websites

  • The Main Window of the GnoRPM Utility

    Planning, Developing and Marketing Successful Websites

  • Using kPackage to Display Software Package Information

    Planning, Developing and Marketing Successful Websites

  • Using tar Archive FilesA tar archive is a collection of many files stored in a single fileThe tar command is used to create a tar archive, to extract its content, and to create backups of files on the systemA tar archive has a .tar extensionThe resulting file after the tar command with the compression options is called a gzipped tarball

    Planning, Developing and Marketing Successful Websites

  • Compression Utilities in Linux

    Planning, Developing and Marketing Successful Websites

  • The Linux KernelEach Linux kernel has:Release numberTimestamp Modules

    Planning, Developing and Marketing Successful Websites

  • Learning about Your KernelThe uname command with the r option displays the version of your Linux kernel followed by the release numberA release number is assigned by the company that prepared the Linux productA timestamp indicates the date and time when the kernel was created

    Planning, Developing and Marketing Successful Websites

  • Kernel ModulesLinux kernel modules are files containing computer code that can be loaded into the kernel or removed from the kernelKernel modules can be automatically loaded based on the configuration set during the Linux installationThe lsmod command lists the modules that are installed in the Linux kernel

    Planning, Developing and Marketing Successful Websites

  • Adding and Removing ModulesThe modprobe command loads a module with any required supporting modulesThe rmmod command removes a module from the kernelModule parameters provide information needed by amodule to locate system resources

    Planning, Developing and Marketing Successful Websites

  • Locating ModulesThe module files are stored in /lib/modules/version/kernel directory, where version id the version number of the Linux kernel on the systemThis directory contains subdirectories for networking-related modules, device drivers, and other module types

    Planning, Developing and Marketing Successful Websites

  • The Initialization Process1. A boot manager loads and starts the Linux kernel2. The Linux kernel initializes hardware and then launches the init program3. The init program launches a script based on the run level in which Linux is to operate4. The script started by init typically runs many other scripts to launch and manage system services

    Planning, Developing and Marketing Successful Websites

  • Booting the KernelGRUB and LILO are the boot managersThe boot manager displays a prompt listing the available operating system to launchBoot parameters instruct the Linux kernel how to operate or how to access parts of the computer systems hardwareYou can add boot parameters at the boot manager selection prompt

    Planning, Developing and Marketing Successful Websites

  • Configuring the Boot ManagerYou can update the configuration of a boot manager after the installation is completedThe configuration file for the LILO boot manager is /etc/lilo.confThe configuration file for GRUB boot manager is /boot/grub/grub.conf

    Planning, Developing and Marketing Successful Websites

  • Initializing System ServicesThe init program is a master control program that starts other programs and scripts that initialize the system servicesA script is a collection of commands that are stored in a text file and executed without user interventionThe init program is controlled by the /etc/inittab configuration file

    Planning, Developing and Marketing Successful Websites

  • Reviewing Run Level ServicesA run level is a mode of operation in which a preconfigured set of services is activated

    Planning, Developing and Marketing Successful Websites

  • The Linux Initialization Process

    Planning, Developing and Marketing Successful Websites

  • Starting and Stopping System ServicesThe chkconfig program allows you to start and stop services when you boot LinuxRedHat Linux includes a graphical utility to configure system services called serviceconfThe KDE Desktop includes a similar graphical utility called ksysv

    Planning, Developing and Marketing Successful Websites

  • The Service Configuration Utility

    Planning, Developing and Marketing Successful Websites

  • The ksysv Graphical Services Configuration Utility

    Planning, Developing and Marketing Successful Websites

  • Configuring System ServicesThe initialization scripts in /etc/rc.d/init.d are provided when you install LinuxConfiguration details for system services scripts are located in the /etc/sysconfig directory and its subdirectories

    Planning, Developing and Marketing Successful Websites

  • Shutting Down LinuxYou can shut down Linux by:The reboot commandThe halt commandThe shutdown commandPressing Ctrl+Alt+DelThe telinit 0 command

    Planning, Developing and Marketing Successful Websites

  • SummaryInformation in Linux is stored in files organized in a directory structure that begins with the root directoryThere are basic commands to manage files and directoriesFiles can be compressed using tar, zip, gzip, and other utilitiesRead, Write, and Execute permissions for a file or directory can be assigned to the owner, to the assigned group, or to all other users on the systemThe rpm command is used to query the software package database or to install or erase software packages from the system

    Planning, Developing and Marketing Successful Websites

  • SummaryThe Linux kernel supports loadable modules, which are managed using the lsmod, insmod, rmmod, and modprobe commandsYou can provide boot parameters to the Linux kernel at the boot manager selection promptThe Linux kernel starts the init program, which in turn runs several scripts based on information stored in the run level directoriesYou can set up which services are activated at boot time using the chkconfig command or using various graphical utilitiesTo avoid data loss, you must gracefully shut down Linux using a command such as reboot, halt, or shutdown

    Planning, Developing and Marketing Successful Websites

Recommended

View more >