How can I list normal text (.txt) filenames, that don\'t end with a newline?
.txt
e.g.: list (output) this filename:
$ cat a.txt asdfasdlsad4rand
Give this a try:
find . -type f -exec sh -c '[ -z "$(sed -n "\$p" "$1")" ]' _ {} \; -print
It will print filenames of files that end with a blank line. To print files that don't end in a blank line change the -z to -n.
-z
-n