Sponsored Content
Full Discussion: grep -f CPU performances
Operating Systems Linux grep -f CPU performances Post 302262381 by manikantants on Thursday 27th of November 2008 06:06:24 AM
Old 11-27-2008
awk '{ if (NR==FNR) { my_array[$1]=$1; next;} if ( $1 in my_array ) {print $0}}' file1 file2

try above one liner. Not sure about the performance.
This User Gave Thanks to manikantants For This Post:
 

10 More Discussions You Might Find Interesting

1. AIX

ssa performances

Helo: We updated form AIX 4.3.3 to AIX 5.1-7 and after this we spent more than double time in read from external disks. Aparently the ssa cards microcode is at last level and all the ptf and apars are instaled. Out backups expent more than double time, but curiously in read only, if we write in... (0 Replies)
Discussion started by: Javier Gutierre
0 Replies

2. UNIX for Dummies Questions & Answers

grep Vs CPU usage

Hi, I have one basic doubt, that using grep command frequently , will it have direct impact on the CPU load, pls clarify for eg, if i run a non stop script containing while loop to grep some parameters, what will be the load in CPU.. thanks (3 Replies)
Discussion started by: vasikaran
3 Replies

3. UNIX for Dummies Questions & Answers

how to get persistant cpu utilization values per process per cpu in linux (! top,ps)

hi, i want to know cpu utilizatiion per process per cpu..for single processor also if multicore in linux ..to use these values in shell script to kill processes exceeding cpu utilization.ps (pcpu) command does not give exact values..top does not give persistant values..psstat,vmstat..does njot... (3 Replies)
Discussion started by: pankajd
3 Replies

4. Solaris

Multi CPU Solaris system shows 100% CPU usage.

Hello Friends, On one of my Solaris 10 box, CPU usage shows 100% using "sar", "vmstat". However, it has 4 CPUs and prstat and glance are not showing enough processes to justify high CPU utilization. ========================================================================= $ prstat -a ... (4 Replies)
Discussion started by: mahive
4 Replies

5. Solaris

Performances with RAID 5

Hello every body, Maybe someone could help me. I have a SUN Server with 6 disks, each of 150 Gb. I have mounted the first two disk in mirror (RAID1) for the system files. I have mounted 3 disks in RAID5 for users file systems. I kept the last one as spare and I have mounted it standalone... (6 Replies)
Discussion started by: aribault
6 Replies

6. UNIX for Advanced & Expert Users

File alignment and performances... (difficult)

Hello ! I will use my best english possible to explain my objective. I'm french so pardon for the lack of precision... So, what i would like to do in shell script (but you will possibly answer ''not possible in script'' have to use low level langage or something like that) is described below.... (3 Replies)
Discussion started by: Gnaag
3 Replies

7. UNIX for Dummies Questions & Answers

Need suggestion about grep and CPU usage

guys i need suggestion about how to grep cpu usage and then compare it example : if cpu usage <= 40% then print normal and how much cpu usage is or cpu usage between 40%-65% print normal and much cpu usage is i've tried like this one but got error DOMAIN=`uname -n`... (9 Replies)
Discussion started by: ashary
9 Replies

8. UNIX and Linux Applications

grep hogs entire cpu

How can grep hog your entire cpu? I am absolutely shocked by this. (11 Replies)
Discussion started by: cokedude
11 Replies

9. UNIX for Dummies Questions & Answers

Is it possible to combine multiple CPU to act as a single CPU on the same server?

We have a single threaded application which is restricted by CPU usage even though there are multiple CPUs on the server, hence leading to significant performance issues. Is it possible to merge / combine multiple CPUs at OS level so it appear as a single CPU for the application? (6 Replies)
Discussion started by: Dissa
6 Replies

10. UNIX for Beginners Questions & Answers

Why Entitlement CPU can't be set to same as Virtual CPU?

I read that Entitlement CPU should be set to max 75% compare to Virtual CPU. May I know the reason. I have set the Entitlement CPU = Virtual CPU on AIX . It works fine . Can you help to understand. (1 Reply)
Discussion started by: gabhanes
1 Replies
comm(1) 							   User Commands							   comm(1)

NAME
comm - select or reject lines common to two files SYNOPSIS
comm [-123] file1 file2 DESCRIPTION
The comm utility reads file1 and file2, which must be ordered in the current collating sequence, and produces three text columns as output: lines only in file1; lines only in file2; and lines in both files. If the input files were ordered according to the collating sequence of the current locale, the lines written will be in the collating sequence of the original lines. If not, the results are unspecified. OPTIONS
The following options are supported: -1 Suppresses the output column of lines unique to file1. -2 Suppresses the output column of lines unique to file2. -3 Suppresses the output column of lines duplicated in file1 and file2. OPERANDS
The following operands are supported: file1 A path name of the first file to be compared. If file1 is -, the standard input is used. file2 A path name of the second file to be compared. If file2 is -, the standard input is used. USAGE
See largefile(5) for the description of the behavior of comm when encountering files greater than or equal to 2 Gbyte ( 2**31 bytes). EXAMPLES
Example 1: Printing a list of utilities specified by files If file1, file2, and file3 each contain a sorted list of utilities, the command example% comm -23 file1 file2 | comm -23 - file3 prints a list of utilities in file1 not specified by either of the other files. The entry: example% comm -12 file1 file2 | comm -12 - file3 prints a list of utilities specified by all three files. And the entry: example% comm -12 file2 file3 | comm -23 -file1 prints a list of utilities specified by both file2 and file3, but not specified in file1. ENVIRONMENT VARIABLES
See environ(5) for descriptions of the following environment variables that affect the execution of comm: LANG, LC_ALL, LC_COLLATE, LC_CTYPE, LC_MESSAGES, and NLSPATH. EXIT STATUS
The following exit values are returned: 0 All input files were successfully output as specified. >0 An error occurred. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWesu | +-----------------------------+-----------------------------+ |CSI |enabled | +-----------------------------+-----------------------------+ |Interface Stability |Standard | +-----------------------------+-----------------------------+ SEE ALSO
cmp(1), diff(1), sort(1), uniq(1), attributes(5), environ(5), largefile(5), standards(5) SunOS 5.10 3 Mar 2004 comm(1)
All times are GMT -4. The time now is 07:47 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy