The "wc" command is used to display information about the number of lines, words, and characters in a file or standard input. Here's how you can use it in a Bash terminal:
To count the number of lines in a file:
bash
wc -l filename
To count the number of words in a file:
bash
wc -w filename
To count the number of characters in a file:
bash
wc -c filename
To count the number of lines, words, and characters in a file:
bash
wc filename
If you don't specify a filename, the "wc" command will read from standard input. You can provide input manually, and once you're done, press Ctrl+D to signal the end of the input. For example:
bash
wc This is an example To test the wc command Ctrl+D
This will output the number of lines, words, and characters in the provided input.