January 10, 201412 yr Using head you can find out quickly what's in a file by viewing the top few lines. To view the beginnings with head: head filename At the shell prompt, type head followed by the filename. By default you'll see the first ten lines on the screen. To view a specified number of lines: head -20 filename Add -20 (or whatever number of lines you want to view) to view a specific number of lines To view the beginnings of multiple files: head filename* | more You can view the tops of multiple files by piping head (plus filenames) to more.
Create an account or sign in to comment