Call now: 252-767-6166  
Oracle Training Oracle Support Development Oracle Apps

 
 Home
 E-mail Us
 Oracle Articles
New Oracle Articles


 Oracle Training
 Oracle Tips

 Oracle Forum
 Class Catalog


 Remote DBA
 Oracle Tuning
 Emergency 911
 RAC Support
 Apps Support
 Analysis
 Design
 Implementation
 Oracle Support


 SQL Tuning
 Security

 Oracle UNIX
 Oracle Linux
 Monitoring
 Remote s
upport
 Remote plans
 Remote
services
 Application Server

 Applications
 Oracle Forms
 Oracle Portal
 App Upgrades
 SQL Server
 Oracle Concepts
 Software Support

 Remote S
upport  
 Development  

 Implementation


 Consulting Staff
 Consulting Prices
 Help Wanted!

 


 Oracle Posters
 Oracle Books

 Oracle Scripts
 Ion
 Excel-DB  

Don Burleson Blog 


 

 

 


 

 

 
 


Viewing Linux Files with head & tail

Expert Oracle Tips by Burleson Consulting

March 22, 2011

Viewing Linux Files with the head and tail command

Often, especially with large log files, 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  

elfutils-libelf-devel-0.97.1-5.i386.rpm
glibc-headers-2.3.4-2.41.i386.rpm
glibc-kernheaders-2.4-9.1.103.EL.i386.rpm will be required as a
prerequisite
glibc-devel-2.3.4-2.41.i386.rpm
gcc-3.4.6-10.i386.rpm
libstdc++-devel-3.4.6-10.i386.rpm
gcc-c++-3.4.6-10.i386.rpm
libaio-devel-0.3.105-2.i386.rpm
sysstat-5.0.5-19.el4.i386.rpm
unixODBC-devel-2.2.11-1.RHEL4.1.i386.rpm

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.

Of course, there will be times where the beginning of a file rather than the end needs to be seen.  For this, use the head command.

$ head required_packages.txt  

REHEL4, OEL4:
Refer to Note 880211.1 

binutils-2.15.92.0.2-25
compat-libstdc++-33-3.2.3-47.3
elfutils-libelf-0.97.1-5
glibc-2.3.4-2.41
glibc-common-2.3.4-2.41
libaio-0.3.105-2
libgcc-3.4.6-10

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.

 

 
 
 
Get the Complete Details on
Linux System Management for Oracle DBAs  


The landmark book "Linux for the Oracle DBA: The Definitive Reference" provides comprehensive yet specific knowledge on administering Oracle on Linux.   A must-have reference for every DBA running or planning to run Oracle on a Linux platform.

Buy it for 30% off directly from the publisher.
 


 

 

Burleson is the American Team

Note: This Oracle documentation was created as a support and Oracle training reference for use by our DBA performance tuning consulting professionals.  Feel free to ask questions on our Oracle forum.

Verify experience! Anyone considering using the services of an Oracle support expert should independently investigate their credentials and experience, and not rely on advertisements and self-proclaimed expertise. All legitimate Oracle experts publish their Oracle qualifications.

Errata?  Oracle technology is changing and we strive to update our BC Oracle support information.  If you find an error or have a suggestion for improving our content, we would appreciate your feedback.  Just  e-mail:  

and include the URL for the page.


                    









Burleson Consulting

The Oracle of Database Support

Oracle Performance Tuning

Remote DBA Services


 

Copyright © 1996 -  2017

All rights reserved by Burleson

Oracle ® is the registered trademark of Oracle Corporation.

Remote Emergency Support provided by Conversational

 

 

��  
 
 
Oracle Training at Sea
 
 
 
 
oracle dba poster
 

 
Follow us on Twitter 
 
Oracle performance tuning software 
 
Oracle Linux poster