Solved

Advanced grep-ing

Posted on 2015-02-12
2
93 Views
Last Modified: 2015-02-12
when I put this
grep "SSERV" . -RI

Open in new window

I get this

./super_html_4.c:  /* Note: operations SSERV_OP_USER_*, SSERV_OP_GROUP_* are loaded using dlsym */
./super_html_4.c:    if (val <= 0 || val >= SSERV_OP_LAST) return S_ERR_INV_OPER;
./super_html_4.c:  for (int i = 1; i < SSERV_OP_LAST; ++i) {
./super_html_4.c:        || opcode <= 0 || opcode >= SSERV_OP_LAST)
./super_html_4.c:      if (redir_opcode <= 0 || redir_opcode >= SSERV_OP_LAST || !super_proto_op_names[redir_opcode]) {
./super_proto.c.2.back:  if (n >= SSERV_ERR_LAST) {
./super_proto.c.2.back:const unsigned char * const super_proto_op_names[SSERV_OP_LAST] =
./super_proto.c.2.back:  [SSERV_OP_VIEW_CNTS_DETAILS] = "VIEW_CNTS_DETAILS",
./super_proto.c.2.back:  [SSERV_OP_EDITED_CNTS_BACK] = "EDITED_CNTS_BACK",
./super_proto.c.2.back:  [SSERV_OP_EDITED_CNTS_CONTINUE] = "EDITED_CNTS_CONTINUE",
./super_proto.c.2.back:  [SSERV_OP_EDITED_CNTS_START_NEW] = "EDITED_CNTS_START_NEW",
./super_proto.c.2.back:  [SSERV_OP_LOCKED_CNTS_FORGET] = "LOCKED_CNTS_FORGET",
./super_proto.c.2.back:  [SSERV_OP_LOCKED_CNTS_CONTINUE] = "LOCKED_CNTS_CONTINUE",

But, there are a lot of redundant information, duplicate file name. I want to get only list of file names, and every entry in this list must be unique.
How to achieve this goal.
0
Comment
Question by:Nusrat Nuriyev
2 Comments
 
LVL 68

Accepted Solution

by:
woolmilkporc earned 400 total points
ID: 40606782
grep -RIl "SSERV"  .

"l" (lowercase l as in "list") means: list only names of files with matching content
0
 
LVL 84

Assisted Solution

by:ozo
ozo earned 100 total points
ID: 40606783
grep -l
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Utilizing an array to gracefully append to a list of EmailAddresses
Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now