grepping for something but excluding something else in the line


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers grepping for something but excluding something else in the line
# 1  
Old 09-28-2004
grepping for something but excluding something else in the line

Ok heres the situation.

I'm grepping for all running processes with the name system. but there are also processes running with the name systema. How do I just search for processes running just under the "system" user

Thanks in advance
# 2  
Old 09-28-2004
How about:
ps -ef | grep '[s]ystem' | grep -v systema
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

extracting part of a line excluding particular word from it

here is the line on which i want to process `empNo` int(13) NOT NULL AUTO_INCREMENT, it sometimes doesnt have comma at the end too `empNo` int(13) NOT NULL AUTO_INCREMENT i want to extract all except "AUTO_INCREMENT" not only this line i ,want the code to work on any line if it has... (5 Replies)
Discussion started by: vivek d r
5 Replies

2. Shell Programming and Scripting

Print part of line excluding one column

Hi, I have data which is having '|' as delimiter and have lobfilename/locations in the data. Ex: 1200|name1|lobfilename.0.600|abcd 1201|name2|lobfilename.600.1300|abcd My requirement is to print part of the line till the lobfilename and write to a different file and also print the... (4 Replies)
Discussion started by: newb
4 Replies

3. Shell Programming and Scripting

Returning only part of a line when grepping

I want to grep out a part of a snort rule based on the SID given, but all i want as the output is the part in the quotes after the msg: An example line looks something like this: alert tcp any any -> 127.0.0.1 any (msg:"Example Message"; classtype:Example; sid:123456;) I would want it to... (7 Replies)
Discussion started by: riott
7 Replies

4. UNIX for Advanced & Expert Users

Insert a line grepping a file

Hi I have a file name file1.txt & file2.txt which looks like below file1.txt Name=alan Name=math Name=don file2.txt afdsfsdf asdfasdfsd sdfsd dsfas Now I have to grep for all the names and insert a line in file2.txt for each name after line3 as follows file2.txt (2 Replies)
Discussion started by: ammu
2 Replies

5. Shell Programming and Scripting

Grepping Multiple Strings on the Same Line 'Or'

I've got this command that I've been using to find strings on the same line, say I'm doing a search for name: find . -name "*" | xargs grep -i "Doe" | grep -i "John" > output.txt This gives me every line in a file that has John and Doe in it. I'm looking to add a OR operator for the second... (5 Replies)
Discussion started by: Rally_Point
5 Replies

6. Shell Programming and Scripting

Grepping for two strings that MUST exist on the same line

Trying to find a way to grep for two names on a line. Both names must appear on the same line so '|' / OR is out. So far, I'm just messing around and I've got find . -name "*" | xargs grep "Smith" Let me explain. I'm at a top level and need to know all the names of the files that... (6 Replies)
Discussion started by: Rally_Point
6 Replies

7. UNIX for Dummies Questions & Answers

Grepping nth line number

How do you grep every nth line number from a file? (2 Replies)
Discussion started by: shabs1985
2 Replies

8. UNIX for Dummies Questions & Answers

Help with grepping and line number

I need help with extracting data from a large file ~900mb. Below is how the data looks like, line number value 1001 10000 ... ... 5001 50000 6001 60000 ... ... 10001 100000 ... ... 100001 ... (3 Replies)
Discussion started by: shabs1985
3 Replies

9. Shell Programming and Scripting

reading line by line and grepping

I've got a file which I am reading line by line (using read line) into a variable. I then want to do a grep on that line to check for something. I've tried a number of methods none of which seem to work. I thought I had it with the code below but for some reason it doesn't like it and comes... (4 Replies)
Discussion started by: QueryMaster
4 Replies

10. Shell Programming and Scripting

Grepping 1 line above and below pattern

I have a pattern:: xldn3176bap>arj SOCRATES_MAIN_LNX | grep " FA " 10/04/2007 21:01 10/04/2007 21:01 FA 1776752/1 1 I want the line above this line and the line below it too. Can anyone tell me how it can be done? - iAm4Free (4 Replies)
Discussion started by: iAm4Free
4 Replies
Login or Register to Ask a Question