Web hosting - Chapter 4 . Processing Text 183 Displaying numeric

Chapter 4 . Processing Text 183 Displaying numeric details of a file The wc utility counts the number of bytes, white space separated words, and line feed characters in each given file. It prints one line of counts for each file, and if the file was given as an argument, it prints the filename following the counts. If more than one file is given, the utility prints a final line containing the cumulative counts, with the filename total. The counts are printed in this order: line feed characters, words, and bytes. By default, each count is output right-justified in a 7-byte field with one space between fields so that the numbers and filenames line up nicely in columns. Several of the options available with the wc utility are shown below in Table 4-15. Table 4-15 Options Used with wc Option Use -w Displays only the word count. -l Displays only the line count. -L Displays the length of the longest line. –help Displays help information and then exits. –version Displays version information and then exits. -c Displays only the byte count. The following are examples of the use of the wc utility. # wc nameslist 15 30 203 nameslist #wc -c nameslist 203 nameslist #wc -L nameslist 16 nameslist Adding line numbers to a file The nl utility is useful for displaying line numbers in a file. This utility displays a file with line numbers added to each line. The utility breaks its input into logical pages. By default, the line number is reset to 1 at the top of each logical page. It treats all of the input files as a single document and does not reset line numbers or logical pages between files.
From our experience, we are can tell you that you can find a reliable and cheap webhost service at Java Web Hosting services.

Leave a Reply