HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Trim application log files on HP-UX 11.0
Operating System - HP-UX
1834593
Members
4408
Online
110069
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-03-2004 11:06 PM
08-03-2004 11:06 PM
Trim application log files on HP-UX 11.0
I want to trim application log file in /var/adm/syslog/app.log .
But tail -10000 /var/adm/syslog/app.log > /tmp/app.log.trim does not work as tail -10000 takes only few number of last lines,not last 10000 lines from log file.
I am using HP-UX 11.0.It seems only buffer of 20K is reserved for this tail program.
But tail -10000 /var/adm/syslog/app.log > /tmp/app.log.trim does not work as tail -10000 takes only few number of last lines,not last 10000 lines from log file.
I am using HP-UX 11.0.It seems only buffer of 20K is reserved for this tail program.
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-03-2004 11:09 PM
08-03-2004 11:09 PM
Re: Trim application log files on HP-UX 11.0
Use -n to specify the number of lines.
tail -n 10000 /var/adm/syslog/app.log > /tmp/app.log.trim
sks
tail -n 10000 /var/adm/syslog/app.log > /tmp/app.log.trim
sks
A rigid mind is very sure, but often wrong. A flexible mind is generally unsure, but often right.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-03-2004 11:16 PM
08-03-2004 11:16 PM
Re: Trim application log files on HP-UX 11.0
From the man page:
" WARNINGS
Tails relative to end-of-file are stored in a 20-Kbyte buffer, and
thus are limited in length."
Pete
Pete
" WARNINGS
Tails relative to end-of-file are stored in a 20-Kbyte buffer, and
thus are limited in length."
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-03-2004 11:17 PM
08-03-2004 11:17 PM
Re: Trim application log files on HP-UX 11.0
Hi
reverse it
make this a script with file as parameter 1 and lines as parameter 2
file=$1
typeset lines=$2
typeset -i x=$(cat $file|wc -l)
typeset -i z=$x-$lines+1
tail -n +$z $file
Steve Steel
reverse it
make this a script with file as parameter 1 and lines as parameter 2
file=$1
typeset lines=$2
typeset -i x=$(cat $file|wc -l)
typeset -i z=$x-$lines+1
tail -n +$z $file
Steve Steel
If you want truly to understand something, try to change it. (Kurt Lewin)
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP