LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 02-17-2010, 11:53 PM   #1
smeezekitty
Senior Member
 
Registered: Sep 2009
Location: Washington U.S.
Distribution: M$ Windows / Debian / Ubuntu / DSL / many others
Posts: 2,339

Rep: Reputation: 231Reputation: 231Reputation: 231
Display every line that does not contain one of the listed words


I am trying to eliminate false lsof file records but it does not work:
Code:
lsof | grep -v "grep|lsof|fuse|cat"
 
Old 02-18-2010, 12:05 AM   #2
GrapefruiTgirl
LQ Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556
Code:
lsof | grep -v 'grep\|lsof\|fuse\|cat'
You didn't really say what doesn't work about it, but does this work?

Sasha

Last edited by GrapefruiTgirl; 02-18-2010 at 12:05 AM. Reason: EDIT -- one too many backslashes.
 
1 members found this post helpful.
Old 02-18-2010, 12:14 AM   #3
rkski
Member
 
Registered: Jan 2009
Location: Canada
Distribution: CentOS 6.3, Fedora 17
Posts: 247

Rep: Reputation: 51
try grep -e or egrep
 
1 members found this post helpful.
Old 02-18-2010, 12:17 AM   #4
smeezekitty
Senior Member
 
Registered: Sep 2009
Location: Washington U.S.
Distribution: M$ Windows / Debian / Ubuntu / DSL / many others
Posts: 2,339

Original Poster
Rep: Reputation: 231Reputation: 231Reputation: 231
Quote:
Originally Posted by GrapefruiTgirl View Post
Code:
lsof | grep -v 'grep\|lsof\|fuse\|cat'
You didn't really say what doesn't work about it, but does this work?

Sasha
That worked, thank you.
 
Old 02-18-2010, 12:51 AM   #5
GrapefruiTgirl
LQ Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556
No problem

Sasha
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
break line into words nushki Programming 16 12-04-2009 09:15 AM
Grep words and paste is on the same line say_hi_ravi Programming 7 10-31-2008 06:56 AM
copy files containing specific words in a specified line abenmao Linux - Newbie 5 08-28-2008 09:04 AM
How do I extract characters from several words on a line? MheAd Linux - Newbie 22 06-23-2008 10:22 PM
BASH: First words in a line JordanH Programming 7 10-24-2004 10:00 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:31 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration