- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- how to reduce a large file
Categories
Company
Local Language
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
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
Community
Resources
Forums
Blogs
- 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-01-2002 10:57 PM
08-01-2002 10:57 PM
(Sorry for my english, i hope you'll understand it)
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2002 11:06 PM
08-01-2002 11:06 PM
Re: how to reduce a large file
Copy it to another name and then use
tail +n 1000001 newfile > oldfile
rm newfile
see man tail
Steve Steel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2002 11:07 PM
08-01-2002 11:07 PM
Re: how to reduce a large file
mv file.new file
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2002 11:09 PM
08-01-2002 11:09 PM
SolutionThe alert log is constantly being help open/possibly written to so I dont think you want to rm it. Simply null it out by doing;
cat /dev/null >alert_baan.log
This will make the logfile 0 bytes in size but not remove it so that any running processes using this logfile can still use it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2002 11:24 PM
08-01-2002 11:24 PM
Re: how to reduce a large file
#tail +n 1000000 file > newfile
#mv newfile file
should do the job
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2002 11:31 PM
08-01-2002 11:31 PM
Re: how to reduce a large file
Yes, the commands (as stated above) are:
tail +1000000 alert_baan.log > myfile
mv myfile alert_baan.log
I would put it in a script so as to minimise the time between commands, otherwise you might overwrite some logs that are added to the end of the original file before you mv the new file over it.
Cheers!
James
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2002 11:36 PM
08-01-2002 11:36 PM
Re: how to reduce a large file
# sed -n '1000000,$ p' alert_baan.log > new_file
# mv new_file alert_baan.log
Regards,
Kenneth
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2002 11:43 PM
08-01-2002 11:43 PM
Re: how to reduce a large file
You can do it by using ed, in order to do it try this:
echo "1, 1000000 d\nw" | ed alert_baan.log
Hope this helps you,
Justo.
Deber??as adjudicar puntos a las soluciones que te dan, esas son las reglas y recomendaciones del foro y si no lo haces podr??as dejar de obtener ayuda.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2002 11:46 PM
08-01-2002 11:46 PM
Re: how to reduce a large file
Later,
Bill
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-02-2002 12:07 AM
08-02-2002 12:07 AM
Re: how to reduce a large file
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-02-2002 12:47 AM
08-02-2002 12:47 AM
Re: how to reduce a large file
ERRORLOG=/opt/ROBIN/log
for LOGNAME in $(ls $ERRORLOG | grep rerr)
do
date +Logday=%.1j >> $ERRORLOG/$LOGNAME
done
The script attached is then run 30 minutes later.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-02-2002 12:51 AM
08-02-2002 12:51 AM
Re: how to reduce a large file
Just, I have entered to see the answers 4 times and the four times I have assigned points, soon thorn in submit, hope to that it leaves the following screen and I close the explorer, but have observed that when I return to enter, them point do not appear, follows seeming the button to assign them. I feel it but not what I make bad so that they do not appear. If me indicais how to do it correctly I return to a to sign them. To and thanks to all, all the solutions are been worth although I have used the one of cat/dev/nul >
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-02-2002 12:54 AM
08-02-2002 12:54 AM
Re: how to reduce a large file
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-02-2002 01:03 AM
08-02-2002 01:03 AM