Linux Quick Reference Guide (6Th Ed.)
Total Page:16
File Type:pdf, Size:1020Kb
Linux Quick Reference Guide 6th edition August 2018 Foreword This guide stems from the notes I have been taking both while working as a Linux sysadmin and while preparing the certification exams LPIC-1 (Linux Professional Institute Certification level 1), LPIC-2, RHCSA (Red Hat Certified System Administrator), and RHCE (Red Hat Certified Engineer). It contains a good amount of topics for these certification exams, with some subjects handled in more details than others, plus other useful information about standards and tools for Linux system administration. Unless otherwise specified, shell commands and operations refer to Bash. This is an independent publication and is not affiliated with, authorized by, sponsored by, or otherwise approved by LPI or Red Hat. You can freely use and share this whole guide or the single pages, both in electronic or in printed form, provided that you distribute them unmodified and not for profit. Happy Linux hacking, Daniele Raffo Version history 1st edition May 2013 2nd edition September 2014 3rd edition July 2015 4th edition June 2016 5th edition September 2017 6th edition August 2018 Bibliography and suggested readings ● Evi Nemeth et al., UNIX and Linux System Administration Handbook, O'Reilly ● Rebecca Thomas et al., Advanced Programmer's Guide to Unix System V, McGraw-Hill ● Mendel Cooper, Advanced Bash-Scripting Guide, http://tldp.org/LDP/abs/html ● Adam Haeder et al., LPI Linux Certification in a Nutshell, O'Reilly ● Heinrich W. Klöpping et al., The LPIC-2 Exam Prep, http://lpic2.unix.nl ● Michael Jang, RHCSA/RHCE Red Hat Linux Certification Study Guide, McGraw-Hill ● Asghar Ghori, RHCSA & RHCE RHEL 7: Training and Exam Preparation Guide, Lightning Source Inc. ● Colin Barschel, Unix Toolbox, http://cb.vu/unixtoolbox.xhtml ● Ellen Siever et al., Linux in a Nutshell, O'Reilly, http://archive.oreilly.com/linux/cmd ● Christoph Braun, Unix System Security Essentials, Addison-Wesley ● Bruce Barnett, The Grymoire, http://www.grymoire.com/Unix ● Brendan Gregg, Linux performance, http://www.brendangregg.com/linuxperf.html ● RHEL manuals, https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux ● A-Z index of Bash command line, http://ss64.com/bash ● GNU software manuals, http://www.gnu.org/manual ● Shell command line snippets, http://www.commandlinefu.com ● Bash command line snippets, http://www.bashoneliners.com ● RAM management in Linux, http://www.linuxatemyram.com ● Regular expressions tester, http://www.regextester.com ● Bash pitfalls, http://mywiki.wooledge.org/BashPitfalls ● Linux man pages, https://www.kernel.org/doc/man-pages ● CentOS 7 man pages, https://www.unix.com/man-page-centos-repository.php Index LVM................................................1 SQL SELECT..................................57 iptables rules...............................113 LVM commands................................2 SQL JOIN......................................58 iptables NAT routing......................114 System boot....................................3 MySQL..........................................59 firewalld......................................115 SysV startup sequence.....................4 MySQL tools..................................60 firewalld rules..............................116 Login..............................................5 MySQL syntax................................61 SSH............................................117 Runlevels........................................6 MySQL status................................62 SSH operations............................118 SysV vs Systemd.............................7 MySQL recipes...............................63 SSH configuration.........................119 /etc/inittab......................................8 MySQL operations..........................64 OpenSSL.....................................120 Filesystem Hierarchy Standard...........9 PostgreSQL...................................65 CA.pl..........................................121 Partitions......................................10 X..................................................66 GnuPG........................................122 mount..........................................11 X tools..........................................67 OpenVPN.....................................123 Filesystem types............................12 X keysim codes..............................68 Key bindings - terminal.................124 Swap............................................13 /etc/passwd...................................69 Key bindings - X...........................125 /etc/fstab......................................14 User management..........................70 udev...........................................126 Filesystem operations.....................15 UID and GID..................................71 Kernel.........................................127 Filesystem maintenance..................16 su and sudo...................................72 Kernel management......................128 XFS, ReiserFS, CD-ROM fs...............17 Terminals......................................73 Kernel compile and patching..........129 AutoFS..........................................18 Messaging.....................................74 Kernel modules............................130 RAID............................................19 cron.............................................75 /proc..........................................131 Bootloader....................................20 at.................................................76 System recovery..........................132 GRUB 2 configuration......................21 Utilities.........................................77 DNS............................................133 GRUB 2 usage................................22 Localization...................................78 DNS configuration.........................134 GRUB Legacy.................................23 System time..................................79 DNS zone file...............................135 Low-level package managers...........24 syslog...........................................80 Apache........................................136 High-level package managers..........25 E-mail...........................................81 Apache configuration....................137 Package management tools.............26 SMTP............................................82 Apache virtual hosts.....................138 Backup.........................................27 Sendmail.......................................83 Apache directory protection...........139 Archive formats..............................28 Exim.............................................84 Apache SSL/TLS...........................140 Documentation..............................29 Postfix..........................................85 Apache proxy...............................141 Shell basics...................................30 Postfix configuration.......................86 Tomcat........................................142 Text filters.....................................31 Procmail........................................87 Samba server..............................143 Advanced text filters.......................32 Courier POP configuration................88 Samba client................................144 Regular expressions........................33 Courier IMAP configuration..............89 Samba global configuration............145 File management...........................34 Dovecot........................................90 Samba share configuration............146 Directory management...................35 Dovecot mailbox configuration.........91 Samba access configuration...........147 I/O streams...................................36 Dovecot POP and IMAP configuration.92 Samba setup...............................148 read and echo................................37 Dovecot authentication...................93 NFS............................................149 Processes......................................38 FTP..............................................94 /etc/exports.................................150 Signals.........................................39 vsftpd...........................................95 NFS setup....................................151 Resource monitoring.......................40 CUPS............................................96 iSCSI..........................................152 vmstat and free.............................41 IP addressing.................................97 iSCSI setup.................................153 File permissions.............................42 Subnetting....................................98 DHCP..........................................154 File attributes................................43 Network services............................99 PAM............................................155 ACLs.............................................44 Network configuration commands...100 LDAP..........................................156 Links............................................45 Wireless networking......................101 OpenLDAP...................................157 Find system files............................46 Network tools...............................102 SELinux.......................................158 Shell variables...............................47 Network monitoring......................103 AVC............................................159 Shell operations.............................48 Packet sniffing..............................104 KVM............................................160 Shell scripting................................49