Searching & Extracting Flashcards

1
Q

What linux command is used to read an entire file?

A

less

*cat can only view a few lines

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

What linux command is used to read the beginning/end of a file?

A

head filetoread
tail filetoread

-n can be used to specify number of lines

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

What linux command is used to locate files on the system?

A

find

  • type d/f to specify directory or file
  • name
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What linux command is used to search for text inside files?

A

grep charstofind fromlocation

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

What linux command is used to organise text in a file?

A

sort

  • r reverse alphabetic order
  • R random
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What linux command is used to manipulate text by column?

A

cut

-c column i.e -c2-5 -c3-
-d delimiter -f field (used in conjunction)
> new file&raquo_space; append to file

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

What linux command is used to word count a file?

A

wc

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

How do you use find and grep to select only specific matching text?

A

find | grep

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

What are regular expressions?

A

used to parse through text of certain arrangement

^ beginning of line
$end of line
. any single substituted character

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