Table of Contents About the Author About the Technical Reviewer Acknowledgments Introduction Chapter 1: Introduction Objectives About Linux The birth of Windows Black box syndrome The birth of Linux The open box The Linux Truth Knowledge Flexibility Stability Scalability Security Freedom Our software rights Longevity Keep the hardware relevant Resist malware Should I be a SysAdmin? About this course About the experiments What to do if the experiments do not work Terminology How to access the command line Chapter summary Exercises Chapter 2: Introduction to Operating Systems Objectives Choice – Really! What is an operating system? Hardware Motherboard The processor Peripherals The operating system The definition Typical operating system functions Memory management Multitasking Multiuser Process management Interprocess communication Device management Error handling Utilities A bit of history Starting with UNICS UNIX The Berkeley Software Distribution (BSD) The Unix Philosophy A (very) brief history of Linux Core utilities GNU coreutils util-linux Copyleft Games Chapter summary Exercises Chapter 3: The Linux Philosophy for SysAdmins Objectives Background The structure of the philosophy The tenets Data streams are a universal interface Transforming data streams Everything is a file Use the Linux FHS Embrace the CLI Be the lazy SysAdmin Automate everything Always use shell scripts Test early test often Use common sense naming Store data in open formats Use separate filesystems for data Make programs portable Use open source software Strive for elegance Find the simplicity Use your favorite editor Document everything Back up everything – frequently Follow your curiosity There is no should Mentor the young SysAdmins Support your favorite open source project Reality bytes Chapter summary Exercises Chapter 4: Preparation Objectives Overview Got root? Hardware specifications Host software requirements Installing VirtualBox Install VirtualBox on a Linux host Install VirtualBox on a Windows host Creating the VM VirtualBox Manager Configuring the virtual network Preparing disk space Windows Linux Download the ISO image file Creating the VM Chapter summary Exercises Chapter 5: Installing Linux Objectives Overview Boot the Fedora live image Installing Fedora Start the installation Set the hostname Hard drive partitioning About swap space Types of memory Swap Types of Linux swap Thrashing What is the right amount of swap space? Finish partitioning Begin the installation Set the root password Create the student user Finishing the installation Exit the installer Shut down the Live system Reconfigure the VM Create a snapshot First boot What to do if the experiments do not work Chapter summary Exercises Chapter 6: Using the Xfce Desktop Objectives Why Xfce The desktop The file manager Stability xfce4-terminal emulator Configurability Getting started Login Exploring the Xfce desktop Settings Manager Adding launchers to Panel 2 Preferred applications Desktop appearance Appearance Multiple desktops Installing updates Chapter summary Exercises Chapter 7: Using the Linux Command Line Objectives Introduction Preparation Defining the command line CLI terminology Command prompt Command line Command-line interface Command Terminal Console Virtual consoles Using virtual consoles Terminal emulator Pseudo-terminal Device special files Session Shell Using different shells Secure Shell (SSH) screen The GUI and the CLI Some important Linux commands The PWD Directory path notation styles Moving around the directory tree Tab completion facility Exploring files More commands Command recall and editing Chapter summary Exercises Chapter 8: Core Utilities Objectives GNU coreutils util-linux Chapter summary Exercises Chapter 9: Data Streams Objectives Data streams as raw materials Text streams – A universal interface STDIO file handles Preparing a USB thumb drive Generating data streams Test a theory with yes Exploring the USB drive Randomness Pipe dreams Building pipelines Redirection Just grep’ing around Cleanup Chapter summary Exercises Chapter 10: Text Editors Objectives Why we need text editors Vim Other editors Emacs gedit Leafpad Kate xfw xed Learning Vim Disabling SELinux Use your favorite text editor Chapter summary Exercises Chapter 11: Working As Root Objectives Why root? More about the su command Getting to know the root account Disadvantages of root Escalating user privilege The bad ways Using sudo Do do that sudo that you do so well The sudoers file Host aliases User aliases Command aliases Environment defaults Command section Bypassing passwords wheel Real SysAdmins don’t sudo sudo or not sudo Bypass sudo Valid uses for sudo Using su as root Chapter summary Exercises Chapter 12: Installing and Updating Software Objectives Dependency hell RPM YUM DNF Installing packages Installing updates Post-update tasks Removing packages Groups Adding repositories About the kernel Chapter summary Exercises Chapter 13: Tools for Problem Solving Objectives The art of problem solving The five steps of problem solving Knowledge Observation Reasoning Action Test System performance and problem solving top Summary section Load averages CPU usage Process section Things to look for with CPU usage Memory statistics The task list Signals Consistency Other top-like tools htop atop More tools Memory tools Tools that display disk I/O statistics The /proc filesystem Exploring hardware Monitoring hardware temperatures Monitoring hard drives System statistics with SAR Installation and configuration Examining collected data Cleanup Chapter summary Exercises Chapter 14: Terminal Emulator Mania Objectives About terminals My requirements rxvt xfce4-terminal LXTerminal Tilix Konsole Terminator Chapter summary Exercises Chapter 15: Advanced Shell Topics Objectives The Bash shell Shell options Shell variables Commands The PATH Internal commands External commands Forcing the use of external commands Compound commands Time-saving tools Brace expansion Special pattern characters Sets Meta-characters Using grep Finding files Chapter summary Exercises Chapter 16: Linux Boot and Startup Objectives Overview Hardware boot Linux boot GRUB GRUB stage 1 GRUB stage 1.5 GRUB stage 2 Configuring GRUB The Linux kernel Linux startup systemd Graphical login screen Display manager Window manager How do I deal with all these choices? About the login CLI login screen GUI login screen Chapter summary Exercises Chapter 17: Shell Configuration Objectives Starting the shell Non-login shell startup Login shell startup Exploring the global configuration scripts Exploring the local configuration scripts Testing it Exploring the environment User shell variables Aliases Chapter summary Exercises Chapter 18: Files, Directories, and Links Objectives Introduction Preparation User accounts and security File attributes File ownership File permissions Directory permissions Implications of Group ownership umask Changing file permissions Applying permissions Timestamps File meta-structures The directory entry The inode File information Links Hard links Locating files with several hard links Symbolic (soft) links Chapter summary Exercises Chapter 19: Filesystems Objectives Overview Definitions Filesystem functions The Linux Filesystem Hierarchical Standard The standard Problem solving Using the filesystem incorrectly Adhering to the standard Linux unified directory structure Filesystem types Mounting The Linux EXT4 filesystem Cylinder groups The inode Journal Data allocation strategies Data fragmentation Repairing problems The /etc/fstab file Repairing damaged filesystems Finding lost files Creating a new filesystem Finding space Add a new virtual hard drive Other filesystems Chapter summary Exercises Bibliography Books Web sites Index Become a Linux sysadmin and expert user of Linux, even with no previous Linux experience and learn to manage complex systems with ease. Volume 1 of this three volume training course introduces operating systems in general and Linux in particular. It briefly explores the The Linux Philosophy for SysAdmins in preparation for the rest of the course. This book provides you with the tools necessary for mastering user management; installing, updating, and deleting software; and using command line tools to do performance tuning and basic problem determination. You'll begin by creating a virtual network and installing an instance of Fedora – a popular and powerful Linux distribution – on a VirtualBox VM that can be used for all of the experiments on an existing Windows or Linux computer. You’ll then move on to the basics of using the Xfce GUI desktop and the many tools Linux provides for working on the command line including virtual consoles, various terminal emulators, BASH, and other shells. Explore data streams and the Linux tools used to manipulate them, and learn about the Vim text editor, which is indispensable to advanced Linux users and system administrators, and be introduced to some other text editors. You’ll also see how to install software updates and new software, learn additional terminal emulators, and some advanced shell skills. Examine the sequence of events that take place as the computer boots and Linux starts up, configure your shell to personalize it in ways that can seriously enhance your command line efficiency, and delve into all things file and filesystems. What You Will Learn • Install Fedora Linux and basic configuration of the Xfce desktop • Access the root user ID, and the care that must be taken when working as root • Use Bash and other shells in the Linux virtual consoles and terminal emulators • Create and modify system configuration files with Use the Vim text editor • Explore administrative tools available to root that enable you to manage users, filesystems, processes, and basic network communications • Configure the boot and startup sequences Who This Book Is For Anyone who wants to learn Linux as an advanced user and system administrator at the command line while using the GUI desktop to leverage productivity. Become a Linux sysadmin and expert user of Linux, even with no previous Linux experience and learn to manage complex systems with ease. This book provides you with the tools necessary for mastering user management; installing, updating, and deleting software; creating and managing simple firewalls; and using command line tools to do performance tuning and basic problem determination. You'll begin by installing a Linux instance on a VirtualBox VM on an existing Windows or Linux computer that can be used for all your projects. You will then move on to the basics of using the Xfce GUI desktop and the many options Linux provides for working on the command line including virtual consoles, various terminal emulators, BASH, and other shells. Some of the more advanced user level tasks include creating, deleting and managing files and directories, managing the users own processes, writing short command line programs, and creating shell scripts to begin learning how to "Automate Everything." Improving efficiency using command line recall and editing, command line history, and by creating command line aliases is addressed as well. You'll configure your own BASH environment by directly editing the user level BASH configuration files, and learning the Vi editor in the process. Using and Administering Linux , the first book in the From Zero to SysAdmin series will help in using and managing Linux client services, such as DHCP network configuration, Chrony, SSH, DNS name services, and more. What You Will Learn Install Fedora Linux and some basic configuration of the Xfce desktop Access the root user ID, and the care that must be taken when working as root Explore administrative tools available to root that enable the student to manage users, filesystems, processes, and basic network communications Configure the boot and startup sequences, start, stop, and obtain the status of running services Review methods of performing and testing backups. Who This Book Is For Anyone who wants to learn Linux as an advanced user and system administrator at both the command line and the GUI desktop.