RHCSA Ch3 Flashcards

1
Q

find every file in root directory containing the word apache

A

find / -name *.txt | grep apache

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

Anchor the beginning and end

Only match beginning and end

A
^ = beginning
$ = end
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

match one character

A

. = period

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

match 0 or more of the previous character

A

*

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

Match a range of characters

A

user[abc] - usera userb userc
user{a-z]
user[0-9]

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

What is a character set and give some examples

A
matches one character of a certain type
{:digit:] - numbers
[:upper:] - uppercase
[:lower:] - lower case
[:alpha:] - upper and lower case
[:alnum:] - upper and lowercase, plus numbers
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

explian the following command

sudo tar –xattrs -cvpf etc.tar /etc

A

–xattrs - preserves extended attributes including Access Control list and SELinux Security contexts
-c - creates an archive
v - verbose
p - save ownership and permissions
f - file name
etc.tar - will be the achive file name
/etc - they file that will be archived
—– This will not compress file

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

sudo tar –gzip –xattrs -cvof etc.tar.gz /etc

A

creates archive file with gzip compression

Can do this with bzip2 (.bz) and xz (.xz)

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

list all file in tar archive (tarball)

A

tar -tf etc.tar

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

extract tarball

A

sudo tar –xattrs -xvpf etc.tar

-x - extract

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

zip and unzip a gzip file

A

gzip file.txt

gunzip file.gz

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

zip and unzip with bzip2

A

bzip2 file.txt

bunzip2 file.bz

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

zip and unzip with xz

A

xz file.txt

unxz file.xz

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

make multiple directories in one command

A

mkdir ~/{dir1,dir2,dir3}

mkdir ~/dir{1,2}

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

create a hard link

A

ln file.txt filelink.txt

lowercase L

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

look a statistic of a file. Include info like inode, links, etc…

A

stat file.txt

17
Q

create a symbolic link

A

ln -s file.txt filesymlink.txt

18
Q

In vim, how do you undo and redo

A

undo - command mode (esc) + u

redo - command mode CTRL +R

19
Q

cut a letter, word, line

A

cl - letter
cw - word
cc - line

20
Q

copy (yank) a letter, word, line

multiple letter, word, line

A

yl - letter
yw- word
yy - line
5 yy - yanks 5 lines

21
Q

delete letter, word, line

A

dl - letter
dw- word
dd - line
delete keeps you in command mode

22
Q

See man page categories

A

man man-pages

23
Q

see the different man pages of a command

A

man -f crontab

24
Q

info command

A

supports hyperlinks
info grep
hit enter to go to hyperlink - press ‘l’ to go back

25
Q

What is rsyslog and where is it located?

A

persistent logs, logs are test files, can log remotely
/etc/rsyslog.conf
check OneNote for syntax

26
Q

what is journald and where is it located

A

part of systemd, nonpersistant, logs are binary, logs into RAM, very fast

27
Q

create a tarball with gzip compression (using the flag)

A

tar -czf /tmp/home.tar.gz /home

-z = gzip