Many times your only interest is in seeing the end of a file.
To view just the last handful of lines in a file, use the tail command.
$ tail required_packages.txt
glibc-kernheaders-2.4-9.1.103.EL.i386.rpm will be required as a
By default, tail displays the last 10 lines of a file. This is a great way to look at recent entries in Oracle database alert logs.
If more than 10 lines need to be seen, specify a number of lines as an option. For example, tail -15 required_packages.txt will show the last 15 lines of the file required_packages.txt.
When a log file is being actively written to, like with an alert log, displaying new lines on the screen as they are written to the file may be preferred.
To do that, add the -f option to the tail command like this: tail -f alert_TEST.log. This allows the monitoring of a log in near real time, though sometimes lines may appear too quickly to read.
The head command defaults to displaying the first 10 lines of the specified file. Like with tail, the default can be overridden and more lines or fewer lines can be displayed by adding a number as an option.
For example, head -5 required_packages.txt will display only the first five lines of the file.