RHEL9 EX200 Flashcards

1
Q

Command to copy files

A

cp

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Command to remove a directory

A

rmdir

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Command to create a directory

A

mkdir

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Command to show a directory structure and files it contains

A

tree

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Command to show the contents of a text file

A

cat

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Command to match the contents of output with provided text

A

grep

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Command to query & view logs from the systemd journal

A

journalctl

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Command used to switch to another user account in the terminal.

A

su

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Command used to execute commands with elevated privileges

A

sudo

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Command used to add user

A

useradd

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Command used to add a group

A

groupadd

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Command used to determine who is logged in

A

whoami

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Command used to display the user and group information for a specified user or the current user

A

id

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

File location to see user information such as home path and ID number

A

/etc/passwd

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

File location to see encrypted password of users and the details about when last set, expiration, etc.

A

/etc/shadow

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

File location to see group information

A

/etc/group

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

Command used to show the manual

A

man

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

Option on commands to show available options

A

--help

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

Path to where system documentation is located

A

/usr/share/doc

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

Command to show you where the command you specify is located

A

where

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

Command to search files and directories

A

find

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

What are the 2 text editors typically used

A

vi
vim

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

Command used to make hard or soft links

A

ln

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

Command used to change the permissions of files and directories

A

chmod

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Command used to change the ownership of files and directories
chown
26
Command used to set default permissions for newly created files & directories
umask
27
Command used to change the group ownership of files and directories
chgrp
28
What 2 commands can be used for creating an archive file
tar star
29
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)
30
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)
31
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)
32
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)
33
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)
34
What is the command to check the size of a directory
du -sh /path
35
The command to list information about block devices
lsblk
36
Command to list all currently mounted filesystems
findmnt
37
The command to attach a disk device to a path
mount
38
The command to disconnect a disk device from a path
umount
39
Utility to partition the disks
fdisk
40
Format a disk with ext4 filesystem
mkfs.ext4 (mkfs = make filesystem)
41
Format a disk with xfs filesystem
mkfs.xfs (mkfs = make filesystem)
42
Command to create a swap area on a device or file
mkswap
43
Command to activate a swap file or partition
swapon
44
Command to deactivate a swap file or partition
swapoff
45
The file to modify that defines the devices and mount points to use at boot and dependencies
/etc/fstab
46
What is the command to see CPU & memory utilization related to processes?
top
47
What is the command to see storage related metrics for processes?
iotop
48
Command that converts/copies files, can be whole partitions
dd
49
Command to show the access control list on files or directories
getfacl
50
Command to assign the access control list on files or directories
setfacl
51
Command to see the membership of groups that a user belongs to
groups
52
The command that allows for management of the network interfaces from the command line
nmcli
53
File used to specify the DNS servers to use
/etc/resolv.conf
54
The file that controls the order of host names (file) or dns entries for name resolution
/etc/nsswitch.conf
55
Syntax to locate a file on the system
find / -name filename.txt
56
Command used to manage and run containers
podman
57
Command used to inspect images and repositories for containers
skopeo
58
Full syntax to install tools such as podman & skopeo
sudo yum module install container-tools
59
Create a volume with virtual disk optimizer
vdo create
60
Display the statistics of a virtual disk optimized volume
vdostats
61
Command to initialize a physical volume on a block device
pvcreate
62
Command to create a volume group on a physical volume
vgcreate
63
Command to create a logic volume in logical volume manager
lvcreate
64
Command to check the physical volume information
pvs
65
Command to show the information about volume groups
vgs
66
Command to show the information about logical volumes
lvs
67
The directory where logs are put by default
/var/log
68
File that stores the configuration settings for journal
/etc/systemd/journald.conf (Storage mode = Volatile, Persistent, None, Auto)
69
The directory where journal files are put when NOT persistent
/run/log/journal
70
The directory where journal files are put when they ARE persistent
/var/log/journal
71
What is the command to put a load on a single CPU?
stress -c 1
72
What is the command to change the priority of a process?
renice
73
What is the command to start a process with a lower priority?
nice
74
What is the command to terminate a process?
kill
75
What is the command that shows the process IDs for a process?
pgrep (think process grep)
76
What is the command that allows you to modify a process' scheduling policy & priority level?
chrt
77
What is the path of the tuning profiles included with Tuned?
/usr/lib/tuned
78
What is the path of the custom profiles used with Tuned?
/etc/tuned
79
What is the command to change the active performance profile associated with the server?
tuned-adm
80
What is the command to compare 2 files?
vimdiff
81
What is the command to show multiple shells on the active window?
screen
82
If using "screen" how do you toggle to the other half of the screen?
CTRL-A Tab
83
If using "screen" how do you open a bash shell?
CTRL-A c
84
If using "screen" how do you split the screen in half?
CTRL-A |
85
How do you make a process run in the background?
Append & to the end of the command (such as 'stress -c 1 &')
86
What is the command that allows you to see processes running in the background?
jobs
87
Command to remove signatures from filesystems and raw block devices
wipefs
88
What would be the command to make a new drive pool with stratis?
stratis pool create
89
What would be the command to show any drive pools with stratis?
stratis pool list
90
What would be the command to make a new file system with stratis?
stratis fs create or stratis filesystem create
91
What would be the command to show the file system info with stratis?
stratis fs list or stratis filesystem list
92
What is the option needed in fstab for mounting a stratis volume
defaults,x-systemd.requires=stratisd.service
93
How to add a disk to a stratis pool
stratis pool add-data [poolname] [devicename]
94
How to create a snapshot with Stratis
stratis pool filesystem snapshot
95
What should the first line look like for a bash script?
`#!/bin/bash`
96
What is the start/end pairing of a for loop?
for ( i=0; i < 10; ++i) ; do xxxx; done
97
What is the start/end pairing of an if/then/else statement?
if [ xxxx ]; then xxxx; else xxxx; fi
98
What is the start/end pairing of a case statement?
case "xxx" in 1) xxx; 2) xxx; *) xxxx ; esac
99
What command can be used to run a job now or in a few minutes, etc.
at
100
Command that reruns a command every xx seconds, typically to monitor file or directory refreshes
watch
101
What command shows pending scheduled jobs
atq
102
What command is used to modify a user's scheduled jobs
crontab -e
103
What file should be modified for Chronyd NTP server settings
/etc/chrony.conf
104
What command allows modification of a user's groups and setting the password for the user
usermod
105
What command allows renaming a group
groupmod
106
Syntax to set a password for a user to be xxx
usermod -p $(openssl passwd -1 xxx) username
107
Command to modify /etc/sudoers
visudo
108
Path that contains command alias and authorization setting to commands
/etc/sudoers
109
Command to show the repositories
`yum repolist --all`
110
What directory are repository configuration files stored in
/etc/yum.repos.d
111
In the repo configuration file, if you have a GPG key, what other setting needs to be listed
gpgcheck=1
112
Command to copy files between systems
scp
113
Command to install a package
dnf or yum
114
Command to review / install available updates
yum check-update (or dnf check-update)
115
Command to run so elevating as root for more than just a single command
sudo -i
116
Command to run network configuration tool from a menu
nmtui
117
What package to install for cron jobs
cronie and at
118
What service to ensure is running for cron jobs
crond and atd
119
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)
120
Service that handles NTP
chronyd
121
Command to check status of the NTP servers
chronyc sources -v
122
Command to change which user currently executing as
su - user
123
Location of the settings for grub
/etc/default/grub
124
Command to build a new grub configuration & environment file
grub2-mkconfig
125
Location of the grub boot files
/boot/grub2/grub.cfg
126
What's an alternative to lsblk to get block information
blkid
127
What is the file that contains the NFS shares to be available
/etc/exports
128
What is the name of the unit that needs to be running for NFS to function
nfs-server
129
Command syntax to allow NFS in through the firewall
`firewall-cmd --add-service nfs --permanent`
130
Command to show the current directory
pwd (print working directory)
131
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"
132
For autofs, what should the syntax of the file content in /etc/auto.home look like?
`* :/home/&`
133
What is the command to show NFS mounts
showmount -e
134
What is the syntax for setting the sticky bit on a file
chmod o+t /home/dba_docs
135
What does "stat" do exactly? How different from ls command?
Deeper details about a file
136
What is necessary to generate a running container
podman run
137
How do verify a container is running
podman ps -a
138
Command to create unit files
podman generate systemd
139
Configure a container to start using the user account
loginctl enable-linger
140
Command to see the policy & status of SELinux
sestatus
141
Command to see the mode/state of SELinux
getenforce
142
Generate SELinux local policy files based on log entries of unit xxx
`ausearch -c 'xxx' --raw | audit2allow -M MyNewPolicy`
143
How to activate a new SELinux policy
semodule -i MyNewPolicy.pp
144
Command that allows you to remotely check for open services & ports on a machine
nmap