Grep Flashcards

(24 cards)

1
Q

fichier

A

egrep “[exp]” test.txt

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

inverser résultat

A

egrep -v “[exp]”

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

nombre de lignes

A

egrep -c “[exp]”

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

numéro de ligne

A

egrep -n “[exp]”

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

nombre de lignes qui ne correspondent pas

A

egrep -cv “[exp]”

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

caractère alphabétique

A

[A-Za-z] ou [[:alpha:]]

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

numérique

A

[0-9] ou [[:digit:]]

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

alphanumérique

A

[A-Za-z0-9] ou [[:alnum:]]

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

le point

A

.

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

zéro ou une fois

A

?

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

au moins une fois

A

+

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

zero ou plus

A

*

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

k fois

A

{k}

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

ou

A

|

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

commence par

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

finit par

17
Q

bloc et rappel

A

( … )

puis \1 pour rappel

18
Q

retour à la ligne

19
Q

k fois ou plus

20
Q

entre k et l fois

21
Q

et

A

egrep “exp1” | egrep “exp2”

22
Q

remplacer tous les A par a du fichier

A

sed -i s/A/a/g file.txt

23
Q

remplacer le premier A par a

A

sed -i s/A/a/ file.txt

24
Q

supprimer les lignes finissant par z

A

sed /z$/d file.txt