The wc (word count) command counts lines, words, and bytes of its input. The default output is to show all three:
$ wc .bashrc 101 550 3391 .bashrc
In this example, our .bashrc file has 101 lines, 550 space-delimited words, and 3,391 bytes. You can print only one of these numbers with the -l, -w, and -c options, respectively.
If you provide more than one file for wc to examine, it will also print a total:
$ wc -c .bashrc .bash_profile 3391 .bashrc 471 .bash_profile 3862 total
Be careful to distinguish between bytes and characters. If you actually need to count the number of characters, for example if you're dealing with a file with Japanese characters or emojis in it, you can use the -m option instead:
$ wc -m -c japanese 6 16 japanese
Note here that the number of characters (6) is different from the number of bytes (16), as some of the characters are composed of more than one byte in UTF-8 encoding.