176 Part II . Getting Around in (Web host 4 life) Linux
176 Part II . Getting Around in Linux Viewing the beginning of a file The head utility allows you to view the beginning of a file to aid with identification or other purposes. By default, the first ten lines of a file are displayed. It is important to remember that a line is everything before the line feed character, so the actual output could be much more than ten lines of display. Using options, it is possible to specify the number of lines displayed among other things. The options used with the headutility are covered in Table 4-8. Table 4-8 Options Used with head Option Use -n NUMBER Displays the first NUMBER of lines specified. -q Specifies that the header is not to be displayed. -v Specifies that the header is to be displayed. –help Displays help information and exits. –version Displays version information and exits. -c NUMBER Displays the first NUMBER of bytes specified. An example of the use of this file is shown below. In this example the first three lines of the nameslist file are displayed. The -v option is used to display the filename located in the header. # head -n 3 -v nameslist ==> nameslist <== Scott Bessler Jason Nash Angie Nash Viewing the end of a file There is also a utility that allows you to view the end of a file. Like head, the tail utility displays the last ten lines of a file by default. There are also several options used with the tailutility; these options, which are displayed in Table 4-9, allow more control of the data displayed.
Check Tomcat Web Hosting services for best quality webspace to host your web application.