1/111
Modules 4-8
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai |
|---|
No analytics yet
Send a link to your students to track their progress
What is the purpose of the /etc/shadow file in Linux?
has 9 fields to store encrypted passwords and other password related information.
what is the purpose of the chage command?
to manage and modify the aging properties of user accounts, specifically passwords.
What does the passwd command do?
it prompts you to make a new password for a user account.
what does the useradd command do?
adds a user account
useradd -c
useradd: adds a comment when adding a user.
useradd -aG
specifies the secondary group that will be on the user account. does not remove the secondary group already applied to the account.
useradd -g
useradd: specifies the initial group that will be used on the user account.
useradd -e
useradd: specifies the date that will disable a specific user account.
useradd -p
useradd: specifies a password for a user account.
what is the purpose of the /etc/gshadow file?
Stores hashed group passwords.
What is the purpose of the /etc/group file in Linux?
to define the groups to which a user belongs to.
What happens when you delete a user account?
You remove the user’s ability to login, revokes access to the system, and removes their associated user-to-group connections. Other things have to be deleted manually.
userdel -r
userdel: removes the user account, as well as the home directory.
userdel -f
userdel: Forces the deletion of the user account and everything in it.
What are two examples of Command-Line text editors?
VIM and Nano
What Vim mode does NOT allow you to type text into the file?
Command
What Vim mode allows you to type text into the text file?
Insert
How do you enter the Vim insert mode?
“I” key
How do you exit Insert mode and re-enter Command mode in the Vim editor?
“esc” key
How do you save your work in the Vim editor?
“w” key then enter
How do you quit the Vim editor?
in command mode, type “Shift” + “;”
How do you Save & Quit the vim editor?
In command mode, type “:wq”.
How do you force quit Vim?
Enter command mode, and type "q!”.
How do you delete a line in Vim?
In Vim, type “dd”
What does “>” do?
It overwrites an existing file or creates a new file.
What does “>>” do?
It adds/appends to an existing file.
What does “<“ do?
Tells the shell to take input for a program or a command from a file instead of the keyboard.
What does “|” (Pipe) do?
is used to pipe the output of one command so it becomes the input for another command.
What does the grep command do?
It examines each line of data it receives and outputs every line that contains patterns.
What does the uniq command do?
sorts data, as well as removes duplicate lines.
grep -i
grep: Ignores case sensitivity during a search.
grep -r or grep -R
grep: recursively search files in directories.
grep ‘^example’ output.txt
Searches for patterns at the beginning of the line.
grep ‘example$’ output.txt
Searches for patterns at the end of a line.
What is the syntax of the Join command?
[options] file1.txt file2.txt
What does the Head command do?
Outputs the first few lines of its input. Useful for getting the header of a file.
what does the tail command do?
Outputs the last few lines of its input. Useful for getting the most recent entries of a file.
what does the diff command do?
Analyzes two files and prints the lines that are different.
diff -q
diff: reports only when files differ.
diff -c
diff: outputs number of lines of copied context. Default is 3.
What does the comm command do?
compares sorted files line-by-line. Produces three column output.
comm -1
suppress column 1 (lines unique to file1)
comm -2
suppress column 2 (lines unique to file2)
What does the sort command do?
Will rearrange the lines in a text file so that they are sorted numerically and alphabetically.
sort -d
sort: Consider only blanks and alphanumeric characters.
sort -f
Sort: Ignores case sensitivity
sort -m
sort: Merges two or more input files into one sorted input.
What does the cut command do?
print selected parts of lines from a file to standard output.
cut -d
Cut: use character DELIM instead of a tab for the field delimiter.
cut -f
cut: select only these fields on each line, also prints any line that does not contain a delimiter.
cut -c
Cut: Select only the characters from each line as specified in a list of characters.
What does the paste command do?
Displays the corresponding lines of multiple files side-by-side.
What is the Syntax for the paste command?
[OPTION(s)] [FILE(s)]
paste -d
paste: Uses character DELIMITER instead of a tab.
paste -s
paste: Pastes one file at a time instead of parallel.
What does the ifconfig command do?
Used to configure and/or view the configuration of a network interface.
ifconfig -a
Displays all network interfaces on the system, including ones that are inactive.
What is the syntax for the ifconfig command?
command [Interface] [options]
how would you disable an interface using the ifconfig command
ifconfig int down
How would you enable an interface using the ifconfig command?
ifconfig int up
what is the use of the /etc/hosts file in Linux?
to map IP Addresses to hostnames or domain names.
rlogin
A legacy command-line utility in Unix-like systems that allows users to log in to a remote host over a network, using TCP port 513.
SSH
A network protocol that provides a secure way to log into and manage remote systems.
Telnet
Used for remote access, network troubleshooting, and port checking.
scp
A utility for securely copying files and directories between a remote host and a local host using SSH.
ftp
Connects a computer system to a remote server using the FTP protocol. When connected, it allows for file transfer.
What does the groupadd command do?
It adds a group.
what is the purpose of the /etc/passwd file?
It stores user account information.
What does the cron command do?
It is used for scheduling automated tasks.
What is the syntax of the crontab command?
[minute] [hour] [date of month] [month] [day of week] command
crontab -e
Used to edit your crontab file.
What does the crontab input 30 1 * * * /usr/local/bin/backupdb do?
It schedules a database backup to run daily at 1:30 AM.
What is a package manager?
Allows the installation, upgrading, and removal of software on Linux systems.
Package Manager Consistency
Ensures all libraries and packages are installed, preventing software conflicts.
Package Manager Security
Regular updates through package managers help secure systems against vulnerabilities.
Package Manager Efficiency
Disk Space and system resources are managed by installing only necessary packages and removing outdated software.
Package Manager Automation
Can be scripted and automated, facilitating consistent configurations across multiple systems.
What package manager do debian based systems use?
Advanced Package Tool (apt)
What package manager do Red hat based systems use?
Dandified yum (dnf)
What is a Linux Repository?
A central storage location for software-packages.
how do you update packages in Fedora?
sudo dnf update package-name
how do you install packages in Fedora?
sudo dnf install package name
What is the purpose of the tar command?
Mostly used to combine files or directory structures into a single archive file.
What is the name for an archive file made with the tar command?
Tarball
What is the syntax for the tar command?
[-options] <name of the tar archive> [files or directories]
tar -c
tar: creates a new archive.
tar -x
tar: extracts files from archive
tar -t
tar: Shows a list of files within the archive
tar -v
tar: verbose (show a list of processed files)
tar -f
tar: specifies the archive’s name
What is the purpose of the dump command?
Can backup a file system to a tape or another disk.
What types of backups does the dump command allow for?
Full, Differential, and Incremental.
Full Backup
Copies all selected data, providing a complete snapshot at a specific point in time.
Incremental Backup
Saves only the data that has changed since the last backup of any type.
Differential Backup
Saves all data changed since the last full backup.
What is the syntax for the dump command?
[options] <filesystem>
dump -0
specifies a full backup.
dump -1 (all the way to) -9
Specifies an incremental backup.
dump -f
dump: Specify the output file or device.
What is the purpose of the "rsync” command?
Allows for fast and efficient file transferring and synchronization between directories and systems.