How to print the number of characters in each line of a text file January 6, 2023 by Tarik Use Awk. awk '{ print length }' abc.txt