Linux Fundamentals PT2 Flashcards

(42 cards)

1
Q

What command is used to set ACLs on files?

A

setfacl

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

What command is used to view ACLs?

A

getfacl

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

What option adds a permission for a user with setfacl?

A

setfacl -m u:username:rw file

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

How do you remove an ACL entry?

A

setfacl -x u:username file

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

What command is used to check disk usage of a file or directory?

A

du

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

What command is used to check disk space on filesystems?

A

df

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

What command removes empty directories?

A

rmdir

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

How do you securely delete a file?

A

shred -u filename

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

How do you display the content of a file?

A

cat file

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

How do you show file contents one page at a time?

A

less file or more file

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

How do you display the beginning of a file?

A

head file

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

How do you display the end of a file?

A

tail file

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

How do you watch a file change in real time?

A

tail -f file

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

What does ‘cut’ do?

A

Cuts selected portions from each line of a file

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

What is an example of ‘cut’?

A

cut -d’,’ -f1 file.csv (extract first column)

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

What does ‘awk’ do?

A

Pattern scanning and processing language

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

Give a simple ‘awk’ example

A

awk ‘{print $1}’ file.txt

18
Q

What does ‘grep’ do?

A

Searches for patterns in files

19
Q

What is ‘egrep’?

A

Extended grep for advanced regex (same as grep -E)

20
Q

What does ‘sort’ do?

A

Sorts lines of text files

21
Q

What does ‘uniq’ do?

A

Removes duplicate lines from sorted input

22
Q

What does ‘wc’ do?

A

Counts lines, words, bytes

23
Q

What does ‘diff’ do?

A

Compares files line by line

24
Q

What does ‘cmp’ do?

A

Compares files byte by byte

25
How do you create a .tar archive?
tar -cvf archive.tar files
26
How do you extract a .tar archive?
tar -xvf archive.tar
27
How do you gzip a file?
gzip file
28
How do you gunzip a file?
gunzip file
29
How do you create a .tar.gz file?
tar -czvf archive.tar.gz files
30
How do you extract a .tar.gz file?
tar -xzvf archive.tar.gz
31
How do you truncate a file to zero length?
truncate -s 0 file.txt
32
How do you combine multiple files into one?
cat file1 file2 > merged.txt
33
How do you split a file into pieces?
split -b 1M bigfile part_
34
How do you run multiple commands sequentially?
command1 ; command2
35
How do you run a second command only if the first succeeds?
command1 && command2
36
How do you run a second command only if the first fails?
command1 || command2
37
Linux: 'ls' = Windows: ?
dir
38
Linux: 'cp' = Windows: ?
copy
39
Linux: 'mv' = Windows: ?
move
40
Linux: 'rm' = Windows: ?
del
41
Linux: 'man' = Windows: ?
help or /?
42
Linux: 'shutdown -h now' = Windows: ?
shutdown /s /t 0