There is NO WARRANTY, to the extent permitted by law. This is free software: you are free to change and redistribute it.
License GPLv3+: GNU GPL version 3 or later.
$ wc -versionĬopyright (C) 2016 Free Software Foundation, Inc. –version: This option is used to display the version of wc which is currently running on your system. With more than one file name $ wc -L state.txt capital.txtĦ. Note: A character is the smallest unit of information that includes space, tab and newline. the extra row, doesn’t display total but it display the maximum of all values displaying in the first column of individual files. But with this option if more than one file name is specified then the last row i.e. So, we have the longest character line Arunachal Pradesh in a file state.txt and Hyderabad in the file capital.txt. L: The ‘wc’ command allow an argument -L, it can be used to print out the length of longest (number of characters) line in a file. With more than one file name $ wc -m state.txt capital.txtĥ. m: Using -m option ‘wc’ command displays count of characters from a file. With more than one file name $ wc -c state.txt capital.txtĤ.
With this option it display two-columnar output, 1st column shows number of bytes present in a file and 2nd is the file name. c: This option displays count of bytes present in a file. With more than one file name $ wc -w state.txt capital.txtģ. With this option wc command displays two-columnar output, 1st column shows number of words present in a file and 2nd is the file name. w: This option prints the number of words present in a file. With more than one file name $ wc -l state.txt capital.txtĢ. With this option wc command displays two-columnar output, 1st column shows number of lines present in a file and 2nd itself represent the file name. l: This option prints the number of lines present in a file. Note : When more than file name is specified in argument then command will display four-columnar output for all individual files plus one extra row displaying total number of lines, words and characters of all the files specified in argument, followed by keyword total. Passing more than one file name in the argument. Passing only one file name in the argument.
Let us consider two files having name state.txt and capital.txt containing 5 names of the Indian states and capitals respectively.