adspace
Is it possible to count number char, line in a file; if so, How?
Answer Posted / Anup Kumar Pandey
Yes, it is possible to count the number of characters and lines in a file using various command-line utilities in Unix-like systems. To count characters (including whitespace), use the `wc -m` command. To count only printable characters, use `wc -c`. To count lines, use `wc -l`. For example: `echo 'Hello World' | wc -m` counts characters and `cat file.txt | wc -l` counts lines in a file.
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers