Re: how would one list all lines in one file not in another file?



On Jul 24, 8:43 pm, Stefan Patric <n...@xxxxxxxxxxxxxxx> wrote:
On Thu, 24 Jul 2008 12:12:09 -0700, jameshanley39 wrote:
hi

with what command/commands and how would one list all lines in one file
not in another file?

note- this would be useful were one comparing files in one directory and
not another

btw- are there any command to compare 2 directories.. list files in one
and not the other (I could do that from each directory to list files not
shared by both).

(I refer to files with full relative file path with filename, and not
the file contents itself, and not matching a file in one position of a
directory to a file of the same filename elsewhere in the other
directory.  ).

The problem (or asset, depends on how you look at it) with Linux/Unix is
the plethora of commands to do almost anything and find that one or few
that want you need to be done.  Start your search with these basic
commands:  diff, find, grep, egrep, fgrep, and gawk.  Familiarize
yourself on the use of "the pipe" symbol '|' with which you can "pipe"
the output from one command to another.  You should also study shell
scripting and a particular shell's built-in commands to automate your
searches and save typing, if you intend to do this a lot.

Stef-

I am a bit familiar with pipes and basic use of shell scripts and
grep.

People give grep a pattern and a file or data to find the pattern in,
but how do you tell grep to take each line of a file as its pattern to
look for ?

It looks like I might do something like that to list all lines in one
file and not another, wouldn't know how though.

thanks



.