Linux Essentials Study Guide (Udemy)
Linux Essentials Study Guide (Udemy)
Introduction
● Welcome
o Five Domains
▪ The Linux Community and a Career in Open Source
▪ Finding Your Way on a Linux System
▪ The Power of the Command Line
▪ The Linux Operating System
▪ Security and File Permissions
https://www.DionTraining.com 1
Linux Essentials (Study Notes)
Evolution of Linux
• An Introduction to Linux
o Linux
▪ A family of open source Unix-like operating system, typically packaged
into a distribution
o Examples
▪ Ubuntu, Debian, Fedora
o Command Line Interface (CLI) or the terminal
o Why study Linux?
▪ Over 96% of web servers are run on Linux
▪ Low cost
▪ Open source
▪ Ease of scalability
• Linux Distributions
o Distribution or Distro
▪ Linux kernel
▪ Supporting software and libraries
▪ Configuration files
o Kernel
▪ A low-level computer program which functions as the bridge between the
user and the computer’s resources
o Different distributions have different scripts and utilities to launch programs
o Installation
▪ Image file on a CD
▪ USB flash drive
▪ Virtual server or cloud service
https://www.DionTraining.com 2
Linux Essentials (Study Notes)
• Embedded Systems
o Embedded System
▪ A controller with a dedicated function within a larger mechanical or
electrical system
o Example Applications
▪ Industrial automation
▪ Navigation equipment
▪ Medical devices
▪ Wearable technology
▪ Home appliances
o Examples
▪ Arduino
▪ Raspberry Pi
▪ Android
• Highly-scalable
• User-friendly
• Open source
• Free to use
• Hardware Requirements
o System requirements
▪ Prerequisites that are often used as a guide and not an absolute rule
https://www.DionTraining.com 3
Linux Essentials (Study Notes)
https://www.DionTraining.com 4
Linux Essentials (Study Notes)
https://www.DionTraining.com 5
Linux Essentials (Study Notes)
https://www.DionTraining.com 6
Linux Essentials (Study Notes)
https://www.DionTraining.com 7
Linux Essentials (Study Notes)
▪ Manual (man)
• Shows all information about a command being used
▪ Make directory (mkdir)
• Makes a new empty folder or directory inside the filesystem
▪ Remove directory (rmdir)
• Removes an empty, existing folder or directory
▪ Touch (touch)
• Makes a file using the command line
▪ Remove (rm)
• Removes files and directories
▪ Locate (locate)
• Finds a file within the system
▪ Clear (clear)
• Clears the screen or terminal environment
https://www.DionTraining.com 8
Linux Essentials (Study Notes)
• Variables
o Shell Script
▪ A file containing a series of commands
o Variables
▪ Areas of memory that can be used to store information and are referred
to by a name
▪ Act as a placeholder
o Naming rules
▪ Variable names must start with a letter
▪ A name must not contain embedded spaces (Underscores are used
instead)
▪ Punctuation marks are not allowed
https://www.DionTraining.com 9
Linux Essentials (Study Notes)
• Quoting
o Shell meta-characters
▪ Treated in a special way in the command line
o Examples of meta-characters
▪ Blank or space character ( “ “ )
• Tells a shell to use separate arguments between commands
• Any number of blanks or spaces are treated as one
▪ Dollar sign ( $ )
▪ Star ( * )
▪ Semi-colon ( ; )
▪ Rreater-than symbol ( > )
▪ Question mark ( ? )
▪ Ampersand ( & )
▪ Pipe ( | )
o Quoting
▪ The act of protecting shell meta-characters from being treated specially
by the shell
▪ Prevents the shell from acting on and expanding the meta-characters
▪ Done in double quotes ( “ “ ), single quotes ( ‘ ‘ ), or backslash ( \ )
▪ Backlashes can be used to quote or turn off a special character’s ability
https://www.DionTraining.com 10
Linux Essentials (Study Notes)
o Info Pages
▪ More detailed than man pages; divided into different nodes or pages and
works like a web browser
▪ Info <command>
▪ p for previous
▪ n for next
▪ q for exit
https://www.DionTraining.com 11
Linux Essentials (Study Notes)
https://www.DionTraining.com 12
Linux Essentials (Study Notes)
https://www.DionTraining.com 13
Linux Essentials (Study Notes)
▪ Relative
• Relative to the current directory
• Subdirectories
o . refers to “this” directory
o .. refers to the parent directory
• Subdirectory replaces the parent directory
• Example: ../dir2/afile.txt
• Creating Links
o Hard Link
▪ A duplicate directory entry where both entries point to the same file
▪ ln origname linkname
o Symbolic Link
▪ A file that refers to another file by name
▪ ln –s origname linkname
https://www.DionTraining.com 14
Linux Essentials (Study Notes)
▪ Bracketed value ( [ ] )
• Matches any character inside the bracket
• Example: b[ao][lw]l can match bowl, ball, etc., but not bull
o Careless usage of wildcards can lead to undesired consequences
o Case sensitivity is a function of the Linux filesystem and not the Linux operating
system itself
• Manipulating Directories
o Make Directory (mkdir)
▪ Creates a new directory
▪ Example: mkdir newfolder
o Remove Directory (rmdir)
▪ Deletes an empty directory
▪ Example: rmdir newfolder
▪ To delete a set of nested empty directories, -p can be used
• Example: rmdir -p newfolder
▪ To delete directories that contain files within a directory tree, use:
rm -r newfolder
o Remember that directory names are case sensitive
o Directories are just special files as far as the Linux filesystem is concerned
o Touch (touch)
▪ When used with a directory, it will only update the date/time stamp
o Copy (cp)
▪ Can be used to copy a directory if used with the -r or –a switches
o Move (mv)
▪ Can be used for directories or files
o Link (ln)
▪ ln –s can create symbolic links to a directory
▪ directories don’t have support but hard link, only symbolic links
https://www.DionTraining.com 15
Linux Essentials (Study Notes)
• Input/Output Redirection
o Redirect to an output file if you need to save it for future reference
o Redirect from an input file if you have a program that needs it
o A program’s output can be used as an input via the process of piping
o Xargs
▪ Enables a user to generate command line options from files or other
programs’ output
o Common redirector operations
▪ Greater than symbol ( > )
• Creates a new file containing standard output
▪ 2 Greater than symbols ( >> )
• Appends the existing output to an existing file
▪ The number 2 + Greater than symbol ( 2> )
• Creates a new file containing any standard errors
▪ The number 2 + 2 Greater then symbol ( 2>> )
• Appends standard error to an existing file
▪ Ampersand + Greater then symbol ( &> )
• Creates a new file that contains the standard output and the
standard error
▪ Less than symbol ( < )
• Sends the content of a specified file as input back into the
standard input
▪ 2 Less than symbols ( << )
• Accepts text on the following lines as standard input
▪ Less than + Greater than symbols ( <> )
• Specified file can be used for standard input and standard output
https://www.DionTraining.com 16
Linux Essentials (Study Notes)
o Standard Output
▪ Normal program messages
o Standard Error
▪ Any error messages
• Archiving Files
o File-Archiving Tool
▪ Collects a group of files into a single “package” file to easily move around
on a single system
o Common archiving commands
▪ Tar (Tape archiver)
https://www.DionTraining.com 17
Linux Essentials (Study Notes)
• Used to archive various data files into a single file (archive file)
while the original files remain on the disk
• Tarball
o Compressed archive file
▪ ZIP
• GZIP (.gz; .tgz for tarballs)
o gunzip
• BZIP2 (.bz2; .tbz, .tbz2, .tb2 for tarballs)
o bunzip2
• XZ (.xz; .txz for tarballs)
o unxz
https://www.DionTraining.com 18
Linux Essentials (Study Notes)
Scripting Basics
• Text Files and Text Editors
o Text Files
▪ Configuration files and shell scripts
o Text Editor
▪ Lets you edit documents that are stored in plain-text format
o File Types
▪ Human language files
▪ Programming language files
▪ Formatted text files
▪ Program and system configuration files
▪ Program log files
o Popular Text Editors
▪ vi
• very small and installed by default
• a little more difficult to use
▪ emacs
• big editor with a lot more features
• less likely to be installed by default on lightweight distributions
• also has a GUI version
▪ pico
• modeled after emacs
• more lightweight and better suited for lightweight distributions
• often installed by default
▪ nano
• clone of pico but has extra features
• much more lightweight than emacs
• commonly found in small and lightweight distributions
https://www.DionTraining.com 19
Linux Essentials (Study Notes)
▪ pico
▪ nano
• Commands
o Most commands entered into a shell prompt are external commands
o The ampersand (&) lets users run many programs simultaneously
o Commonly-used Commands
▪ ls, mv, cp, rm
▪ Grep
• Locates files containing specific strings and display them into a file
or screen
▪ Find
• Locates files by filenames, ownerships, and other permissions at
the filesystem level
▪ Cut
• Extracts text from a field within a file
▪ Echo
• Displays something as a message to the user in the command line
terminal
• Arguments
o Values of variables can be:
▪ Passed as parameters to a script
▪ Generated internally to a script
▪ Extracted from a script’s environment
o Arguments
▪ Variables that are passed to the script. These are also called parameters
▪ Represented in the script as a dollar sign ( $ ) followed by a number from
0 onwards
▪ Examples: $0, $1, $2
• Variables
o Common Commands
▪ Hostname
• Shows the current hostname where the command is being run on
▪ Date
• Gives the current date and time
▪ Uptime
• Total time the computer has been up and running
https://www.DionTraining.com 20
Linux Essentials (Study Notes)
▪ df
• Shows the free disk space
• Conditional Expressions
o Conditional Expressions
▪ Enable a script to perform one of several actions relying on a particular
condition or value of a variable
▪ Example: if [-f file], if [-s file]
o Conditionals may be combined together with the logical and ( && ) or logical or
( || ) operators
o You can nest several if / then /else clauses
• Exit Value
o A script’s return value is the same as the last command the script called
o Exit
▪ Causes immediate termination of the script
https://www.DionTraining.com 21
Linux Essentials (Study Notes)
• Process Hierarchy
o Init Process
▪ Responsible for starting up all basic programs that Linux needs to run
▪ Children
• Program launched by init
▪ Parent
• Process that launched a program
https://www.DionTraining.com 22
Linux Essentials (Study Notes)
o Process ID (PID)
o Parent Process ID (PPID)
• Log Files
o Daemons
▪ Programs that run in the background
o Log Files
▪ Serve as a record or notes
▪ Mostly stored in /var/log
o Common Log Files
▪ boot.log
• Summary of services that started up late in the boot process
through the csv startup scripts
▪ cups/
• Related to Linux printing system
▪ gdm/
• Related to the gnome display manager or gdm environment
• Handles graphical-based user logins
https://www.DionTraining.com 23
Linux Essentials (Study Notes)
▪ messages or syslog
• General purpose log file containing messages from many different
daemons that don’t have dedicated log files
▪ Secure
• Security-related messages
▪ Xorg.0.log
• Info about the most recent startup of an X windows system
o Log files are frequently rotated
o Log files are mostly plaintext files
o Syslog/Syslogd
▪ General standard for logging system and program messages
o Klog/Klogd
▪ Handles logging messages from the kernel separately from ordinary
programs
o System Messaging
▪ A technique wherein a log daemon accepts messages from other
processes
https://www.DionTraining.com 24
Linux Essentials (Study Notes)
Networking Basics
• Network Features
o Common Networking Terms and Definitions
▪ Domain Name System (DNS)
• Global network of servers that translates between hostnames and
IP addresses
• “Internet phonebook”
▪ Dynamic Host Configuration Protocol (DHCP)
• A way for computers on a network to be able to obtain
configuration information from another computer on the network
▪ Ethernet
• Wired network hardware used by most computers today
▪ Hostname
• The name of a computer that is easier to read and remember
▪ Internet
• Globe-spanning network of interconnected computers that we
use TCP-IP to communicate over
▪ Internet Protocol (IP) Address
• A number assigned to computer for network addressing purposes
• “Phone number” for a computer
• IPv4, IPv6
▪ Network Mask (Netmask)
• Distinguishes between the network and the machine portions of
an IP address
▪ Router
• A device that connects two or more networks together
• Serves as a gateway between these two networks
▪ Transmission Control Protocol-Internet Protocol (TCP-IP)
• A set of standards that underly most modern network
connections at the software level
• Backbone of the Internet
▪ Wi-Fi
• Common name for wireless networking IEEE 802.11 standard
o Four Things Needed for a Valid Internet Connection
▪ IP Address
▪ Netmask
▪ Router’s IP Address
▪ DNS Server’s IP Address
https://www.DionTraining.com 25
Linux Essentials (Study Notes)
• Configuring a Connection
o Automatic configuration is handled via DHCP
o Fixed DHCP
▪ Each computer receives the exact same IP address every time it boots up
o Dynamic DHCP
▪ A computer receives possibly different IP addresses from the DHCP server
every time it connects
o Establishing a Wi-Fi connection is easiest using the GUI method
o Wireless Configuration Tools
▪ iwlist
• Can identify nearby wireless networks
▪ iwconfig
• Can connect to and disconnect from specific wireless networks
o Wired Configuration Tools
▪ ifconfig
• Brings up or shut down a specific network connection and
associate a netmask to a particular piece of network hardware
such as a network adapter
▪ route
• Adjusts the computer’s routing table
▪ /etc/resolv.conf
• Configuration file that contains the IP addresses of up to 3 DNS
servers
▪ DHCP client
• Can configure a network connection automatically
• Example: dhclient, dhcpcd
▪ Distribution-Specific Network Scripts
• Network Testing
o Common Network Connectivity Tests
▪ Routing table
▪ PING
• If you can ping your local systems but not your remote systems,
you must be having a router problem
• If you can ping the IP address but not the name of the device, you
must be having a DNS problem
• If you cannot ping at all, you must be having a fundamental
configuration problem
▪ Traceroute
• Tests the connectivity for breaks
https://www.DionTraining.com 26
Linux Essentials (Study Notes)
• Network Protection
o Basic Tips
▪ Shut down unused servers
▪ Enable a firewall
▪ Use good passwords
▪ Be suspicious
▪ Keep your software up-to-date
https://www.DionTraining.com 27
Linux Essentials (Study Notes)
• Account Security
o Passwords today are stored in /etc/shadow
o Salted hash
▪ Uses a one-way mathematical process with additional random input to
produce a non-readable password
o Username
o Password
▪ Stored as a salted hash
o Last password change
o Days until a change is allowed
o Days before a change is required
o Days of warning before password expiration
o Days between expiration and deactivation
o Expiration date
https://www.DionTraining.com 28
Linux Essentials (Study Notes)
o Special flag
• Understanding Groups
o Groups
▪ Collections of accounts that are defined in the /etc/group file
o Group name
o Password
o GID
o User list
o Group membership
▪ By specifying the group’s GID in users’ individual /etc/passwd entries
▪ By specifying usernames in the user list in the /etc/group file
• Working as Root
o Root
▪ Also called superuser or administrator
▪ Has access to system files
o Root user privilege
▪ Log in as root user
▪ Use the switch user (su) command
▪ Use the sudo command
https://www.DionTraining.com 29
Linux Essentials (Study Notes)
https://www.DionTraining.com 30
Linux Essentials (Study Notes)
• Understanding Permissions
o Permissions
▪ Shows the file permissions
o Number of links
▪ Shows the number of unique file names that may be used to access a file
o Username
▪ Identifies the file’s owner
o Group name
▪ Identifies the group that owns a file
o File size
o Time stamp
▪ Tells when a file was last modified
o Filename
o Permission string
▪ File Type Code
https://www.DionTraining.com 31
Linux Essentials (Study Notes)
• This type character represents the file’s type and is often omitted
from descriptions when the file type is not relevant
o Normal data file ( - )
o Directory disk ( d )
o Symbolic link ( | )
o Named pipe ( p )
o Socket ( s )
o Block device ( b )
o Character device ( c )
▪ Owner Permissions
• Determine what the file’s owner can do with the file
▪ Group Permissions
• Determine what members of the file’s group who are not its
owner can do with the file
▪ World or Other Permissions
• Determine what users who are not the file’s owner or members of
its group can do with the file
https://www.DionTraining.com 32
Linux Essentials (Study Notes)
o Special Cases
▪ Directory execute bit
• Grants permission to search the directory
▪ Directory write permission
• Allows a user to create, delete, rename files within a directory,
even if the user does not own the file
▪ Symbolic link
• Permissions on symbolic links are always 777
▪ Root user
• Many of the permission rules don’t apply to root
o User Mask (Umask)
▪ Determines the default permissions for new files
https://www.DionTraining.com 33
Linux Essentials (Study Notes)
https://www.DionTraining.com 34
Linux Essentials (Study Notes)
Conclusion
• Conclusion
o Five Domains
▪ The Linux Community and a Career in Open Source
▪ Finding Your Way on a Linux System
▪ The Power of the Command Line
▪ The Linux Operating System
▪ Security and File Permissions
o Take the two practice exams that are included in this course
o You can take the exam at any Pearson Vue authorized testing center
▪ Vouchers are available on the Pearson Vue website
(www.pearsonvue.com), OR
▪ You can purchase them from the Dion Training website
(www.diontraining.com) for a 10% discount
https://www.DionTraining.com 35
Linux Essentials (Study Notes)
o Keep studying, take the two practice exams that are included in this course,
and…
https://www.DionTraining.com 36
Linux Essentials (Study Notes)
https://www.DionTraining.com 37









