Podcast
Questions and Answers
Which of the following are benefits of open source software for the user? (Select all that apply)
Which of the following are benefits of open source software for the user? (Select all that apply)
What is the purpose of the /etc/passwd
file?
What is the purpose of the /etc/passwd
file?
The /etc/passwd
file stores information about local users in a system, including their usernames, user IDs, group IDs, home directories, and default login shells.
What is the default shell in Red Hat Enterprise Linux?
What is the default shell in Red Hat Enterprise Linux?
The mkdir
command creates directories, while the cp
command copies files.
The mkdir
command creates directories, while the cp
command copies files.
Signup and view all the answers
What does the ls -l
command do?
What does the ls -l
command do?
Signup and view all the answers
What is the purpose of the pwd
command?
What is the purpose of the pwd
command?
Signup and view all the answers
What is the difference between a symbolic link and a hard link?
What is the difference between a symbolic link and a hard link?
Signup and view all the answers
The rm
command by default, can only remove files and not directories.
The rm
command by default, can only remove files and not directories.
Signup and view all the answers
What is the difference between su
and sudo
?
What is the difference between su
and sudo
?
Signup and view all the answers
What is the purpose of the history
command?
What is the purpose of the history
command?
Signup and view all the answers
What are shell variables used for?
What are shell variables used for?
Signup and view all the answers
What is the primary difference between the useradd
and usermod
commands?
What is the primary difference between the useradd
and usermod
commands?
Signup and view all the answers
What is the difference between the groupadd
and groupmod
commands?
What is the difference between the groupadd
and groupmod
commands?
Signup and view all the answers
A user can belong to both primary and supplementary groups.
A user can belong to both primary and supplementary groups.
Signup and view all the answers
What is the purpose of password aging?
What is the purpose of password aging?
Signup and view all the answers
The chage
command is used to manage password aging policies for local user accounts.
The chage
command is used to manage password aging policies for local user accounts.
Signup and view all the answers
What is the purpose of the usermod -L
command?
What is the purpose of the usermod -L
command?
Signup and view all the answers
The /sbin/nologin
shell is a special shell that prevents a user from logging in interactively.
The /sbin/nologin
shell is a special shell that prevents a user from logging in interactively.
Signup and view all the answers
What are the three main categories of user accounts?
What are the three main categories of user accounts?
Signup and view all the answers
The sudo
command allows users to execute commands as root without fully switching to the root user account.
The sudo
command allows users to execute commands as root without fully switching to the root user account.
Signup and view all the answers
What is the main purpose of the /etc/sudoers
file?
What is the main purpose of the /etc/sudoers
file?
Signup and view all the answers
What is the purpose of the PATH
environment variable?
What is the purpose of the PATH
environment variable?
Signup and view all the answers
The tee
command is used for copying command output to both the terminal and a file.
The tee
command is used for copying command output to both the terminal and a file.
Signup and view all the answers
When using the sudo
command, the user's PATH environment is modified to include the root user's PATH.
When using the sudo
command, the user's PATH environment is modified to include the root user's PATH.
Signup and view all the answers
Flashcards
What is Linux?
What is Linux?
A free and open-source operating system known for its flexibility, security, and collaborative development. It powers a wide range of devices and systems.
What is a Linux distribution?
What is a Linux distribution?
A distribution of Linux is a complete operating system that includes the Linux kernel, user programs, libraries, and management tools. It's packaged and ready to install.
What is Open Source Software?
What is Open Source Software?
Code with publicly accessible source code, allowing for study, modification, and sharing. It promotes collaboration, transparency, and cost-effectiveness.
What is a Permissive license?
What is a Permissive license?
Signup and view all the flashcards
What is a Copyleft license?
What is a Copyleft license?
Signup and view all the flashcards
What is Red Hat?
What is Red Hat?
Signup and view all the flashcards
What is Fedora?
What is Fedora?
Signup and view all the flashcards
What is Red Hat Enterprise Linux (RHEL)?
What is Red Hat Enterprise Linux (RHEL)?
Signup and view all the flashcards
What is CentOS Stream?
What is CentOS Stream?
Signup and view all the flashcards
What is RHEL for Edge?
What is RHEL for Edge?
Signup and view all the flashcards
What is Red Hat CoreOS (RHCOS)?
What is Red Hat CoreOS (RHCOS)?
Signup and view all the flashcards
What is Red Hat Universal Base Image (UBI)?
What is Red Hat Universal Base Image (UBI)?
Signup and view all the flashcards
What is a Command Line Interface (CLI)?
What is a Command Line Interface (CLI)?
Signup and view all the flashcards
What is a Shell?
What is a Shell?
Signup and view all the flashcards
What is a Prompt?
What is a Prompt?
Signup and view all the flashcards
What is a Terminal?
What is a Terminal?
Signup and view all the flashcards
What is the structure of a command?
What is the structure of a command?
Signup and view all the flashcards
What is a Physical Console?
What is a Physical Console?
Signup and view all the flashcards
What is a Virtual Console?
What is a Virtual Console?
Signup and view all the flashcards
What is a Graphical Environment?
What is a Graphical Environment?
Signup and view all the flashcards
What is Secure Shell (SSH)?
What is Secure Shell (SSH)?
Signup and view all the flashcards
What is Public Key Authentication?
What is Public Key Authentication?
Signup and view all the flashcards
What is a File System?
What is a File System?
Signup and view all the flashcards
What is the Root Directory (/)?
What is the Root Directory (/)?
Signup and view all the flashcards
What is a Path?
What is a Path?
Signup and view all the flashcards
What is an Absolute Path?
What is an Absolute Path?
Signup and view all the flashcards
What is a Relative Path?
What is a Relative Path?
Signup and view all the flashcards
What is the touch command?
What is the touch command?
Signup and view all the flashcards
What is the ls command?
What is the ls command?
Signup and view all the flashcards
What is the cd command?
What is the cd command?
Signup and view all the flashcards
What are File Permissions?
What are File Permissions?
Signup and view all the flashcards
What is the mkdir command?
What is the mkdir command?
Signup and view all the flashcards
What is the cp command?
What is the cp command?
Signup and view all the flashcards
What is the mv command?
What is the mv command?
Signup and view all the flashcards
What is the rm command?
What is the rm command?
Signup and view all the flashcards
What is a Hard Link?
What is a Hard Link?
Signup and view all the flashcards
What is a Symbolic Link?
What is a Symbolic Link?
Signup and view all the flashcards
What is Pathname Expansion?
What is Pathname Expansion?
Signup and view all the flashcards
What is Tilde Expansion (~)?
What is Tilde Expansion (~)?
Signup and view all the flashcards
What is Brace Expansion {}?
What is Brace Expansion {}?
Signup and view all the flashcards
What is Variable Expansion?
What is Variable Expansion?
Signup and view all the flashcards
What is Command Substitution?
What is Command Substitution?
Signup and view all the flashcards
How can you protect arguments from expansion?
How can you protect arguments from expansion?
Signup and view all the flashcards
What are Manual Pages (man Pages)?
What are Manual Pages (man Pages)?
Signup and view all the flashcards
Vim
Vim
Signup and view all the flashcards
Study Notes
Linux System Administration
- Linux is a free and open-source operating system known for its flexibility, security, and collaborative development
- It powers many devices and systems worldwide, configurable from a full graphical desktop to a small appliance
- Learning Linux can boost career opportunities and tech skills, useful in internet infrastructure, cloud computing, supercomputers, and mobile apps
What Makes Linux Great ?
- Open source: Anyone can view, modify and share the code, leading to rapid innovation and transparency
- Powerful CLI (command-line interface): Efficient automation and system administration, easy access and powerful scripting.
- Modular and flexible: Easy customization and upgrades (easily replace or remove components) Components can be upgraded when needed
Linux Distributions
- A complete operating system built on the Linux kernel, offering a user-friendly experience with pre-installed software and tools
- Constructed from a Linux kernel that supports user programs and libraries.
- Key points about Linux distributions: Open-source construction, pre-packaged convenience, variety of choices catered to different needs, essential characteristics (Linux kernel, user programs, installation and update tools, and vendor/community support)
Red Hat
- A leading provider of open-source solutions including Red Hat Enterprise Linux, JBoss middleware, and cloud technologies.
- Facilitates customers' connection to the open-source community and effective use of open-source software.
Fedora
- Community-driven Linux distribution known for fast-paced innovation and cutting-edge features.
Red Hat Enterprise Linux (RHEL)
- Commercially supported Linux distribution, leading platform for open source computing.
- Major releases derived from the CentOS Stream project (derived from Fedora)
RHEL for Edge
- An image-based variant of RHEL designed with different deployment mechanism, using Image Builder
- Efficient, customizable, and suitable for various environments.
- Secure management, zero-touch provisioning, and system health visibility are important features
Red Hat CoreOS (RHCOS)
- Developed from RHEL components, not a stand-alone operating system.
- Supports cloud-native applications, utilizing the CRI-O compliant container engine
Red Hat Universal Base Image (UBI)
- A freely redistributable derivative of RHEL.
- Serves as a base for cloud-native and web application development within the containers
Command Line Interface (CLI)
- A text-based interface for interacting with a computer system using commands
- The shell is the main program that provides the CLI
- Red Hat Enterprise Linux uses the Bash shell as default
Logging In
- A text-based interface for interacting with the computer system using commands.
- Locally: Physical Console (keyboard and display), Virtual Consoles (Ctrl+Alt+F1-F6)
- Remotely: Secure Shell (SSH).
- Public Key Authentication: Passwordless login using a private (users local machine) and public key (stored on the remote server).
Logging Out
- exit command
- Ctrl+D
Commands Summary
usermod -L user01
: Locks password of user01ssh username@remotehost
: Logs in to a remote host via SSHssh -i private_key_file username@remotehost
: Logs in via public key authenticationchmod 600 private_key_file
: Sets file permissions on a private key fileexit
: Logs out of the current shell session
Viewing File Contents
- cat: views entire file contents, concantenates files, or redirects to output.
- less: displays one page at a time, allowing scrolling.
- head: displays the first 10 lines by default or a specified amount.
- tail: displays the last 3 lines by default or a specified amount.
- wc: counts lines, words, and characters in a file
Command Syntax
- Command, options (- or --), arguments separated by spaces
- Use semicolon (;) to separate multiple commands on a single line
Examples of Simple Commands
- date displays date and time.
- date + %R displays time in 24 hour format
- date + %x displays date in MM/DD/YYYY format
- passwd changes user password
File system hierarchy
- Linux uses an inverted tree structure for file organization
- The / character separates directories in file paths
Locating Files by Name
- Paths: Specify file system location.
- Absolute Paths: Start with a / (e.g., /home/user/documents).
- Relative Paths: Do not start with a / (e.g., documents/file).
- pwd: displays current directory.
- ls: lists directory contents. (
ls -a
displays all files, including hidden files).ls -l
gives a detailed listing.
Directory Purposes
- /boot : System startup files, like the boot loader and kernel
- /dev : Special files for hardware interactions (disks, USB drives etc.)
- /etc : System configuration files
- /home : Home directories for users
- /root : The root user's home directory
- /run: Temporary runtime data for processes
- /tmp: Temporary storage space for files
- /var: Files that change often, such as log files and mail
- /bin : Essential command-line programs
- /var : Variable data, such as logs, mail, and print queues.
- /usr : Software applications and utilities.
Copy Files and Directories (cp)
- Copies files or directories.
- cp command by default ignores directories
cp -r
copies directories and their contents ensuring preserving original names.- Overwrites existing files if the destination file already exists
- multiple files can be copied to a target directory by specifying the target directory as the last argument
Move Files and Directories (mv)
- Moves files or directories
mv
can be used for renaming and moving.
Remove Files and Directories (rm)
- Removes files or directories.
rm -r
is needed for recursively removing directories and contents-i
option prompts for confirmation-rf
option forces removal without prompting.
Make links / Create Symbolic and hard Links
-
Create multiple file names that point to the same file. The file names are called links.
-
The file names are called hard or symbolic links
-
Hard links share the same metadata, and any modification to one hard link will affect all the others.
-
Symbolic links are essentially shortcuts, the target file can reside in a different location.
Command History
history
: (Displays previously executed commands as a numbered list.)![number]
: Executes the command identified by that number. (e.g.,!26
to re-execute the 26th command)!string
: Executes the most recent command starting with a particular string
Editing the Command Line
Ctrl+A
: Moves to beginning of line.Ctrl+E
: Moves to the end of a line.Ctrl+U
: Clears text before the cursorCtrl+K
: Clears text after the cursor.Ctrl+LeftArrow
: Moves to the beginning of the previous word.Ctrl+RightArrow
: Moves to the end of the next word.Ctrl +R
: Searches through the command history.
Tab Completion
- Pressing Tab once will complete the command or filename as much as possible. Pressing Tab twice lists all the possible completions.
Man pages
- A built-in documentation resource for Linux commands, files, and concepts.
- Using 'man command_name' to display relevant documentation.
- Man pages are stored in the
/usr/share/man
directory. The section number in the documentation identifies which page. (e.g. man 5 passwd )
Managing Local Users and Groups
-
User Management: Create, modify, delete users, including root (superuser)
-
Group Management: Create, modify, delete groups
-
Password Management: Set/change user passwords using the "passwd" command
-
Access Control: Managing file and device permissions, including restricting access and switching between accounts.
-
Switching Users (su, sudo): Switching to other users or the root account.
Studying That Suits You
Use AI to generate personalized quizzes and flashcards to suit your learning preferences.
Related Documents
Description
Explore the fundamental aspects of Linux System Administration. This quiz covers the benefits of using Linux, its open-source nature, and various distributions that enhance the user experience. Discover how mastering Linux can open up numerous career opportunities in technology.