As the question itself, I cannot find out why
tail -c-1 myfile.txt
tail -c+1 myfile.txt
-c, --bytes = [+] NUM
output the last NUM bytes; or use -c +NUM to output starting
with byte NUM of each file
tail -c+1 myfile.txt is the same as
cat myfile.txt: you're telling
tail to start output with the first (
+1) byte (
-c), in other words: the whole file.
tail -c-1 myfile.txt (more typically:
tail -c1 myfile.txt) outputs only the last byte in
myfile.txt; assuming that
myfile.txt is properly terminated with a trailing
\n, and is either a single-byte encoding such as ASCII or one that has single-byte ASCII encoding as a subset, such as UTF-8, this will output just that
\n, i.e., a blank line.
The above applies to both the GNU (typical on Linux) and the BSD/macOS implementations of
tail. If you're getting different results - as it sounds you're getting for
tail -c-1 - tell us what implementation you're using / what platform you're on.