Find all files for a user, excluding a directory

I have been searching, and cannot find an answer for this. I am trying to find all files for a user, lets call him (test001), and I want to exclude a specific directory.
Here is the command I run, it finds all files:
find / -user test001
I get this result:
> find / -user test001
/QSYS.LIB/QUSRSYS.LIB/TEST001.MSGQ (I would like to eliminate these)
/QSYS.LIB/QUSRSYS.LIB/TEST06.MSGQ (I would like to eliminate these)
/SNEGRON/CBNACWP.TXT
/SNEGRON/special990.txt
/SNEGRON/pgm1.txt
/test06
$
This works ok, except, that I want to exclude the /QSYS.IBM directory.

On the AS400, there is a command called WRKOBJOWN. The work with objects by owner command. It shows the following files owned by user test001. I'm sure someone will say, why not just use this command. Well, in the case of a user that owns thousdands of objects, its not easy to use this command because to many objects are listed and there are screens and screens full of objects.

User profile . . . . . . . : TEST001

Type options, press Enter.
2=Edit authority 4=Delete 5=Display authority 7=Rename
8=Display description 9=Change owner

                                                            ASP            

Opt Object Library Type Attribute Device
/SNEGRON/CBNACWP.T > *STMF *SYSBAS
/SNEGRON/pgm1.txt *STMF *SYSBAS
/SNEGRON/special99 > *STMF *SYSBAS
/test06 *DIR *SYSBAS
TEST001 QUSRSYS *MSGQ *SYSBAS
TEST06 QUSRSYS *MSGQ *SYSBAS

Ok, so this list shows 4 IFS file system objects and 2 OS400 objects that are owned by user test001.

I searched and found the prune command. I pieced together this command, but it doesn't work right.
Here is result with prune.
find . -user test001 -path QSYS.LIB -prune -o -type f
./classes/properties/systemlaunch.properties
./classes/wsa400.jar
./CBNACWP.TXT

Here is another example:
> find . -user test001 \( -name proc -type d \) -prune -o -exec ls -l '{}' \;
total: 1.032 megabytes
-rwxrwxrwx 1 SNEGRON 0 953910 Dec 2 2009 CBNACWP.TXT
drwxr-sr-x 3 QSYS 0 8192 Jan 13 2010 classes
total: 8 kilobytes
drwxrwsrwx 2 SNEGRON 0 8192 Aug 29 2008 RSE
total: 2.940 megabytes
drwxr-sr-x 2 QSYS 0 8192 Jan 13 2010 properties
-rwxr-xr-x 1 QSYS 0 658801 Feb 4 2008 wsa400.jar
total: 8 kilobytes
-rw-rw-r-x 1 SNEGRON 0 2664 Feb 4 2008 systemlaunch.prop
erties
-rw-rw-r-x 1 SNEGRON 0 2664 Feb 4 2008 ./classes/propert

It gives me a totally different list of files. Can someone provide me with the proper command??
I know I'm close, but every example I have found produces different results. I know the first find command is good, except I don't want to search in QSYS.LIB directory. My search should be. Find all files for user test001, excluding the qsys.lib directory and all its subdirectories.

Thanks for your help.

find / -user test001 -type f -o -type d -name QSYS.LIB -prune

Close, but no cigar.
The command you provided gives the following results:

> find / -user test001 -type f -o -type d -name QSYS.LIB -prune
/QSYS.LIB
/SNEGRON/CBNACWP.TXT
/SNEGRON/special990.txt
/SNEGRON/pgm1.txt

This appears to be the files in QSYS.LIB and not the others.
Thanks for the quick response.

---------- Post updated at 02:00 PM ---------- Previous update was at 01:57 PM ----------

Oh, never mind. This is right. I guess because technically, all files are in QSYS.LIB, it includes the directory. The 3 files are actually in /SNEGRON, so that is correct. It didn't include the additional files, so this must be correct.

Thanks.

---------- Post updated at 02:05 PM ---------- Previous update was at 02:00 PM ----------

Well, I'm not so sure now. There are 6 objects owned by user test001. They are as follows:
/SNEGRON/CBNACWP.T >
/SNEGRON/pgm1.txt
/SNEGRON/special99 >
/test06
TEST001
TEST06

Your command should have picked up the /test directory but did not. I did get the 3 files, but not the directory. The 2 remaining files are definately in QSYS.LIB.
Why wouldn't the /test06 directory get picked up??

Not really :stuck_out_tongue: Find always includes directory that is "pruned" it just isn't going inside. If you want directories owned by that user as well, then use:

find / -user test001 -o -type d -name QSYS.LIB -prune

This looks good. It still picks up the /QSYS.LIB, but it does get all 4 files owned by this user. Thats exactly what I need.

find / -user test001 -o -type d -name QSYS.LIB -prune /QSYS.LIB
/SNEGRON/CBNACWP.TXT
/SNEGRON/special990.txt
/SNEGRON/pgm1.txt
/test06

Thanks for your help.