RHEL9 EX200 Flashcards
Command to copy files
cp
Command to remove a directory
rmdir
Command to create a directory
mkdir
Command to show a directory structure and files it contains
tree
Command to show the contents of a text file
cat
Command to match the contents of output with provided text
grep
Command to query & view logs from the systemd journal
journalctl
Command used to switch to another user account in the terminal.
su
Command used to execute commands with elevated privileges
sudo
Command used to add user
useradd
Command used to add a group
groupadd
Command used to determine who is logged in
whoami
Command used to display the user and group information for a specified user or the current user
id
File location to see user information such as home path and ID number
/etc/passwd
File location to see encrypted password of users and the details about when last set, expiration, etc.
/etc/shadow
File location to see group information
/etc/group
Command used to show the manual
man
Option on commands to show available options
--help
Path to where system documentation is located
/usr/share/doc
Command to show you where the command you specify is located
where
Command to search files and directories
find
What are the 2 text editors typically used
vi
vim
Command used to make hard or soft links
ln
Command used to change the permissions of files and directories
chmod
Command used to change the ownership of files and directories
chown
Command used to set default permissions for newly created files & directories
umask
Command used to change the group ownership of files and directories
chgrp
What 2 commands can be used for creating an archive file
tar
star
What is a common set of options for compressing a .gz file
tar -czvf
(create, gzip compression, verbose so see the processing of the files, specify filename)
What is a common set of options for compressing a .bz2 file
tar -cjvf
(create, bzip2 compression, verbose so see the processing of the files, specify filename)
What are common set of options for decompressing a .gz file
tar -xzvf
(extract, gzip compression, verbose so see the processing of the files, specify filename)
What are common set of options for decompressing a .bz2 file
tar -xjvf
(extract, bzip2 compression, verbose so see the processing of the files, specify filename)
What is syntax to extract a single file from a compressed .gz file
tar -xzvf Compressed.tar.gz /path/SingleFile.txt
(extract, gzip compression, verbose so see the processing of the files, specify filename)
What is the command to check the size of a directory
du -sh /path
The command to list information about block devices
lsblk
Command to list all currently mounted filesystems
findmnt
The command to attach a disk device to a path
mount
The command to disconnect a disk device from a path
umount
Utility to partition the disks
fdisk
Format a disk with ext4 filesystem
mkfs.ext4 (mkfs = make filesystem)
Format a disk with xfs filesystem
mkfs.xfs (mkfs = make filesystem)
Command to create a swap area on a device or file
mkswap
Command to activate a swap file or partition
swapon
Command to deactivate a swap file or partition
swapoff
The file to modify that defines the devices and mount points to use at boot and dependencies
/etc/fstab
What is the command to see CPU & memory utilization related to processes?
top
What is the command to see storage related metrics for processes?
iotop
Command that converts/copies files, can be whole partitions
dd
Command to show the access control list on files or directories
getfacl
Command to assign the access control list on files or directories
setfacl
Command to see the membership of groups that a user belongs to
groups
The command that allows for management of the network interfaces from the command line
nmcli
File used to specify the DNS servers to use
/etc/resolv.conf
The file that controls the order of host names (file) or dns entries for name resolution
/etc/nsswitch.conf
Syntax to locate a file on the system
find / -name filename.txt
Command used to manage and run containers
podman
Command used to inspect images and repositories for containers
skopeo
Full syntax to install tools such as podman & skopeo
sudo yum module install container-tools
Create a volume with virtual disk optimizer
vdo create
Display the statistics of a virtual disk optimized volume
vdostats
Command to initialize a physical volume on a block device
pvcreate
Command to create a volume group on a physical volume
vgcreate
Command to create a logic volume in logical volume manager
lvcreate
Command to check the physical volume information
pvs
Command to show the information about volume groups
vgs
Command to show the information about logical volumes
lvs
The directory where logs are put by default
/var/log
File that stores the configuration settings for journal
/etc/systemd/journald.conf (Storage mode = Volatile, Persistent, None, Auto)
The directory where journal files are put when NOT persistent
/run/log/journal
The directory where journal files are put when they ARE persistent
/var/log/journal
What is the command to put a load on a single CPU?
stress -c 1
What is the command to change the priority of a process?
renice
What is the command to start a process with a lower priority?
nice
What is the command to terminate a process?
kill
What is the command that shows the process IDs for a process?
pgrep (think process grep)
What is the command that allows you to modify a process’ scheduling policy & priority level?
chrt
What is the path of the tuning profiles included with Tuned?
/usr/lib/tuned
What is the path of the custom profiles used with Tuned?
/etc/tuned
What is the command to change the active performance profile associated with the server?
tuned-adm
What is the command to compare 2 files?
vimdiff
What is the command to show multiple shells on the active window?
screen
If using “screen” how do you toggle to the other half of the screen?
CTRL-A Tab
If using “screen” how do you open a bash shell?
CTRL-A c
If using “screen” how do you split the screen in half?
CTRL-A |
How do you make a process run in the background?
Append & to the end of the command (such as ‘stress -c 1 &’)
What is the command that allows you to see processes running in the background?
jobs
Command to remove signatures from filesystems and raw block devices
wipefs
What would be the command to make a new drive pool with stratis?
stratis pool create
What would be the command to show any drive pools with stratis?
stratis pool list
What would be the command to make a new file system with stratis?
stratis fs create
or
stratis filesystem create
What would be the command to show the file system info with stratis?
stratis fs list
or
stratis filesystem list
What is the option needed in fstab for mounting a stratis volume
defaults,x-systemd.requires=stratisd.service
How to add a disk to a stratis pool
stratis pool add-data [poolname] [devicename]
How to create a snapshot with Stratis
stratis pool filesystem snapshot
What should the first line look like for a bash script?
#!/bin/bash
What is the start/end pairing of a for loop?
for ( i=0; i < 10; ++i) ; do xxxx; done
What is the start/end pairing of an if/then/else statement?
if [ xxxx ]; then xxxx; else xxxx; fi
What is the start/end pairing of a case statement?
case “xxx” in 1) xxx; 2) xxx; *) xxxx ; esac
What command can be used to run a job now or in a few minutes, etc.
at
Command that reruns a command every xx seconds, typically to monitor file or directory refreshes
watch
What command shows pending scheduled jobs
atq
What command is used to modify a user’s scheduled jobs
crontab -e
What file should be modified for Chronyd NTP server settings
/etc/chrony.conf
What command allows modification of a user’s groups and setting the password for the user
usermod
What command allows renaming a group
groupmod
Syntax to set a password for a user to be xxx
usermod -p $(openssl passwd -1 xxx) username
Command to modify /etc/sudoers
visudo
Path that contains command alias and authorization setting to commands
/etc/sudoers
Command to show the repositories
yum repolist --all
What directory are repository configuration files stored in
/etc/yum.repos.d
In the repo configuration file, if you have a GPG key, what other setting needs to be listed
gpgcheck=1
Command to copy files between systems
scp
Command to install a package
dnf or yum
Command to review / install available updates
yum check-update (or dnf check-update)
Command to run so elevating as root for more than just a single command
sudo -i
Command to run network configuration tool from a menu
nmtui
What package to install for cron jobs
cronie and at
What service to ensure is running for cron jobs
crond and atd
In a cron file, what is the order of the * * * * *
Minute, Hour, Day of Month, Month of Year, Day of Week (0/7 is Sunday)
Service that handles NTP
chronyd
Command to check status of the NTP servers
chronyc sources -v
Command to change which user currently executing as
su - user
Location of the settings for grub
/etc/default/grub
Command to build a new grub configuration & environment file
grub2-mkconfig
Location of the grub boot files
/boot/grub2/grub.cfg
What’s an alternative to lsblk to get block information
blkid
What is the file that contains the NFS shares to be available
/etc/exports
What is the name of the unit that needs to be running for NFS to function
nfs-server
Command syntax to allow NFS in through the firewall
firewall-cmd --add-service nfs --permanent
Command to show the current directory
pwd (print working directory)
For autofs, if you have /etc/auto.home, what file would you have it associate the mount path to this configuration reference?
/etc/auto.master would contain a line such as
“/export/home /etc/auto.home”
For autofs, what should the syntax of the file content in /etc/auto.home look like?
* <ipaddress>:/home/&
What is the command to show NFS mounts
showmount -e
What is the syntax for setting the sticky bit on a file
chmod o+t /home/dba_docs
What does “stat” do exactly? How different from ls command?
Deeper details about a file
What is necessary to generate a running container
podman run
How do verify a container is running
podman ps -a
Command to create unit files
podman generate systemd
Configure a container to start using the user account
loginctl enable-linger
Command to see the policy & status of SELinux
sestatus
Command to see the mode/state of SELinux
getenforce
Generate SELinux local policy files based on log entries of unit xxx
ausearch -c 'xxx' --raw | audit2allow -M MyNewPolicy
How to activate a new SELinux policy
semodule -i MyNewPolicy.pp
Command that allows you to remotely check for open services & ports on a machine
nmap