Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


Share this Page URL
Help

Appendix A: UNIX Basics > Using vi - Pg. 447

UNIXBasics·AppendixA 447 Command: tail The tail command displays the last few lines of the file given to it as an argument. Performing this command lists the last lines of the file file.txt: tail file.txt The default number of lines to display is ten, but you can specify more lines using the -l switch. Command: head The head command displays the first ten lines in a file given to it by default. The head ­n command displays the first n lines in a file to the screen. The following example specifies that we want to see the first 12 lines of the file file.txt: head -12 file.txt Command: tar The tar program provides the ability to create tar archives and various other kinds of manip- ulation. For example, you can use tar on previously created archives to extract files, to store