Results 1 to 10 of 10
I am trying to find a way to search for specific folders that may reside in multiple locations. I have 92 dss partitions, (we store studies in this way / ...
- 01-10-2008 #1Just Joined!
- Join Date
- Jan 2008
- Posts
- 6
Search function
I am trying to find a way to search for specific folders that may reside in multiple locations. I have 92 dss partitions, (we store studies in this way / 12/11/13/13/10/(study I want is here)) in this location would be a CT study someone had done, they may also have other studies done which could be stored in other dss partitions (under the same path) How do I do a recursive search for a folder? THis is how I look now
find /opt/emageon/archive/dicom/dss*/files/10/11/12/13/14
or
cd /opt/emageon/archive/dicom/dss*/files/10/11/12/13/14
This works for the first study.
- 01-10-2008 #2
Various solutions to a question amazingly like this one have been posted here.
--
Bill
Old age and treachery will overcome youth and skill.
- 01-10-2008 #3Just Joined!
- Join Date
- Jan 2008
- Posts
- 6
Problem is for that I was searching for a specific file, this is folder or multiple folders which could be on different dss partitions.
- 01-10-2008 #4
Good point. There are two differences in the two questions, right?
- This time you want all the qualifying entries, not just one.
- This time you want directories "folders", not files.
Know that the find command doesn't stop when it finds one qualifying entry; it goes for all them.
And the
in the other find command says, "Restrict your results to plain, regular files, and don't include directories." If now you're looking for "folders" (which means directories", useCode:-type f
instead. If you're looking for either one, leave this option out entirely.Code:-type d
Does this give you what you need?--
Bill
Old age and treachery will overcome youth and skill.
- 01-10-2008 #5Just Joined!
- Join Date
- Jan 2008
- Posts
- 6
So what you are saying is that if I am looking for any study done for patient id of 12/13/14/15/16 I could type this:
find . -type d /opt/emageon/archive/dicom/dss*/files/12/13/14/15/16/
- 01-10-2008 #6
The closer I look at this, the more questions I have.
Let's just take one of them, because the rest of the discourse depends on the answer to it.
In your example, I know that the "12/13/14/15/16" is a patient number, but:
- Is 12 a directory?
- Is 12/13 also a directory?
- Is 12/13/14 also a directory?
- Is 12/13/14/15 also a directory?
Or is "12/13/14/15/16" supposed to be the name of a single directory?
If this last is the case, then there will be problems. As far as I know, the bash shell is pretty much committed to the idea that "/" is the divider between levels of directory.--
Bill
Old age and treachery will overcome youth and skill.
- 01-11-2008 #7Just Joined!
- Join Date
- Jan 2008
- Posts
- 6
That is correct, 12/13/14/15/16 are directories. The way a study is stored, or should I say a typical path for a given study which is stored is this
dss54/files/12/13/14/15/16/This is where the study is stored.
I am looking for the study but I do not know the name of the directory the study is ultimately in. I know the patient ID and that is the only known information. (that is the 12/13/14/15, this is really his ID 12131415) For instance today, our long term storage was down, tsm was available, I used this to find the location of the study so I could pull the study for the surgeon.
cd /opt/emageon/archive/dicom/dss*/files/10/11/12/13/14
I was lucky in that the patient only had 1 study.
What if the patient had 3 studies all on different dss partitions. For example: here is what it would look like:
dss25/files/12/13/14/15/16/study 1
dss54/files/12/13/14/15/16/study 2
dss90/files/12/13/14/15/16/study 3
- 01-11-2008 #8
Actually, you gave me the answer I was hoping for.
And here is what you do. Don't bother with find; in this case that's far too slow.
To get a list of all studies for a particular patient, one study per line, do this:
To get a list of all studies all on one line, do this:Code:ls -1 /opt/emageon/archive/dicom/dss*/files/12/13/14/15/16/* # ^ that's a one, not an ell
Simple as that.Code:echo /opt/emageon/archive/dicom/dss*/files/12/13/14/15/16/*
--
Bill
Old age and treachery will overcome youth and skill.
- 01-11-2008 #9Just Joined!
- Join Date
- Jan 2008
- Posts
- 6
Thank you very much. I will test this in the morning.
- 01-11-2008 #10Just Joined!
- Join Date
- Jan 2008
- Posts
- 6
That worked perfect. I was able to find any study stored for a single patient in any dss partition. Thank you very much!


Reply With Quote