Count bytes and characters with wc
wc -c filename == counts the bytes
wc -m filename == counts the characters
this can be combined with other commands like grep, awk, sed
example with sed:
sed -n '1p' filename | wc -c
the above will print the first line from filename and count the bytes in that line
This entry was posted by redoer on 25/01/2017 at 1:33 pm, and is filed under howto, linux, sed, tipsNtricks. Follow any responses to this post through RSS 2.0.
Both comments and pings are currently closed.
Comments are closed.