- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- comm command
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
03-20-2007 11:40 PM
03-20-2007 11:40 PM
comm command
fileA -
11
33
44
55
77
fileB -
22
34
45
55
56
66
77
778
888
999
output:
11
33
44
so print to output line from fileA if it is not in fileB..
thnaks a lot..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2007 11:46 PM
03-20-2007 11:46 PM
Re: comm command
try;
$ comm -23 fileA fileB
regards,
John K.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2007 11:55 PM
03-20-2007 11:55 PM
Re: comm command
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2007 12:06 AM
03-21-2007 12:06 AM
Re: comm command
a sorted file in the sight of 'comm' is a collated sort. If you have a numerical sorted input like
9
88
100
it's complete out of order in lexical (=comm) sense.
mfG Peter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2007 01:21 AM
03-21-2007 01:21 AM
Re: comm command
Thanks a lot!!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2007 01:35 AM
03-21-2007 01:35 AM
Re: comm command
seems you have a duplicate at:
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=1110742
Have you tried:
grep -vf fileB fileA
How big are both of your files ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2007 09:53 AM
03-21-2007 09:53 AM
Re: comm command
Yes. The above fragments were sorted by ASCII. To check you can use:
$ sort -c fileA; echo $?
$ sort -c fileB; echo $?
>Peter G: Have you tried: grep -vf fileB fileA
>How big are both of your files?
With a million lines, that may be too big.
Using sort & comm instead, may depend on how often these files change.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2007 10:22 AM
03-21-2007 10:22 AM
Re: comm command
# grep -v -f fileB fileA
11
33
44
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2007 10:45 AM
03-21-2007 10:45 AM
Re: comm command
# time comm -13 sortedListA sortedListB
123456
15
3999966
real 0.8
user 0.7
sys 0.0
# time comm -13 bigListA bigListB
15
123456
3999966
real 0.7
user 0.7
sys 0.0
# time grep -v -f bigListA bigListB
grep: not enough memory
real 9:57.2
user 9:53.2
sys 0.6
Looks to me as if the two files need to have the same sort order, that grep can't stomach comparing two really big files, and 8 gig of RAM just isn't what it used to be.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2007 12:56 PM
03-21-2007 12:56 PM
Re: comm command
sort doesn't use a bubble sort. ;-)
So it maybe takes n1 * log(n1) + n2 * log(n2)
Doing a grep requires comparing every record in fileA with everyone in fileB (perhaps 50% if it matches, 100% if it doesn't).
comm only needs to compare with records up to the match.