Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 12-03-2014, 09:01 AM   #1
Registered: Apr 2014
Distribution: Debian GNU/Linux 7.5 (wheezy)
Posts: 236

Rep: Reputation: Disabled
Extract every record except

I know how to extract every record that contains a pattern:

grep "404" <f1> > <f2>

But is there a way to extract every record that doesn't contain the pattern?

Old 12-03-2014, 09:28 AM   #2
Registered: Aug 2010
Location: Netherlands
Distribution: Kubuntu, Debian, Suse, Slackware
Posts: 317

Rep: Reputation: 73

Read the man page of grep and pay special attention to the -v option.

Old 12-03-2014, 09:59 AM   #3
Registered: Apr 2014
Distribution: Debian GNU/Linux 7.5 (wheezy)
Posts: 236

Original Poster
Rep: Reputation: Disabled
Thanks. Just to leave an example:

echo "$(grep -v "\*" <f1>)"

This displayed every line in file <f1> that didn't contain an asterisk.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
How To Create MX Record In CentOs so i can use it on my domain txt record? ASTRAPI Linux - Server 3 07-11-2014 11:01 AM
[SOLVED] DNS: A Record and PTR Record hydraMax Linux - Server 4 12-21-2010 11:28 PM
how to make resolver ask for A record before AAAA record Skaperen Linux - Networking 25 03-02-2010 07:36 PM
DDNS record and a static PTR record mou5e Linux - Networking 2 01-22-2008 02:16 AM
Unable to record mic-in with SoundBlaster Live! while able to record other sources max76230 Linux - Newbie 2 03-14-2005 05:31 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:40 PM.

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