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

vivim

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
Q

Command used to change the ownership of files and directories

A

chown

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

Command used to set default permissions for newly created files & directories

A

umask

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

Command used to change the group ownership of files and directories

A

chgrp

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

What 2 commands can be used for creating an archive file

A

tarstar

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

What is a common set of options for compressing a .gz file

A

tar -czvf(create, gzip compression, verbose so see the processing of the files, specify filename)

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

What is a common set of options for compressing a .bz2 file

A

tar -cjvf (create, bzip2 compression, verbose so see the processing of the files, specify filename)

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

What are common set of options for decompressing a .gz file

A

tar -xzvf (extract, gzip compression, verbose so see the processing of the files, specify filename)

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

What are common set of options for decompressing a .bz2 file

A

tar -xjvf(extract, bzip2 compression, verbose so see the processing of the files, specify filename)

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

What is syntax to extract a single file from a compressed .gz file

A

tar -xzvf Compressed.tar.gz /path/SingleFile.txt(extract, gzip compression, verbose so see the processing of the files, specify filename)

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

What is the command to check the size of a directory

A

du -sh /path

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

The command to list information about block devices

A

lsblk

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

Command to list all currently mounted filesystems

A

findmnt

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

The command to attach a disk device to a path

A

mount

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

The command to disconnect a disk device from a path

A

umount

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

Utility to partition the disks

A

fdisk

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

Format a disk with ext4 filesystem

A

mkfs.ext4 (mkfs = make filesystem)

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

Format a disk with xfs filesystem

A

mkfs.xfs (mkfs = make filesystem)

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

Command to create a swap area on a device or file

A

mkswap

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

Command to activate a swap file or partition

A

swapon

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

Command to deactivate a swap file or partition

A

swapoff

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

The file to modify that defines the devices and mount points to use at boot and dependencies

A

/etc/fstab

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

What is the command to see CPU & memory utilization related to processes?

A

top

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

What is the command to see storage related metrics for processes?

A

iotop

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

Command that converts/copies files, can be whole partitions

A

dd

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

Command to show the access control list on files or directories

A

getfacl

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

Command to assign the access control list on files or directories

A

setfacl

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

Command to see the membership of groups that a user belongs to

A

groups

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

The command that allows for management of the network interfaces from the command line

A

nmcli

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

File used to specify the DNS servers to use

A

/etc/resolv.conf

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

The file that controls the order of host names (file) or dns entries for name resolution

A

/etc/nsswitch.conf

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

Syntax to locate a file on the system

A

find / -name filename.txt

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

Command used to manage and run containers

A

podman

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

Command used to inspect images and repositories for containers

A

skopeo

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

Full syntax to install tools such as podman & skopeo

A

sudo yum module install container-tools

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

Create a volume with virtual disk optimizer

A

vdo create

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

Display the statistics of a virtual disk optimized volume

A

vdostats

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

Command to initialize a physical volume on a block device

A

pvcreate

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

Command to create a volume group on a physical volume

A

vgcreate

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

Command to create a logic volume in logical volume manager

A

lvcreate

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

Command to check the physical volume information

A

pvs

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

Command to show the information about volume groups

A

vgs

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

Command to show the information about logical volumes

A

lvs

67
Q

The directory where logs are put by default

A

/var/log

68
Q

File that stores the configuration settings for journal

A

/etc/systemd/journald.conf (Storage mode = Volatile, Persistent, None, Auto)

69
Q

The directory where journal files are put when NOT persistent

A

/run/log/journal

70
Q

The directory where journal files are put when they ARE persistent

A

/var/log/journal

71
Q

What is the command to put a load on a single CPU?

A

stress -c 1

72
Q

What is the command to change the priority of a process?

A

renice

73
Q

What is the command to start a process with a lower priority?

A

nice

74
Q

What is the command to terminate a process?

A

kill

75
Q

What is the command that shows the process IDs for a process?

A

pgrep (think process grep)

76
Q

What is the command that allows you to modify a process’ scheduling policy & priority level?

A

chrt

77
Q

What is the path of the tuning profiles included with Tuned?

A

/usr/lib/tuned

78
Q

What is the path of the custom profiles used with Tuned?

A

/etc/tuned

79
Q

What is the command to change the active performance profile associated with the server?

A

tuned-adm

80
Q

What is the command to compare 2 files?

A

vimdiff

81
Q

What is the command to show multiple shells on the active window?

A

screen

82
Q

If using “screen” how do you toggle to the other half of the screen?

A

CTRL-A Tab

83
Q

If using “screen” how do you open a bash shell?

A

CTRL-A c

84
Q

If using “screen” how do you split the screen in half?

A

CTRL-A |

85
Q

How do you make a process run in the background?

A

Append & to the end of the command (such as ‘stress -c 1 &’)

86
Q

What is the command that allows you to see processes running in the background?

A

jobs

87
Q

Command to remove signatures from filesystems and raw block devices

A

wipefs

88
Q

What would be the command to make a new drive pool with stratis?

A

stratis pool create

89
Q

What would be the command to show any drive pools with stratis?

A

stratis pool list

90
Q

What would be the command to make a new file system with stratis?

A

stratis fs createorstratis filesystem create

91
Q

What would be the command to show the file system info with stratis?

A

stratis fs listorstratis filesystem list

92
Q

What is the option needed in fstab for mounting a stratis volume

A

defaults,x-systemd.requires=stratisd.service

93
Q

How to add a disk to a stratis pool

A

stratis pool add-data [poolname] [devicename]

94
Q

How to create a snapshot with Stratis

A

stratis pool filesystem snapshot

95
Q

What should the first line look like for a bash script?

A

#!/bin/bash

96
Q

What is the start/end pairing of a for loop?

A

for ( i=0; i < 10; ++i) ; do xxxx; done

97
Q

What is the start/end pairing of an if/then/else statement?

A

if [ xxxx ]; then xxxx; else xxxx; fi

98
Q

What is the start/end pairing of a case statement?

A

case “xxx” in 1) xxx; 2) xxx; *) xxxx ; esac

99
Q

What command can be used to run a job now or in a few minutes, etc.

A

at

100
Q

Command that reruns a command every xx seconds, typically to monitor file or directory refreshes

A

watch

101
Q

What command shows pending scheduled jobs

A

atq

102
Q

What command is used to modify a user’s scheduled jobs

A

crontab -e

103
Q

What file should be modified for Chronyd NTP server settings

A

/etc/chrony.conf

104
Q

What command allows modification of a user’s groups and setting the password for the user

A

usermod

105
Q

What command allows renaming a group

A

groupmod

106
Q

Syntax to set a password for a user to be xxx

A

usermod -p $(openssl passwd -1 xxx) username

107
Q

Command to modify /etc/sudoers

A

visudo

108
Q

Path that contains command alias and authorization setting to commands

A

/etc/sudoers

109
Q

Command to show the repositories

A

yum repolist --all

110
Q

What directory are repository configuration files stored in

A

/etc/yum.repos.d

111
Q

In the repo configuration file, if you have a GPG key, what other setting needs to be listed

A

gpgcheck=1

112
Q

Command to copy files between systems

A

scp

113
Q

Command to install a package

A

dnf or yum

114
Q

Command to review / install available updates

A

yum check-update (or dnf check-update)

115
Q

Command to run so elevating as root for more than just a single command

A

sudo -i

116
Q

Command to run network configuration tool from a menu

A

nmtui

117
Q

What package to install for cron jobs

A

cronie and at

118
Q

What service to ensure is running for cron jobs

A

crond and atd

119
Q

In a cron file, what is the order of the * * * * *

A

Minute, Hour, Day of Month, Month of Year, Day of Week (0/7 is Sunday)

120
Q

Service that handles NTP

A

chronyd

121
Q

Command to check status of the NTP servers

A

chronyc sources -v

122
Q

Command to change which user currently executing as

A

su - user

123
Q

Location of the settings for grub

A

/etc/default/grub

124
Q

Command to build a new grub configuration & environment file

A

grub2-mkconfig

125
Q

Location of the grub boot files

A

/boot/grub2/grub.cfg

126
Q

What’s an alternative to lsblk to get block information

A

blkid

127
Q

What is the file that contains the NFS shares to be available

A

/etc/exports

128
Q

What is the name of the unit that needs to be running for NFS to function

A

nfs-server

129
Q

Command syntax to allow NFS in through the firewall

A

firewall-cmd --add-service nfs --permanent

130
Q

Command to show the current directory

A

pwd (print working directory)

131
Q

For autofs, if you have /etc/auto.home, what file would you have it associate the mount path to this configuration reference?

A

/etc/auto.master would contain a line such as”/export/home /etc/auto.home”

132
Q

For autofs, what should the syntax of the file content in /etc/auto.home look like?

A

* :/home/&

133
Q

What is the command to show NFS mounts

A

showmount -e

134
Q

What is the syntax for setting the sticky bit on a file

A

chmod +t /home/dba_docs

135
Q

What does “stat” do exactly? How different from ls command?

A

Deeper details about a file

136
Q

What is necessary to generate a running container

A

podman run

137
Q

How do verify a container is running

A

podman ps -a

138
Q

Command to create unit files

A

podman generate systemd –new –files –name xxx

139
Q

Configure a container to start using the user account

A

loginctl enable-linger

140
Q

Command to see the policy & status of SELinux

A

sestatus

141
Q

Command to see the mode/state of SELinux

A

getenforce

142
Q

Generate SELinux local policy files based on log entries of unit xxx

A

ausearch -c 'xxx' --raw | audit2allow -M MyNewPolicy

143
Q

How to activate a new SELinux policy

A

semodule -i MyNewPolicy.pp

144
Q

Command that allows you to remotely check for open services & ports on a machine

A

nmap

145
Q

How would you check the status of a service called xxx?

A

systemctl status xxx.service

146
Q

How would you enable the service called xxx so it would be available at boot?

A

systemctl enable xxx.service

147
Q

How would you start the service called xxx so is running?

A

systemctl start xxx.service or alternatively systemctl enable --now xxx.service for enable & start

148
Q

How do you build a container image from a containerfile

A

podman build -t imagename http://site/container

149
Q

What command do you use to modify the password expiration for a user?

A

chage

150
Q

What file do you use to modify defaults for login settings for users?

A

/etc/login.defs

151
Q

What file do you modify if you need to change the password requirements

A

/etc/security/pwquality.conf

152
Q

What directory do you put directories or files that should be duplicated in every new user’s home drive

A

/etc/skel

153
Q

What command do you use to modify file extended attributes

A

chattr

154
Q

What command do you use to view file extended attributes

A

lsattr

155
Q

What command do you use to modify time zone

A

timedatectl

156
Q

What command do you use after partition changes to ensure the OS picked up the changes?

A

partprobe

157
Q

tuned-adm - if multiple profiles, which one is preferred?

A

Last one wins

158
Q

What command do you use to resize the file system after expanding the underlying volume?

A

resize2fs

159
Q

Be sure to map out the root password recovery process

A

Know this process cold: https://youtu.be/HK7OI3uboKg?t=158

160
Q

What if you want to make a group own all files in a directory?

A

chmod g+s /directory

161
Q

What command do you use to authenticate to a container registry?

A

podman login

162
Q

When extending a logical volume, how can you have it expand the file system at the same time?

A

lvextend -r

163
Q

What is the syntax if you want to copy all files owned by Fred into a directory of /find/FredFiles/

A

find /home -size -user Fred -exec cp '{}' /find/FredFiles/ \;