[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: How to compare the output of two commands?



hi ya


On Mon, 17 Apr 2006, Sonixxfx wrote:

> To be more specific I want to compare a list like this, but much longer, to
> another list of text that has the same structure:
> 
> /usr
> /usr/share
> /usr/share/doc
> /usr/share/doc/unzip
> /usr/share/doc/unzip/copyright
> /usr/share/doc/unzip/BUGS
> /usr/share/doc/unzip/ToDo
> /usr/share/doc/unzip/changelog.Debian.gz

PC-1# find /usr -print | sort > /tmp/list-1.txt

PC-2# find /usr -print | sort > /tmp/list-2.txt

	- use -type options to skip stuff
	- use grep -iv to skip stuff

copy the list-1.txt into PC2

diff /tmp/list-1.txt /tmp/list-2.txt

if you want to check for time stamps and permissions,
use --l  

	find /usr -print | xargs ls -la /usr --l

or solve the probelm one of hundred other ways

c ya
alvin



Reply to: