The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
list the files but exclude the files in subdirectories shyjuezy UNIX for Dummies Questions & Answers 8 10-15-2008 01:42 PM
Photoplus: Auxiliary Information for Printed Images Based on Distributed Source Codin iBot UNIX and Linux RSS News 0 01-22-2008 11:20 PM
du (exclude files) the_learner UNIX for Advanced & Expert Users 1 07-17-2007 02:06 PM
Exclude & Zip dreams5617 Shell Programming and Scripting 1 02-11-2007 08:01 PM
lp - order of files printed mabrownawa UNIX for Advanced & Expert Users 2 02-16-2004 12:08 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 09-18-2005
umen umen is offline
Registered User
  
 

Join Date: Aug 2005
Posts: 239
How to exclude files from printed results

Hello
I have application that part of its command I can get list of files to the stout . with the path .
like :
./blah/blah/foo.c
./blah11/blah11/foo11.c
./blah12/blah12/foo11.h

now I will like to filter this result and for instance see the "*.h" file or the "*.c" file or only the files that starts with foo
Thanks
  #2 (permalink)  
Old 09-18-2005
stolz stolz is offline
Registered User
  
 

Join Date: Sep 2005
Posts: 4
pipe through grep

if you pipe to grep -v what you dont want you will get the desired effect.

ie if you didnt want to see files called foo.c you would grep -v foo.c and get the following output:

./blah11/blah11/foo11.c
./blah12/blah12/foo11.h
  #3 (permalink)  
Old 09-18-2005
zazzybob's Avatar
zazzybob zazzybob is offline Forum Advisor  
Registered Geek
  
 

Join Date: Dec 2003
Location: Melbourne, Australia
Posts: 2,100
But if you wanted files that start with foo, can contain anything else, and end in .c or .h, then use a regular expression to grab what you want.

e.g.
Code:
my_command_that_produces_some_output | grep "/foo.*\.[ch]$"
Either way, grep is what you want.

Cheers
ZB
Sponsored Links
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 08:13 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0