Comparing Files and Searching Files Flashcards

1
Q

diff

A

compare 2 files for the difference between them

diff filename filename

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

sdiff

A

side by side comparison

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

vimdiff

A

highlights the differences in vim

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

grep

A

used to search for a pattern in a file

eg: grep dog myText.txt

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

grep -i

A

performs a search ignoring case

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

grep -c

A

counts the number of times the pattern occurs in the file

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

grep -n

A

proceed output with line number

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

grep -v

A

invert match. print lines that don’t match the pattern

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

file

A

tells you what’s in a file

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

|

A

Takes the standard output from one command and passes it in as standard input to the next command

command 1 | command 2

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

cut

A

used to cut a piece of a file out

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

cut -f N

A

specify which line number to display

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

cut -d delimeter

A

used to cut with a delimeter

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

grep bob /etc/password | cut -d: -ft,5 | sort | tr “:” “ “ | column -t

A

search for bob in the file password, then cut out only the first and 5 sections of the file separated by colons, then sort them alphabetically, then remove the colon and replace with whitespace, then format as a table

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