Here I bring you another interesting tip 🙂
I don't know about you, but sometimes I need to know how many words or how many characters a file has, for this we can use the Libre Office Writer, or use our text editor if it gives us this information, but in Linux we will always have more options for the ones we know ... that's why I bring you here a command that will tell us this 🙂
For example, we have the file file.txt containing:
<° Linux (aka DesdeLinux) is a site dedicated to topics related to Free Software and Technologies.
Our goal is none other than to provide all those users who are new to the world of GNU / Linux, a place where they can acquire new knowledge in the easiest way possible.
If we execute wc and we pass the file path, it will give us:
- Number of lines in the file
- Number of words in the file
- Number of characters in the file
Let's see a screenshot 😀
As you can see, this has 3 lines (2 text and one at the end empty), as well as 50 words and a total of 302 characters. Characters include letters, numbers, symbols, and spaces 😀
Well ... nothing more to add 😉
I hope you find it interesting.
regards
I used it quite a bit to process chain program outputs with a pipe.
For example program> output; cat output | grep pattern | toilet
Very useful
With Unix pipes you can do something similar but this command that you show will help me a lot thanks
regards
A pleasure to help 🙂
I was going to use this
http://pastebin.com/nHeAs2qk
worked with a bash script to call the file, since I did not know that wc function, I always only did wc -l to convert lines into text
I should start using more "man"
Thanks and Regards again
To convert lines into text? I meant to see the lines of a text, going back to the man thing, already checke and it also has –help, a tutorial on wc would be good since it is seen that it is very useful
Thank you very much .. Thank you very much .. something so simple but so useful ..