O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

CompTIA Linux+/LPIC-1 Portable Command Guide: All the commands for the CompTIA LX0-103 & LX0-104 and LPI 101-400 & 102-400 exams in one compact,

Book Description

Here are all the CompTIA Linux+/LPIC-1 Linux commands you need in one condensed, portable resource. The CompTIA Linux+/LPIC-1 Portable Command Guide is filled with valuable, easy-to-access information and is portable enough to use wherever your work takes you.

The guide summarizes all Linux+/LPIC-1 certification-level Linux commands, keywords, command arguments, and associated prompts, and provides tips and examples of how to apply them to real-world scenarios. Configuration examples throughout the book provide you with a better understanding of how these commands are used in real-world environments.

This book reflects topics in today’s CompTIA LX0-103 & LX0-104 and LPI 101-400 & 102-400 exams. Use this quick reference resource to help you memorize commands and concepts as you work to pass any of these CompTIA or LPI certification exams.

The book is organized into these parts: Exam LX0-103/LPI 101-400

Part I: System Architecture

Part II: Linux Installation and Package Management

Part III: GNU and Unix Commands

Part IV: Devices, Linux Filesystems, Filesystem Hierarchy Standard Exam LX0-104/LPI 102-400

Part V: Shells, Scripting, and Data Management

Part VI: User Interfaces and Desktops

Part VII: Administrative Tasks

Part VIII: Essential System Services

Part IX: Networking Fundamentals

Part X: Securityuick, offline access to all CompTIA

  • Linux+/LPI LPIC-1 commands for research and solutions
  • Logical how-to topic groupings for a one-stop resource
  • Great for review before your Linux+ or LPIC-1 certification exams
  • Compact size makes it easy to carry with you, wherever you go
  • “Create Your Own Journal” appendix with blank, lined pages allows you to personalize the book for your needs
  • “What Do You Want to Do?” chart inside front cover helps you to quickly reference specific tasks

Table of Contents

  1. Cover Page
  2. Title Page
  3. Copyright Page
  4. Contents at a Glance
  5. Contents
  6. Introduction
  7. Part I: System Architecture
    1. CHAPTER 1 Determine and Configure Hardware Settings
      1. /sys
        1. Key Files and Directories in /sys
      2. /proc
        1. Key Files and Directories in /proc
      3. /dev
        1. Key Files in /dev
      4. modprobe
        1. Key Options for the modprobe Command
      5. lsmod
        1. Output of the lsmod Command
      6. lspci
        1. Key Options for the lspci Command
      7. lsusb
        1. Key Options for the lsusb Command
    2. CHAPTER 2 Boot the System
      1. The Boot Sequence
      2. Common Commands for the Boot Loader
      3. Options for the Kernel at Boot Time
      4. SysVinit
      5. Systemd
      6. Upstart
      7. Boot Events in the Log Files
      8. dmesg
    3. CHAPTER 3 Change Runlevels / Boot Targets and Shut Down or Reboot System
      1. Set the Default Runlevel or Boot Target
      2. Change between Runlevels / Boot Targets, Including Single-User Mode
      3. Shut Down and Reboot from the Command Line
      4. Alert Users Before Switching Runlevels / Boot Targets or Other Major System Events
      5. Properly Terminate Processes
      6. /etc/inittab
      7. shutdown
      8. init
      9. /etc/init.d/
      10. telinit
      11. systemd
      12. systemctl
      13. /etc/systemd/
      14. /usr/lib/systemd/
      15. wall
  8. Part II: Linux Installation and Package Management
    1. CHAPTER 4 Design Hard Disk Layout
      1. Allocate Filesystems and Swap Space to Separate Partitions or Disks
      2. Tailor the Design to the Intended Use of the System
      3. Ensure the /boot Partition Conforms to the Hardware Architecture Requirements for Booting
      4. Knowledge of Basic features of LVM
      5. / (root) Filesystem
      6. /var Filesystem
      7. /home Filesystem
      8. /boot Filesystem
      9. Swap Space
      10. Mount Points
      11. Partitions
    2. CHAPTER 5 Install a Boot Manager
      1. Providing Alternative Boot Locations and Backup Boot Options
      2. Install and Configure a Boot Loader Such As GRUB Legacy
      3. Perform Basic Configuration Changes for GRUB 2
      4. Interact with the Boot Loader
      5. menu.lst, grub.cfg, and grub.conf
      6. grub-install
      7. grub-mkconfig
      8. MBR
    3. CHAPTER 6 Manage Shared Libraries
      1. Identify Shared Libraries
      2. Identify the Typical Locations of System Libraries
      3. Load Shared Libraries
      4. ldd
      5. ldconfig
      6. /etc/ld.so.conf
      7. LD_LIBRARY_PATH
    4. CHAPTER 7 Use Debian Package Management
      1. Install, Upgrade, and Uninstall Debian Binary Packages
      2. Find Packages Containing Specific Files or Libraries that May or May Not Be Installed
      3. Obtain Package Information Such As Version, Content, Dependencies, Package Integrity, and Installation Status (Whether or Not the Package Is Installed)
      4. /etc/apt/sources.list
      5. dpkg
      6. dpkg-reconfigure
      7. apt-get
      8. apt-cache
      9. aptitude
    5. CHAPTER 8 Use RPM and YUM Package Management
      1. Install, Reinstall, Upgrade, and Remove Packages Using RPM and YUM
      2. Obtain Information on RPM Packages Such As Version, Status, Dependencies, Integrity, and Signatures
      3. Determine What Files a Package Provides, as Well as Find Which Package a Specific File Comes From
      4. rpm
      5. rpm2cpio
      6. /etc/yum.conf
      7. /etc/yum.repos.d/
      8. yum
      9. yumdownloader
  9. Part III: GNU and Unix Commands
    1. CHAPTER 9 Work on the Command Line
      1. Use Single Shell Commands and One-Line Command Sequences to Perform Basic Tasks on the Command Line
      2. Use and Modify the Shell Environment, Including Defining, Referencing, and Exporting Environment Variables
      3. Use and Edit Command History
      4. Invoke Commands Inside and Outside the Defined Path
      5. bash
      6. echo
      7. env
      8. export
      9. pwd
      10. set
      11. unset
      12. man
      13. uname
      14. history
      15. .bash_history
    2. CHAPTER 10 Process Text Streams Using Filters
      1. cat
      2. cut
      3. expand
      4. fmt
      5. head
      6. join
      7. less
      8. nl
      9. od
      10. paste
      11. pr
      12. sed
      13. sort
      14. split
      15. tail
      16. tr
      17. unexpand
      18. uniq
      19. wc
    3. CHAPTER 11 Perform Basic File Management
      1. Copy, Move, and Remove Files and Directories Individually
      2. Copy Multiple Files and Directories Recursively
      3. Remove Files and Directories Recursively
      4. Use Simple and Advanced Wildcard Specifications in Commands
      5. Using find to Locate and Act on Files Based on Type, Size, or Time
      6. Usage of tar, cpio, and dd
      7. cp
      8. find
      9. mkdir
      10. mv
      11. ls
      12. rm
      13. rmdir
      14. touch
      15. tar
      16. cpio
      17. dd
      18. file
      19. gzip
      20. gunzip
      21. bzip2
      22. xz
      23. File Globbing
    4. CHAPTER 12 Use Streams, Pipes, and Redirects
      1. Redirecting Standard Input, Standard Output, and Standard Error
      2. Pipe the Output of One Command to the Input of Another Command
      3. Use the Output of One Command as Arguments to Another Command
      4. Send Output to Both stdout and a File
      5. tee
      6. xargs
    5. CHAPTER 13 Create, Monitor, and Kill Processes
      1. Run Jobs in the Foreground and Background
      2. Signal a Program to Continue Running After Logout
      3. Monitor Active Processes
      4. Select and Sort Processes for Display
      5. Send Signals to Processes
      6. &
      7. bg
      8. fg
      9. jobs
      10. kill
      11. nohup
      12. ps
      13. top
      14. free
      15. uptime
      16. pgrep
      17. pkill
      18. killall
    6. CHAPTER 14 Modify Process Execution Priorities
      1. Know the Default Priority of a Job that Is Created
      2. Run a Program with Higher or Lower Priority than the Default
      3. Change the Priority of a Running Process
      4. nice
      5. ps
      6. renice
      7. top
    7. CHAPTER 15 Search Text Files Using Regular Expressions
      1. Create Simple Regular Expressions Containing Several Notational Elements
      2. Use Regular Expression Tools to Perform Searches through a Filesystem or File Content
      3. grep
      4. egrep
      5. fgrep
      6. sed
      7. regex(7)
    8. CHAPTER 16 Perform Basic File Editing Operations Using vi
      1. Navigate a Document Using vi
      2. Use Basic vi Modes
      3. Insert, Edit, Delete, Copy, and Find Text
      4. vi
      5. /, ?
      6. h, j, k, l
      7. i, o, a
      8. c, d, p, y, dd, yy
      9. ZZ, :w!, :q!, :e!
  10. Part IV: Devices, Linux Filesystems, and the Filesystem Hierarchy Standard
    1. CHAPTER 17 Create Partitions and Filesystems
      1. Manage MBR Partition Tables
      2. Use Various mkfs Commands to Create Various Filesystems, Such As ext2/ext3/ext4, XFS, and VFAT
      3. Awareness of ReiserFS and btrfs
      4. Basic Knowledge of gdisk and parted with GP
      5. fdisk
      6. gdisk
      7. parted
      8. mkfs
      9. mkswap
      10. swapon
    2. CHAPTER 18 Maintain the Integrity of Filesystems
      1. Verify the Integrity of Filesystems
      2. Monitor Free Space and Inodes
      3. Repair Simple Filesystem Problems
      4. du
      5. df
      6. fsck
      7. e2fsck
      8. mke2fs
      9. debugfs
      10. dumpe2fs
      11. tune2fs
      12. XFS Tools (Such As xfs_metadump and xfs_info)
    3. CHAPTER 19 Control Mounting and Unmounting of Filesystems
      1. Manually Mount and Unmount Filesystems
      2. Configure Filesystem Mounting on Bootup
      3. Configure User-Mountable Removable Filesystems
      4. /etc/fstab
      5. /media
      6. mount
      7. umount
    4. CHAPTER 20 Manage Disk Quotas
      1. Set Up a Disk Quota for a Filesystem
      2. Edit, Check, and Generate User Quota Reports
      3. quota
      4. edquota
      5. repquota
      6. quotaon
    5. CHAPTER 21 Manage File Permissions and Ownership
      1. Manage Access Permissions on Regular and Special Files As Well As Directories
      2. Use Access Modes Such As suid, sgid, and the Sticky Bit to Maintain Security
      3. Know How to Change the File Creation Mask
      4. Use the Group Field to Grant File Access to Group Members
      5. chmod
      6. umask
      7. chown
      8. chgrp
    6. CHAPTER 22 Create and Change Hard and Symbolic Links
      1. Create Links
      2. Identify Hard and/or Soft Links
      3. Copying Versus Linking Files
        1. Hard Links
        2. Soft Links
      4. Use Links to Support System Administration Tasks
      5. ln
      6. ls
    7. CHAPTER 23 Find System Files and Place Files in the Correct Location
      1. Understand the Correct Locations of Files Under the FHS
      2. Find Files and Commands on a Linux System
      3. Know the Location and Purpose of Important Files and Directories as Defined in the FHS
      4. find
      5. locate
      6. updatedb
      7. whereis
      8. which
      9. type
      10. /etc/updatedb.conf
  11. Part V: Shell Scripting and Data Management
    1. CHAPTER 24 Customize and Use the Shell Environment
      1. Set Environment Variables (For Example, PATH) at Login or When Spawning a New Shell
      2. Write Bash Functions for Frequently Used Sequences of Commands
      3. Maintain Skeleton Directories for New User Accounts
      4. Set Command Search Path with the Proper Directory
      5. source
      6. /etc/bash.bashrc
      7. /etc/profile
      8. env
      9. export
      10. set
      11. unset
      12. ~/.bash_profile
      13. ~/.bash_login
      14. ~/.profile
      15. ~/.bashrc
      16. ~/.bash_logout
      17. Function
      18. Alias
      19. Lists
    2. CHAPTER 25 Customize or Write Simple Scripts
      1. Use Standard sh Syntax (Loops, Tests)
      2. Use Command Substitution
      3. Test Return Values for Success or Failure or Other Information Provided by a Command
      4. Perform Conditional Mailing to the Superuser
      5. Correctly Select the Script Interpreter through the Shebang (#!) Line
      6. Manage the Location, Ownership, Execution and suid-rights of scripts
      7. for
      8. while
      9. test
      10. if
      11. read
      12. seq
      13. exec
    3. CHAPTER 26 SQL Data Management
      1. Use of Basic SQL Commands
      2. Perform Basic Data Manipulation
      3. insert
      4. update
      5. select
      6. delete
      7. from
      8. where
      9. group by
      10. order by
      11. join
  12. Part VI: User Interfaces and Desktops
    1. CHAPTER 27 Install and Configure X11
      1. Verify that the Video Card and Monitor Are Supported by an X Server
      2. Awareness of the X Font Server
      3. Basic Understanding and Knowledge of the X Window Configuration File
      4. /etc/X11/xorg.conf
      5. xhost
      6. DISPLAY
      7. xwininfo
      8. xdpyinfo
      9. X
    2. CHAPTER 28 Set Up a Display Manager
      1. Basic Configuration of LightDM
      2. Turn the Display Manager On or Off
      3. Change the Display Manager Greeting
      4. Awareness of XDM, KDM, and GDM
      5. lightdm
      6. /etc/lightdm
    3. CHAPTER 29 Accessibility
      1. Basic Knowledge of Keyboard Accessibility Settings (AccessX)
      2. Basic Knowledge of Visual Settings and Themes
      3. Basic Knowledge of Assistive Technology (AT)
      4. Sticky/Repeat Keys
      5. Slow/Bounce/Toggle Keys
      6. Mouse Keys
      7. High Contrast/Large Print Desktop Themes
      8. Screen Reader
      9. Braille Display
      10. Screen Magnifier
      11. On-Screen Keyboard
      12. Orca
      13. GOK
      14. emacspeak
  13. Part VII: Administrative Tasks
    1. CHAPTER 30 Manage User and Group Accounts and Related System Files
      1. Add, Modify, and Remove Users and Groups
      2. Manage User/Group Info in Password/Group Databases
      3. Create and Manage Special-Purpose and Limited Accounts
      4. /etc/passwd
      5. /etc/shadow
      6. /etc/group
      7. /etc/skel/
      8. chage
      9. getent
      10. groupadd
      11. groupdel
      12. groupmod
      13. passwd
      14. useradd
      15. userdel
      16. usermod
    2. CHAPTER 31 Automate System Administration Tasks by Scheduling Jobs
      1. Manage cron and at Jobs
      2. Configure User Access to cron and at Services
      3. Configure anacron
      4. /etc/cron.{d,daily,hourly,monthly,weekly}/
      5. /etc/at.deny
      6. /etc/at.allow
      7. /etc/crontab
      8. /etc/cron.allow
      9. /etc/cron.deny
      10. /var/spool/cron/
      11. crontab
      12. at
      13. atq
      14. atrm
      15. anacron
      16. /etc/anacrontab
    3. CHAPTER 32 Localization and Internationalization
      1. Configure Locale Settings and Environment Variables
      2. Configure Timezone Settings and Environment Variables
      3. /etc/timezone
      4. /etc/localtime
      5. /usr/share/zoneinfo/
      6. LC_*
      7. LC_ALL
      8. LANG
      9. TZ
      10. /usr/bin/locale
      11. tzselect
      12. timedatectl
      13. date
      14. iconv
      15. UTF-8
      16. ISO-8859
      17. ASCII
      18. Unicode
  14. Part VIII: Essential System Services
    1. CHAPTER 33 Maintain System Time
      1. Set the System Date and Time
      2. Set the Hardware Clock to the Correct Time in UTC
      3. Configure the Correct Timezone
      4. Basic NTP Configuration
      5. Knowledge of Using the pool.ntp.org Service
      6. Awareness of the ntpq Command
      7. /usr/share/zoneinfo/
      8. /etc/timezone
      9. /etc/localtime
      10. /etc/ntp.conf
      11. date
      12. hwclock
      13. ntpd
      14. ntpdate
      15. pool.ntp.org
    2. CHAPTER 34 System Logging
      1. Configuration of the Syslog Daemon
      2. Understanding of Standard Facilities, Priorities, and Actions
      3. Configuration of logrotate
      4. Awareness of rsyslog and syslog-ng
      5. syslog.conf
      6. syslogd
      7. klogd
      8. /var/log/
      9. logger
      10. logrotate
      11. /etc/logrotate.conf
      12. /etc/logrotate.d/
      13. journalctl
      14. /etc/systemd/journald.conf
      15. /var/log/journal/
    3. CHAPTER 35 Mail Transfer Agent (MTA) Basics
      1. Create Email Aliases
      2. Configure Email Forwarding
      3. Knowledge of Commonly Available MTA Programs (postfix, sendmail, qmail, exim) (no configuration)
      4. newaliases
      5. mail
      6. mailq
      7. postfix
      8. sendmail
      9. exim
      10. qmail
      11. ~/.forward
      12. sendmail Emulation Layer Commands
    4. CHAPTER 36 Manage Printers and Printing
      1. Basic CUPS Configuration (for Local and Remote Printers)
      2. Manage User Print Queues
      3. Troubleshoot General Printing Problems
      4. Add and Remove Jobs from Configured Printer Queues
      5. CUPS Configuration files, Tools, and Utilities
      6. /etc/cups/
      7. lpd Legacy Interface (lpr, lprm, lpq)
  15. Part IX: Networking Fundamentals
    1. CHAPTER 37 Fundamentals of Internet Protocols
      1. Demonstrate an Understanding of Network Masks and CIDR Notation
      2. Knowledge of the Differences Between Private and Public “Dotted Quad” IP Addresses
      3. Knowledge About Common TCP and UDP Ports and Services (20, 21, 22, 23, 25, 53, 80, 110, 123, 139, 143, 161, 162, 389, 443, 465, 514, 636, 993, 995)
      4. Knowledge About the Differences and Major Features of UDP, TCP, and ICMP
      5. Knowledge of the Major Differences Between IPv4 and IPv6
      6. Knowledge of the Basic Features of IPv6
      7. /etc/services
      8. IPv4, IPv6
      9. Subnetting
      10. TCP, UDP, ICMP
    2. CHAPTER 38 Basic Network Configuration
      1. Manually and Automatically Configure Network Interfaces
      2. Basic TCP/IP Host Configuration
      3. Setting a Default Route
      4. /etc/hostname
      5. /etc/hosts
      6. /etc/nsswitch.conf
      7. ifconfig
      8. ifup
      9. ifdown
      10. ip
      11. route
      12. ping
    3. CHAPTER 39 Basic Network Troubleshooting
      1. Manually and Automatically Configure Network Interfaces and Routing Tables to Include Adding, Starting, Stopping, Restarting, Deleting, or Reconfiguring Network Interfaces
      2. Change, View, or Configure the Routing Table and Correct an Improperly Set Default Route Manually
      3. ifconfig
      4. ip
      5. ifup
      6. ifdown
      7. route
      8. host
      9. hostname
      10. dig
      11. netstat
      12. ping
      13. ping6
      14. traceroute
      15. traceroute6
      16. tracepath
      17. tracepath6
      18. netcat
    4. CHAPTER 40 Configure Client-Side DNS
      1. Query Remote DNS Servers
      2. Configure local name resolution and use remote DNS servers
      3. Modify the Order in Which Name Resolution Is Done
      4. /etc/hosts
      5. /etc/resolv.conf
      6. /etc/nsswitch.conf
      7. host
      8. dig
      9. getent
  16. Part X: Security
    1. CHAPTER 41 Perform Security Administration Tasks
      1. Audit a System to Find Files with the suid/sgid Bit Set
      2. Set or Change User Passwords and Password-Aging Information
      3. Being Able to Use nmap and netstat to Discover Open Ports on a System
      4. Set Up Limits on User Logins, Processes, and Memory Usage
      5. Determine Which Users Have Logged in to the System or Are Currently Logged In
      6. Basic sudo Configuration and Usage
      7. find
      8. passwd
      9. fuser
      10. lsof
      11. nmap
      12. chage
      13. netstat
      14. sudo
      15. /etc/sudoers
      16. su
      17. usermod
      18. ulimit
      19. who, w, last
    2. CHAPTER 42 Set Up Host Security
      1. Awareness of Shadow Passwords and How They Work
      2. Turn Off Network Services Not in Use
      3. Understand the Role of TCP Wrappers
      4. /etc/nologin
      5. /etc/passwd
      6. /etc/shadow
      7. /etc/xinetd.d/
      8. /etc/xinetd.conf
      9. /etc/inetd.d/
      10. /etc/inetd.conf
      11. /etc/inittab
      12. /etc/init.d/
      13. /etc/hosts.allow
      14. /etc/hosts.deny
    3. CHAPTER 43 Securing Data with Encryption
      1. Perform Basic OpenSSH 2 Client Configuration and Usage
      2. Understand the Role of OpenSSH 2 Server Host Keys
      3. Perform Basic GnuPG Configuration, Usage, and Revocation
      4. Understand SSH Port Tunnels (Including X11 Tunnels)
      5. ssh
      6. ssh-keygen
      7. ssh-agent
      8. ssh-add
      9. ~/.ssh/id_rsa and id_rsa.pub
      10. ~/.ssh/id_dsa and id_dsa.pub
      11. /etc/ssh/ssh_host_rsa_key and ssh_host_rsa_key.pub
      12. /etc/ssh/ssh_host_dsa_key and ssh_host_dsa_key.pub
      13. ~/.ssh/authorized_keys
      14. ssh_known_hosts
      15. gpg
      16. ~/.gnupg/
  17. Appendix Create Your Own Journal
  18. Index
  19. Code Snippets