I am wondering how I can get the number of bytes in just one line of a file.
I know I can use wc -l
to get the number of lines in a file, and wc -c
to get the total number of bytes in a file. What I want, however, is to get the number of bytes in just one line of a file.
How would I be able to do this?
echo -n '€' | wc -c -m
will return 3 bytes, 1 character. – Chris Davies Nov 22 '16 at 18:00