nixCraft Linux Forum

nixCraft

Linux Tech Support Forum

diff command to exclude files that match pattern

This is a discussion on diff command to exclude files that match pattern within the Getting started tutorials forums, part of the Linux Getting Started category; file1: hello /a/b/c/d/file.log hello /a/b/c/d/file.log1 hello /a/b/c/d/1file.log hello /a/b/c/d/1file.log1 hello /a/b/c/d/file.tmp hello /a/c/d/file.tmp hello /a/c/g/file.tmp file2: hi /a/b/c/d/file.log hi /a/b/c/d/file.log1 ...


Go Back   nixCraft Linux Forum > Linux Getting Started > Getting started tutorials

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 08-13-2007, 03:21 PM
Junior Member
User
 
Join Date: Jul 2007
My distro: Redhat
Posts: 8
Rep Power: 0
piggy is on a distinguished road
Default diff command to exclude files that match pattern

file1:
hello /a/b/c/d/file.log
hello /a/b/c/d/file.log1
hello /a/b/c/d/1file.log
hello /a/b/c/d/1file.log1
hello /a/b/c/d/file.tmp
hello /a/c/d/file.tmp
hello /a/c/g/file.tmp

file2:
hi /a/b/c/d/file.log
hi /a/b/c/d/file.log1
hi /a/b/c/d/1file.log
hi /a/b/c/d/1file.log1
hi /a/b/c/d/file.tmp
hi /a/c/d/file.tmp
hello /a/c/g/file.tmp

how do i use diff to exclude /a/b/c/d/*log*
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 08-13-2007, 10:52 PM
nixcraft's Avatar
Never say die
User
 
Join Date: Jan 2005
Location: BIOS
My distro: Any distro with shell
Posts: 901
Rep Power: 10
nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute
Default

Use -x option
Code:
diff -x 'pattern' file1 file2
diff -x '/a/b/c/d/*log*' file1 file2
__________________
Vivek | My personal blog
Linux Evangelist
Play hard stay cool
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

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 On
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

Thread Thread Starter Forum Replies Last Post
How to match two fields Prahlad Shell scripting 3 04-09-2008 12:58 PM
pattern search with numbers mercuryshipz Coding in General 0 02-14-2008 11:16 PM
Search Pattern And Arrays mercuryshipz Coding in General 1 02-11-2008 02:26 PM
match the columns of 2 files and merge common rows piyali_biobase Shell scripting 0 11-05-2007 06:34 PM
How to find different type of words (pattern matching) in vi sweta Linux software 2 06-07-2005 10:22 PM


All times are GMT +5.5. The time now is 06:49 AM.


Powered by vBulletin® Version 3.7.2 - Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36