Files
School/Anul 1/Semestrul 2/OS/Seminare/Semianr 1/notes.txt
T
2024-08-31 12:07:21 +03:00

52 lines
591 B
Plaintext

Grep
-E - extended regex
-i - ignore case sensitive
-v - invert match
-c - count
-o - only the matching part
-q - doesnt print the result, sets the exits status
Sed
sed s/*replace*/*with*/gi *file*
s - replaces x with y
g - replaces all (global)
i - case insensitive
sed y/*replace*/*with*/ *file*
y - replace x[i] with y[i]
sed /*to_delete*/d
d - delete
Awk
NR - number of current line
NF - number of fields on the current ine
$0 - whole line
$1 - field 1
awk -F '{*code*}' *file*
-F -specifie delimitor
code:
BEGIN {*before*}
{*for each line*}
END{*after*}