Is it possible to count number char, line in a file; if so, How?



Is it possible to count number char, line in a file; if so, How?..

Answer / 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

More Unix General Interview Questions

What language is unix written?

1 Answers  


What are system variables in unix?

1 Answers  


What is .login file in unix?

1 Answers  


How do you start and stop services in unix without using admin console?

1 Answers  


What is source unix?

1 Answers  


What are some common shells and what are their indicators?

1 Answers  


What is procedure to configure Mirror rootvg in HP-UX?

2 Answers   IBM, Microsoft,


Explain what is a fifo?

1 Answers  


What are the three major components of any unix system?

1 Answers  


What is difference between SSH V1 and SSH V2? What are drawbacks of SSH V2?

1 Answers   Wipro,


What is the full form of unix operating system?

1 Answers  


Explain Sticky bit?

1 Answers  


Categories