Using grep & Regular Expressions

Lakukan tugas rumah & ujian kamu dengan baik sekarang menggunakan Quizwiz!

\

remove special meaning from the next character

grep linux files

search files for lines with the word linux

grep taxes *

searches for taxes

adding a hypen like so, [ - ] does what?

searches through a range

-i

case insensitive search

What is grep?

Use it to search for words or content within a file or files

-v

find all instances without a pattern match

-r

makes the search recursive through a directory structure

.

match a single character of any value, except end of line

-w

match a word rather than any pattern match

[^ ]

match any character except the enclosed ones

[ ]

match any enclosed characters

\{x\}

match exactly x occurrences of the preceding value

$

match expression at the end of a line

^

match expression at the start of the line

\{x, \}

match x or more occurrences of the preceding value

\{x,y\}

match x to y occurrences of the preceding value

*

match zero or more of the preceding character or expression


Set pelajaran terkait

GACE - Elementary Education Test I & II Combo (501)

View Set

Statistics 125 - Module 1 Homework 1.3

View Set

G4《你今天上了什么课》第6页

View Set

Nurs 200 Midterm Chaminade University

View Set