List all files that contain a specific directory

I need to list all files and subdirectories that contain "oradata".

For example, I have several files in several different directories that contain "oradata". I.e.

/u07/oradata/1.dbf
/u09/unix/whatever/oradata/2.xxx

That is, whatever file on the system that contains a directory called "oradata"
should be piped to a file output.

I tried a few things;

find -name "*oradata*"

Any ideas??

find / | grep oradata

Your command will look for files that have 'oradata' as part of the filename and not the entire path. You could run find like this:

find / -type f | grep "oradata"

It may take time, though.

I also have one more question.

In my .profile i have the following environment variable set:

ORACLE_SID=scwa102
export ORACLE_SID

When I source my profile, (i.e. ./.profile) and issue
echo $ORACLE_SID, I get:

"ORACLE_SID undefined variable."

If however, I issue the command at the Unix prompt:

$ ORACLE_SID=scwa102
$ export ORACLE_SID
$ echo $ORACLE_SID
scwa102

It works. What gives? Why are these commands not becoming active in the .profile or when I log out and log in?

i dont think your sourcing it correctly.

try this:

". ./.profile"

dot space dot slash dot profile

-S

You mentioned I was not sourcing it correctly.

But the code you gave:

gives error:. ./.profile
.: Command not found

Besides if that was the problem, it would not explain why logging in and out did not solve the issue.

I also have one more question.

In my .profile i have the following environment variable set:

ORACLE_SID=scwa102
export ORACLE_SID

When I source my profile, (i.e. ./.profile) and issue
echo $ORACLE_SID, I get:

"ORACLE_SID undefined variable."

If however, I issue the command at the Unix prompt:

$ ORACLE_SID=scwa102
$ export ORACLE_SID
$ echo $ORACLE_SID
scwa102

It works. What gives? Why are these commands not becoming active in the .profile or when I log out and log in?

i dunno man....when i run it, it works every time.

$ . ./.profile

There is one incident that this will fail, which i have replicated, its when your .profile doesnt exist.

$ . ./.profile
ksh: ./.profile: not found

but your error is completely different.

If i think of anything, i will let ya know.

-S