Skip to article frontmatterSkip to article content

Newline

Intro

Disadvantages of not having a final newline in files:

How to find files without a final newline?

rg

Ripgrep is written in Rust, and Rust regexes provide \z to match “the end of text or file”. See their docs.

$ rg --multiline --files-with-matches '[^\n]\z'