- Unix / Linux - Regular Expressions with SED
- Regular Expressions - AWK
- 35+ Examples of Regex Patterns Using sed and awk in Linux
- Using Grep & Regular Expressions to Search for Text Patterns in Linux
- Illustrated jq tutorial
- How To Search Multiple Words / String Pattern Using grep Command on Bash shell
- The GNU Awk User’s Guide
- RegEx for Formating Rsyslog Logs to work with Arcsight Template(StackOverflow)
-
-
Save cactaceae21/4b2a040e85d25a6fdaa0276bd3eebf6e to your computer and use it in GitHub Desktop.
Usage: locale [OPTION...] NAME | |
or: locale [OPTION...] [-a|-m] | |
Get locale-specific information. | |
System information: | |
-a, --all-locales Write names of available locales | |
-m, --charmaps Write names of available charmaps | |
Modify output format: | |
-c, --category-name Write names of selected categories | |
-k, --keyword-name Write names of selected keywords | |
-v, --verbose Print more information | |
-?, --help Give this help list | |
--usage Give a short usage message | |
-V, --version Print program version | |
For bug reporting instructions, please see: | |
<https://bugs.launchpad.net/ubuntu/+source/glibc/+bugs>. |
(https://stackoverflow.com/questions/5536018/how-to-print-matched-regex-pattern-using-awk)
awk '/pattern/{ print $0 }' file
awk '{for(i=1;i<=NF;i++){ if($i=="yyy"){print $i} } }' file
cat <file.txt> | grep -oP "([a-zA-Z0-9_\-\.\*]+)@([a-zA-Z0-9_\-\.]+)\.([a-zA-Z]{2,5})" | sort -fu
awk '{$1=$1};1'
curl -vvI https://gnupg.org
echo | openssl s_client -showcerts -servername gnupg.org -connect gnupg.org:443 2>/dev/null | openssl x509 -inform pem -noout -text
printf "\x1f\x8b\x08\x00\x00\x00\x00\x00" | cat - /tmp/data | gzip -dc >/tmp/out
"\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\x00"
sed '1d' file.txt > tmpfile; mv tmpfile file.txt
# POSIX
sed -i '1d' file.txt
# GNU sed only, creates a temporary file
perl -ip -e '$_ = undef if $. == 1' file.txt
# also creates a temporary file
sed -i .bak '1d' file.txt
#BSD
tail -n +2 file-in.txt > file-out.txt
# using Tail
- -P, --perl-regexp
- Interpret the pattern as a Perl-compatible regular expression (PCRE). This is experimental and grep -P may warn of unimplemented features.
- -E, --extended-regexp
- Interpret PATTERN as an extended regular expression (ERE, see below).
- -i, --ignore-case
- Ignore case distinctions, so that characters that differ only in case match each other.
- -o, --only-matching
- Print only the matched (non-empty) parts of a matching line, with each such part on a separate output line.
- -c, --count
- Suppress normal output; instead print a count of matching lines for each input file. With the -v, --invert-match option (see below), count non-matching lines.
- -v, --invert-match
- Invert the sense of matching, to select non-matching lines.
- -a, --binary-files=text
- Treat binary files as text (some encoding is treated as binary although it is still text)
- -f
- Ignore Case
- -u
- Unique