FIND YOUR NEXT FEW LINES

Results for “Searching text”

Small, practical examples. Search by task or narrow things down below.

431 snippets foundClear filters
Linux CommandsSearching text

Search text without case sensitivity

Linux Commands: Use grep -i to match uppercase and lowercase variants.

Linux Commands✓ Tested
Linux CommandsSearching text

Branch on whether a pattern exists

Linux Commands: Use grep -q in a conditional so an ordinary no-match result is not an unhandled failure.

Linux Commands✓ Tested
Linux CommandsSearching text

Count matching lines

Linux Commands: Use grep -c to count matching lines rather than individual occurrences.

Linux Commands✓ Tested
Linux CommandsSearching text

Exclude matching lines

Linux Commands: Use grep -v to retain lines that do not start with a comment marker.

Linux Commands✓ Tested
Linux CommandsSearching text

List files containing a match

Linux Commands: Use grep -l when only the matching filenames are needed.

Linux Commands✓ Tested
Linux CommandsSearching text

Match a whole word

Linux Commands: Use grep -w to exclude a matching substring inside a longer word.

Linux Commands✓ Tested
Linux CommandsSearching text

Match any pattern from a file

Linux Commands: Use grep -F -f with one literal pattern per line.

Linux Commands✓ Tested
Linux CommandsSearching text

Print only the matching portions

Linux Commands: Use extended regex and -o to extract digit sequences.

Linux Commands✓ Tested
Linux CommandsSearching text

Search for a literal string

Linux Commands: Use grep -F when the pattern contains regex metacharacters that should be literal.

Linux Commands✓ Tested
Linux CommandsSearching text

Show line numbers beside matches

Linux Commands: Use grep -n so a result identifies its position in the source file.

Linux Commands✓ Tested
HTMLGetting Started

Accept several lines of text

HTML: Learn how to accept several lines of text in a complete browser example.

HTML✓ Tested
HTMLForms

Add a multiline text field

Set a maximum length and visible rows on a labeled HTML textarea.

HTML✓ Tested