The wc (WordCount) command is used to count the file content information, including the number of lines and characters. [python] viewplaincopy # displays the file content information. the output information is the number of lines, number of words, and number of bytes in sequence, file name wcfilename # display the number of lines of a file wc-lfilename # display the number of bytes of a file wc-cfilename # display the number of characters of a file wc-mfilename &
The wc (Word Count) command is used to Count the file content, including the number of lines and characters.
[Python]View plaincopy
# Display file content information. the output information is the number of lines, number of words, number of bytes, and file name.
Wc filename
# Display the number of lines of a file
Wc-l filename
# Display the number of bytes of a file
Wc-c filename
# Display the characters of a file
Wc-m filename
# Display the length of the longest row in a file
Wc-L filename
# Note: the line break at the end of each line is also considered a character, and a space is also considered a character
# Using UTF-8 encoding, so a Chinese character is converted to 3 bytes here
# When the-m option is used, a Chinese character is calculated as a character