Finding multiply directories


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Finding multiply directories
# 8  
Old 12-20-2011
You are redirecting the output into the 'example' file so wouldn't see anything appearing on your terminal.

'find /' explores every single folder and filesystem in your system, bar none, so of course could take a while. If you want to restrict where it looks, pick a more specific folder, or use options like -xdev to prevent it crossing between different filesystems.
# 9  
Old 12-20-2011
Quote:
Originally Posted by Corona688
You are redirecting the output into the 'example' file so wouldn't see anything appearing on your terminal.

'find /' explores every single folder and filesystem in your system, bar none, so of course could take a while. If you want to restrict where it looks, pick a more specific folder, or use options like -xdev to prevent it crossing between different filesystems.
As I'm running it, I'm doing a 'tail' to observe the output. Maybe I'm not being patient enough. I'm going to retry it using the "quotes" like you suggested.

---------- Post updated at 08:45 AM ---------- Previous update was at 08:43 AM ----------

Any way to observe the overall output as it is running? Meaning, can I see the paths it is taking which it's searching them? Maybe it's hanging on a directory.

---------- Post updated at 09:56 AM ---------- Previous update was at 08:45 AM ----------

UPDATE: I tried
Code:
find / -type d -name "*2011"

and it is now showing output. I guess strd output to '>' doesn't apply to find. Now its acutally show TOO MUCH output. Now I'm trying this to norrow it down and it's not working
Code:
find / -type d -name "*2011" | grep -v "DS."

No ouput again........
# 10  
Old 12-21-2011
Quote:
Originally Posted by shorty
As I'm running it, I'm doing a 'tail' to observe the output.
'tail' by itself will just sit there, waiting for you to type at least 10 lines into the keyboard.

Try tail -f filename

Quote:
UPDATE: I tried
Code:
find / -type d -name "*2011"

and it is now showing output. I guess strd output to '>' doesn't apply to find.
> works perfectly fine with find. I think your method of viewing the output was suspect.
Quote:
Now its acutally show TOO MUCH output. Now I'm trying this to norrow it down and it's not working
Code:
find / -type d -name "*2011" | grep -v "DS."

No ouput again........
Try escaping that dot.m 'DS\.' Put it in single quotes, not double, so the shell doesn't get all happy and eat the backslash for you. grep takes regular expressions, and in those, "." means "any character". So "DS." would match DSA, DSB, DSC, DSD, and so forth. To match DS. and only DS. you have to escape the . to make it realize it's a real .

If that's not the problem, then what exactly are you trying to do?
# 11  
Old 12-21-2011
Quote:
Originally Posted by Corona688
'tail' by itself will just sit there, waiting for you to type at least 10 lines into the keyboard.

Try tail -f filename

> works perfectly fine with find. I think your method of viewing the output was suspect. Try escaping that dot.m 'DS\.' Put it in single quotes, not double, so the shell doesn't get all happy and eat the backslash for you. grep takes regular expressions, and in those, "." means "any character". So "DS." would match DSA, DSB, DSC, DSD, and so forth. To match DS. and only DS. you have to escape the . to make it realize it's a real .

If that's not the problem, then what exactly are you trying to do?
Thank you for the response. Yes, I'm aware of the 'tail' syntax. I just mentioned it in a general context.

The grep 'DS.' is correct as I don't want anything (-v) matching DSA, DSB,DSC, etc.

I'm still puzzled that '>' just simply refuses to write to 'filename'. I'm perplexed with this weird behavior Smilie
# 12  
Old 12-21-2011
Quote:
Originally Posted by shorty
Thank you for the response. Yes, I'm aware of the 'tail' syntax. I just mentioned it in a general context.
How about you tell us exactly what you're doing then, word for word, letter for letter, keystroke for keystroke? "general context" may not be enough. We need to see exactly what you're doing to tell if anything's wrong.

'find' just writes to stdout like any other command. I don't suppose your disk's full or anything like that.
# 13  
Old 12-21-2011
Quote:
Originally Posted by Corona688
How about you tell us exactly what you're doing then, word for word, letter for letter, keystroke for keystroke? "general context" may not be enough. We need to see exactly what you're doing to tell if anything's wrong.

'find' just writes to stdout like any other command. I don't suppose your disk's full or anything like that.
First I ran
Code:
find / -type d -name "*2011" > ok

as this was running I did a
Code:
tail -f ok

Nothing is showing during the
Code:
tail -f ok

Eventually I halted the process. Then I ran this yesterday
Code:
find / -type d -name "*2011"

when I came into work this morning, it was still running. Looks like it is getting hung up somewhere during the search.
# 14  
Old 12-21-2011
We have reached post #14 and we know nothing about your system.
What Operating System and version do you have?
Is the system sick or (as another poster suggested) out of disc space?

This should produce results on most systems (and not search NFS filesystems). Some versions of "find" don't give output unless you specify "-print" or "-exec ..".

Code:
find // -local -type d -name \*"2011" -exec ls -lad {} \;

 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Finding files deep in directories

i need to find a portable way to go through multiple directories to find a file. I've trid something like this: find /opt/oracle/diag/*/alert_HH2.log -printordinarily, i can run the ls command and it will find it: /opt/oracle/diag/*/*/*/*/alert_HH2.log The problem with this approach is... (3 Replies)
Discussion started by: SkySmart
3 Replies

2. Shell Programming and Scripting

Finding directories with expression

Hi All, I need your help in finding pattern of directories. need to search for all pattern have "mypatern" from base directory folder. example ------- server1 - base directory 100 server1/ab_123456_1/mypattern 100 server1/ab_123456_2/mypattern 200 server1/ab_123457_1/mypattern... (13 Replies)
Discussion started by: lxdorney
13 Replies

3. UNIX for Dummies Questions & Answers

Finding size of all directories

Alright so I've tried a couple different things that at first glance, looked like they worked. find . -maxdepth 5 -type d -daystart -mtime 1 | xargs du -h Which seems to ignore the previous commands such as depth and modified time. find .. -maxdepth 2 -type d -daystart -ctime 1 | xargs... (8 Replies)
Discussion started by: Aussiemick
8 Replies

4. Shell Programming and Scripting

Finding directories older than 5 days

Hello, Motive: Search all directories which are older than 5 days. Example: consider following directory structure: abc/dir1 abc/dir1/dir abc/dir2 abc/dir3 abc/dir3/temp Suppose dir1 and dir3 are 5 days older. Then I am looking for a command which lists abc/dir1 and abic/dir3 only so that... (4 Replies)
Discussion started by: mytempid07
4 Replies

5. Shell Programming and Scripting

Script for parsing directories one level and finding directories older than n days

Hello all, Here's the deal...I have one directory with many subdirs and files. What I want to find out is who is keeping old files and directories...say files and dirs that they didn't use since a number of n days, only one level under the initial dir. Output to a file. A script for... (5 Replies)
Discussion started by: ejianu
5 Replies

6. Shell Programming and Scripting

finding correct directories

I have directories like V00R01,V00R02,V01R01,V01R02 in a directory where V is version and R is a release. basically I need to set base directory and current directory. Under a version there can be any number of releases and there can be number of versions also. V00R01...V00R50..so on also,... (2 Replies)
Discussion started by: vjasai
2 Replies

7. UNIX for Dummies Questions & Answers

finding largest files (not directories)?

hello all. i would like to be able to find the names of all files on a remote machine using ssh. i only want the names of files, not directories so far i'm stuck at "du -a | sort -n" also, is it possible to write them to a file on my machine? i know how to write it to a file on that... (2 Replies)
Discussion started by: user19190989
2 Replies

8. Shell Programming and Scripting

Expression for Finding Multiple Directories..??

I am writing a shell script to search for previous versions of an application...the application is called TAU and basically i want to search the users home directory and /Applications for any instances of a "TAU" folder.. If found i want to give the user the option to remove the old folders and if... (3 Replies)
Discussion started by: meskue
3 Replies

9. UNIX for Dummies Questions & Answers

Finding executable files in all directories

This is probably very easy but I would like to know a way to list all my files in all my directories that are readable and executable to everyone. I was told to use find or ls and I tried some stuff but couldnt get it to work. I understand that its dangerous to have files with these permissions for... (4 Replies)
Discussion started by: CSGUY
4 Replies

10. UNIX for Dummies Questions & Answers

finding directories in UNIX

I am accessing a UNIX server via FTP. I want to retieve a file in a directory. What is the UNIX command that I need to view and retrieve files from a directory? (1 Reply)
Discussion started by: yodaddy
1 Replies
Login or Register to Ask a Question