![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Remove last blank line of file | ruchimca | Shell Programming and Scripting | 2 | 04-08-2009 10:30 PM |
| Remove blank line - SED | pcwiz | Shell Programming and Scripting | 10 | 11-11-2008 11:19 PM |
| How to allocate memory | ravi3553 | UNIX for Advanced & Expert Users | 5 | 08-19-2008 10:09 AM |
| how allocate virtual memory | munnu | High Level Programming | 2 | 04-20-2007 04:07 PM |
| Unix Help - allocate more memory to /tmp | cmackin | UNIX for Dummies Questions & Answers | 1 | 06-01-2006 07:25 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
I've shell script where i used the below command to take the line which contains patterns.
Code:
sed -n "/$year 05:/,/$year 17:/p" trace.log | grep -f patterns.txt > output.log sed: Couldn't re-allocate memory when I looked for the file size its huge now a days, usually it will be less than or equal to 1.5 GB. but now a days its Code:
$lt trace.log 6.9G Aug 18 00:31 trace.log Code:
$grep -av "^$" trace.log > ~/temp.tmp $cat temp.tmp Binary file trace.log matches $sed '/^$/d' /logs/gopm/trace.log > ~/temp.tmp sed: Couldn't re-allocate memory $ thanks Senthil |
|
||||
|
Even I tired the sed command alone which gives me memory error, i grepped for only empty line to a temp directory the file size is coming around 740 MB, so i think we can remove the blank lines whihc will eliminate the issue, but i dont know how to do this.
Thanks Senthil. |
|
||||
|
Spliting the file is a very good option, but the problem is the sed where i'm taking 5:00 to 17:00 time log wont work at all. Becuase i dont know what time string will be come in the first and last line.
Also the main concern here is the space, i wont have enough space in my /home directory where i work for the temp.log file bash-2.05$ grep -ve "^[ \t]*$" /logs/trace.log | grep -f ~/patterns.txt >~/temp.log bash-2.05$ cat temp.log but this command is generating a empty file bash-2.05$ cat temp.log bash-2.05$ |
|
||||
|
Franklin, could you please explain me the awk statement, cause the command is taking almost 99 % of CPU when i executed
Code:
$ ps -aux| grep 9919 sayyavu 9919 99.9 0.5 34768 22672 pts/5 R 03:22 3:07 awk -v Y= ?$0 ~ Y Code:
7811 CMA: 08/19/2009 03:30:54 UserValidationFilter.validateUser 7811 CMA: 08/19/2009 03:30:54 UserValidationFilter.getCookieValue entry 7811 CMA: 08/19/2009 03:30:54 UserValidationFilter.getCookieValue exit 7811 CMA: 08/19/2009 03:30:54 UserValidationFilter.validateUser 7811 CMA: 08/19/2009 03:30:54 UserValidationFilter.validateUser Current Session is Not New 7811 CMA: 08/19/2009 03:30:54 UserValidationFilter.validateUser Session Id from SSO null 7811 CMA: 08/19/2009 03:30:54 UserValidationFilter.validateUser Before sm_universalid 7811 CMA: 08/19/2009 03:30:54 UserValidationFilter.validateUser After sm_universalid 7811 CMA: 08/19/2009 03:30:54 UserValidationFilter.validateUser exit 6332 PrePr: 08/19/2009 03:30:54 ValidateUserRequestProcessor.processPreprocess entry 6332 PrePr: 08/19/2009 03:30:54 ValidateUserRequestProcessor.getGuid Code:
sed -n "/$year 05:/,/$year 17:/p" trace.log senthil. |
![]() |
| Bookmarks |
| Tags |
| grep -v, sed awk bash shell |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|