List all files that contain a specific directory


 
Thread Tools Search this Thread
Operating Systems Solaris List all files that contain a specific directory
# 1  
Old 04-13-2007
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??
# 2  
Old 04-13-2007
find / | grep oradata
# 3  
Old 04-13-2007
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:
Code:
find / -type f | grep "oradata"

It may take time, though.
# 4  
Old 04-16-2007
Thank you.

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?
# 5  
Old 04-16-2007
try this....

i dont think your sourcing it correctly.

try this:

". ./.profile"

dot space dot slash dot profile

-S
# 6  
Old 04-17-2007
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.
# 7  
Old 04-17-2007
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?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Bash to list all folders in a specific directory

The below bash is trying to list the folders in a specific directory. It seems close but adds the path to the filename, which basename could strip off I think, but not sure why it writes the text file created? This list of folders in the directory will be used later, but needs to only be the... (5 Replies)
Discussion started by: cmccabe
5 Replies

2. Shell Programming and Scripting

List files with date, create directory, move to the created directory

Hi all, i have a folder, with tons of files containing as following, on /my/folder/jobs/ some_name_2016-01-17-22-38-58_some name_0_0.zip.done some_name_2016-01-17-22-40-30_some name_0_0.zip.done some_name_2016-01-17-22-48-50_some name_0_0.zip.done and these can be lots of similar files,... (6 Replies)
Discussion started by: charli1
6 Replies

3. Shell Programming and Scripting

List 2 weeks older file on specific directory

Ive been a vocal of FIND command even before. Command below doesnt really give me the file that is older than two weeks.. Is there a script that will list me the log files that i want like for this date December 10, 2014, it shud list me the date between November 26, 2014 and below. When i run... (6 Replies)
Discussion started by: kenshinhimura
6 Replies

4. Shell Programming and Scripting

Delete all files if another files in the same directory has a matching occurrence of a specific word

he following are the files available in my directory RSK_123_20141113_031500.txt RSK_123_20141113_081500.txt RSK_126_20141113_041500.txt RSK_126_20141113_081800.txt RSK_128_20141113_091600.txt Here, "RSK" is file prefix and 123 is a code name and rest is just timestamp of the file when its... (7 Replies)
Discussion started by: kridhick
7 Replies

5. Shell Programming and Scripting

How to copy a directory without specific files?

Hi I need to copy a huge directory with thousands of files onto another directory but without *.WMV files (and without *.wmv - perhaps we need to use *.). Pls advise how can I do that. Thanks (17 Replies)
Discussion started by: reddyr
17 Replies

6. Shell Programming and Scripting

Delete all files if another files in the same directory has a matching occurence of a specific word

Hello, I have several files in a specific directory. A specific string in one file can occur in another files. If this string is in other files. Then all the files in which this string occured should be deleted and only 1 file should remain with the string. Example. file1 ShortName "Blue... (2 Replies)
Discussion started by: premier_de
2 Replies

7. UNIX for Dummies Questions & Answers

Splitting files into a specific directory

Hello, I am trying to do the following; bzcat data.in.bz2 | split -l 1000000 -d this work great, except that once the files have been split, they are not in the directory I want them to be in. So I then have to move them, at times this can get hairy. Is there anyway to specify where the... (4 Replies)
Discussion started by: amcrisan
4 Replies

8. UNIX for Dummies Questions & Answers

Linux shortcutkey to search specific file from a list of directory?!

Hi, I'm the new user of linux/unix. Can I ask that anybody know how to use the linux/unix shortcut key to search a specific file from a list of directory? For example, I know the file name that I want to search. But I forget which directory or location is my desired file put.Got any shortcut... (7 Replies)
Discussion started by: patrick87
7 Replies

9. Shell Programming and Scripting

How to find a specific files in a many directory

Dear All, Appreciate some help here. I have a log of report. It located in several directory as below: Directory: mysscpr1 mysscpr2 mysscpr3 my_scnpr4 In the directory it contain hundred of files. i need to find a specific files that contain 'invc2345' in the directory. How... (7 Replies)
Discussion started by: selamba_warrior
7 Replies

10. Shell Programming and Scripting

delete files in specific directory

i have a directory "ABC" with lots of old files and sub directories in it. the issue now is i want to delete away files which are older than 15 days in "ABC" without deleting the files in the sub directories and without deleting the sub directory. i tried using find command but it will drill down... (2 Replies)
Discussion started by: legato
2 Replies
Login or Register to Ask a Question