FIND YOUR NEXT FEW LINES

Results for “lines”

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

42 snippets foundClear filters
HTMLGetting Started

Accept several lines of text

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

HTML✓ Tested
Linux CommandsText processing

Count lines in a file

Count newline characters in a text file, printing only the count without the filename.

lines✓ Tested
Linux CommandsSearching text

Count matching lines

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

Linux Commands✓ Tested
Linux CommandsSorting & joining records

Count repeated lines after sorting

Linux Commands: Group identical lines before uniq -c, then normalize its leading padding.

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 CommandsGetting Started

Filter lines by literal text

Linux Commands: Filter lines by literal text using GNU/Linux commands in an empty practice directory.

Linux Commands✓ Tested
Linux CommandsSorting & joining records

Find lines common to two sorted files

Linux Commands: Use comm -12 to suppress the two columns of unmatched lines.

Linux Commands✓ Tested
Linux CommandsSorting & joining records

Find lines unique to the first sorted file

Linux Commands: Use comm -23 to retain only records absent from the second input.

Linux Commands✓ Tested
Linux CommandsTransforming text

Join lines from two files side by side

Linux Commands: Use paste to pair lines by position with a chosen separator.

Linux Commands✓ Tested
Linux CommandsTransforming text

Print a selected range of lines

Linux Commands: Use sed -n with a line address to suppress other output.

Linux Commands✓ Tested
Linux CommandsTransforming text

Print the final lines of a file

Linux Commands: Use tail -n for a fixed-size suffix of a log.

Linux Commands✓ Tested
JavaText validation & formatting

Process the lines of an in-memory string

Java: Use String.lines to handle common line terminators without retaining them.

Java✓ Tested