Operating System - HP-UX
1832891 Members
2752 Online
110048 Solutions
New Discussion

size of log not re-setting

 
Chris Harris
Contributor

size of log not re-setting

i'm attempting to truncate a command pipe log with the following method:

tail -100 log > newlog
cat newlog > log.

the size of the log is not decreasing. any ideas?
1 REPLY 1
someone_4
Honored Contributor

Re: size of log not re-setting

If you are tring to trim logs this is something I got from Mr. James

# LINES=`wc -l < myfile`
# let LINES=$LINES-100 # to remove the first 100 lines...
# sed -n $LINES,'$p' myfile > myfile.trimmed

Here is the original post.

http://forums.itrc.hp.com/cm/QuestionAnswer/1,1150,0xa991e7e60861d511abcd0090277a778c,00.html
Richard