Re: how to select files not in a list
From: William Park (opengeometry_at_yahoo.ca)
Date: 04/29/04
- Next message: Joe Davison: "bash vs zsh"
- Previous message: DJE: "problems with FIND cmd"
- In reply to: Carli Fuchs: "how to select files not in a list"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 29 Apr 2004 19:46:48 GMT
Carli Fuchs <carlif@chepnt.net> wrote:
> I have two lists, one list holds actual users, another holds a listing of
> home directories. I want to remove the directories that are not in the
> actual users list. I have tried diff, comm, and uniq, but I cannot get just
> a list of directories of people who are not on the actual users list. Am I
> approaching this task wrong? My approach is to list all folders (they are
> named the same as the accountholder), and compare the folder names to the
> list of people who are current account holders. I was thinking that would
> give me a list of people who had folders but did not have accounts, and then
> I can delete those folders. Is there another way to do this?
>
> tia
> c.f.
Hint:
file1:
aaa
bbb
ccc
file2:
aaa
111
Study the output of
comm -1 file1 file2
comm -2 file1 file2
comm -3 file1 file2
And, also
grep -v -f file1 file2
man comm
man grep
-- William Park, Open Geometry Consulting, <opengeometry@yahoo.ca> Linux solution/training/migration, Thin-client
- Next message: Joe Davison: "bash vs zsh"
- Previous message: DJE: "problems with FIND cmd"
- In reply to: Carli Fuchs: "how to select files not in a list"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|