Find command takes too long to complete


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Find command takes too long to complete
# 1  
Old 11-10-2014
Find command takes too long to complete

Hi,

Below is my find command

Code:
find /opt/app/websphere -name myfolder -perm -600 | wc -l

At time it even takes 20 mins to complete.

my OS is : SunOS mypc 5.10 Generic_150400-09 sun4v sparc SUNW,T5440
# 2  
Old 11-10-2014
Hi,

I'm assuming that as it completes it returns a number - what is it?

Regards

Dave
# 3  
Old 11-10-2014
Yes, its check if the folder meets the permission provide or not. All i need is to check the folder permission, so can we tweak my query to give quicker results as the current one takes a long long time.
# 4  
Old 11-10-2014
Quote:
Originally Posted by mohtashims
Yes, its check if the folder meets the permission provide or not. All i need is to check the folder permission, so can we tweak my query to give quicker results as the current one takes a long long time.
If you know where the directory is to the point that its permissions are important, why are you running a "find" command?

And if the directory permissions keep changing, you need to fix what's changing the permissions and not paper over the problem with a hack.
# 5  
Old 11-10-2014
There is likely no way to significantly speed this up.
For analysis and perhaps a little improvement, please give the following information:
Code:
df /opt/app/websphere
zonename
/usr/sbin/prtconf | head
grep autoup /etc/system

# 6  
Old 11-10-2014
Quote:
Originally Posted by MadeInGermany
There is likely no way to significantly speed this up.
For analysis and perhaps a little improvement, please give the following information:
Code:
df /opt/app/websphere
zonename
/usr/sbin/prtconf | head
grep autoup /etc/system

Several sets of output from
Code:
iostat -sndxz 2

while the find is running would be good, too.
# 7  
Old 11-10-2014
Quote:
Originally Posted by achenle
Several sets of output from
Code:
iostat -sndxz 2

while the find is running would be good, too.
Output of iostat
Quote:
extended device statistics
r/s w/s kr/s kw/s wait actv wsvc_t asvc_t %w %b device
0.0 1.0 0.0 8.3 0.0 0.0 0.0 5.2 0 1 sd5
0.0 1.0 0.0 8.3 0.0 0.0 0.1 8.6 0 1 sd6
0.0 1.5 0.0 12.0 0.0 0.0 0.0 0.5 0 0 ssd11
0.0 0.5 0.0 4.0 0.0 0.0 0.0 0.3 0 0 ssd17
0.0 0.5 0.0 0.3 0.0 0.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 0.0 0.0 1.3 0 3 ssd377
20.5 0.5 164.4 1.0 0.0 0.0 0.0 1.0 0 2 ssd379
0.0 237.0 0.0 1187.8 0.0 0.1 0.0 0.2 0 6 ssd382
0.0 0.5 0.0 1.5 0.0 0.0 0.0 0.3 0 0 ssd384
25.6 9.0 204.4 25.1 0.0 0.1 0.0 1.6 0 6 ssd386
27.6 7.0 220.5 23.6 0.0 0.0 0.0 1.1 0 4 ssd389
0.0 262.6 0.0 1329.6 0.0 0.1 0.0 0.2 0 7 ssd390
27.1 5.5 216.5 13.0 0.0 0.0 0.0 1.1 0 4 ssd393
17.5 0.5 140.3 1.0 0.0 0.0 0.0 2.3 0 4 ssd394
20.5 5.5 164.4 12.5 0.0 0.0 0.0 1.5 0 4 ssd398
20.0 0.5 160.3 1.5 0.0 0.0 0.0 1.1 0 2 ssd399
25.6 2.5 204.4 4.0 0.0 0.0 0.0 1.7 0 5 ssd400
21.5 1.5 172.4 33.8 0.0 0.1 0.0 2.3 0 5 ssd402
28.6 1.0 228.5 5.5 0.0 0.0 0.0 1.4 0 4 ssd406
18.5 0.5 148.3 2.0 0.0 0.0 0.0 2.4 0 5 ssd407
23.6 2.0 188.4 8.0 0.0 0.1 0.0 2.1 0 5 ssd409
27.1 1.0 216.5 3.0 0.0 0.1 0.0 1.9 0 5 ssd410
20.0 2.0 160.3 12.5 0.0 0.0 0.0 1.4 0 3 ssd413
26.6 2.0 212.5 4.0 0.0 0.1 0.0 2.0 0 6 ssd415
extended device statistics
r/s w/s kr/s kw/s wait actv wsvc_t asvc_t %w %b device
0.0 0.5 0.0 0.5 0.0 0.0 0.0 0.5 0 0 ssd6
0.0 0.5 0.0 4.0 0.0 0.0 0.0 2.0 0 0 ssd11
0.0 0.5 0.0 4.0 0.0 0.0 0.0 0.6 0 0 ssd51
0.0 0.5 0.0 8.0 0.0 0.0 0.1 0.4 0 0 ssd59
0.0 0.5 0.0 4.0 0.0 0.0 0.0 0.5 0 0 ssd89
0.0 0.5 0.0 8.0 0.0 0.0 0.0 0.4 0 0 ssd97
0.0 0.5 0.0 8.0 0.0 0.0 0.0 0.3 0 0 ssd106
0.0 0.5 0.0 8.0 0.0 0.0 0.0 0.3 0 0 ssd122
0.0 2.0 0.0 16.0 0.0 0.0 0.0 1.2 0 0 ssd167
0.0 0.5 0.0 4.0 0.0 0.0 0.0 0.5 0 0 ssd175
0.0 0.5 0.0 4.0 0.0 0.0 0.0 0.3 0 0 ssd182
0.0 1.5 0.0 12.0 0.0 0.0 0.1 0.6 0 0 ssd206
0.0 28.1 0.0 232.6 0.0 0.0 0.0 0.3 0 1 ssd325
0.0 17.0 0.0 136.3 0.0 0.0 0.0 0.3 0 0 ssd326
0.0 24.6 0.0 200.5 0.0 0.0 0.0 0.3 0 1 ssd331
0.0 0.5 0.0 21.3 0.0 0.0 0.3 0.6 0 0 ssd337
0.0 18.5 0.0 148.4 0.0 0.0 0.0 0.3 0 0 ssd345
0.0 31.6 0.0 276.7 0.0 0.0 0.0 0.3 0 1 ssd369
0.0 33.1 0.0 280.7 0.0 0.0 0.0 0.3 0 1 ssd375
20.6 0.0 164.4 0.0 0.0 0.1 0.0 2.7 0 6 ssd377
16.5 0.0 132.3 0.0 0.0 0.0 0.0 1.8 0 3 ssd379
0.0 37.6 0.0 344.9 0.0 0.0 0.0 0.3 0 1 ssd382
18.5 0.0 148.4 0.0 0.0 0.0 0.0 2.3 0 4 ssd386
19.5 0.0 156.4 0.0 0.0 0.0 0.0 2.4 0 5 ssd389
0.0 33.1 0.0 316.8 0.0 0.0 0.0 0.3 0 1 ssd390
17.5 0.0 140.3 0.0 0.0 0.1 0.0 2.9 0 5 ssd393
19.5 0.5 156.4 4.0 0.0 0.0 0.0 1.9 0 4 ssd394
22.6 0.0 180.4 0.0 0.0 0.0 0.0 2.0 0 5 ssd398
16.0 0.0 128.3 0.0 0.0 0.0 0.0 1.8 0 3 ssd399
20.0 0.0 160.4 0.0 0.0 0.1 0.0 3.5 0 7 ssd400
14.0 0.0 112.3 0.0 0.0 0.0 0.0 1.9 0 3 ssd402
21.6 0.0 172.4 0.0 0.0 0.1 0.0 2.6 0 6 ssd406
18.0 0.0 144.4 0.0 0.0 0.0 0.0 1.6 0 3 ssd407
25.6 0.0 204.5 0.0 0.0 0.0 0.0 1.8 0 5 ssd409
21.6 0.0 172.4 0.0 0.0 0.1 0.0 2.6 0 6 ssd410
23.6 0.0 188.5 0.0 0.0 0.1 0.0 2.3 0 5 ssd413
19.0 0.0 152.4 0.0 0.0 0.0 0.0 2.0 0 4 ssd415
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Checking for substring in a loop takes too long to complete.

I need to check if the files returned by ls command in the below script is a sub-string of the argument passed to the script i.e $1 The below script works fine but is too slow. If the ls command take 12 secs to complete printing all files with while loop then; using posix substring check... (6 Replies)
Discussion started by: mohtashims
6 Replies

2. Shell Programming and Scripting

Script takes too long to complete

Hi, I have a lengthy script which i have trimmed down for a test case as below. more run.sh #!/bin/bash paths="allpath.txt" while IFS= read -r loc do echo "Working on $loc" startdir=$loc find "$startdir" -type f \( ! -name "*.log*" ! -name "*.class*" \) -print | while read file do... (8 Replies)
Discussion started by: mohtashims
8 Replies

3. Shell Programming and Scripting

Find command takes long

Hi, I am trying to search for a Directory called "mont" under a directory path "/opt/app/var/dumps" Although "mont" is in the very parent directory called "dumps" i.e "/opt/app/var/dumps/mont" and it can never be inside any Sub-Directory of "dumps"; my below find command which also checks... (5 Replies)
Discussion started by: mohtashims
5 Replies

4. Shell Programming and Scripting

Timeout to abolish ssh connection command it takes too long

Hi, I am running a ssh connection test in a script, how can I add a timeout to abolish the process if it takes too long? ssh -i ~/.ssh/ssl_key useraccount@computer1 Thank you. - j (1 Reply)
Discussion started by: hce
1 Replies

5. Shell Programming and Scripting

Wget takes a long time to complete

Hi, I wish to check the return value for wget $url. However, some urls are designed to take 45 minutes or more to return. All i need to check if the URL can be reached or not using wget. How can i get wget to return the value in a few seconds ? (8 Replies)
Discussion started by: mohtashims
8 Replies

6. Shell Programming and Scripting

find command takes a lot of time ( can I skip directories)

I have a file called "library" with the following content libnxrdbmgr.a libnxrdbmgr.so libnxtk.a libnxtk.so libora0d_nsc_osi.so I am trying to locate if these libraries are on my machine or not. find command runs for about few seconds and hangs after this. Can someone please help me and... (3 Replies)
Discussion started by: knijjar
3 Replies

7. Shell Programming and Scripting

shell script takes long time to complete

Hi all, I wrote this shell script to validate filed numbers for input file. But it take forever to complete validation on a file. The average speed is like 9mins/MB. Can anyone tell me how to improve the performance of a shell script? Thanks (12 Replies)
Discussion started by: ozzman
12 Replies

8. Shell Programming and Scripting

Killing a process that takes too long

Hello, I have a C program that takes anywhere from 5 to 100 arguments and I'd like to run it from a script that makes sure it doesnt take too long to execute. If the C program takes more than 5 seconds to execute, i would like the shell script to kill it and return a short message to the user. ... (3 Replies)
Discussion started by: WeezelDs
3 Replies

9. Shell Programming and Scripting

command find returned bash: /usr/bin/find: Argument list too long

Hello, I create a file touch 1201093003 fichcomp and inside a repertory (which hava a lot of files) I want to list all files created before this file : find *.* \! -maxdepth 1 - newer fichcomp but this command returned bash: /usr/bin/find: Argument list too long but i make a filter all... (1 Reply)
Discussion started by: yacsil
1 Replies

10. UNIX for Dummies Questions & Answers

Finding out how long a command takes to run

Hi I am trying to find out the best way to find out how long a command takes to run in miliseconds .. Is there such a way of doing this in Unix ? Thanks (3 Replies)
Discussion started by: cfoxwell
3 Replies
Login or Register to Ask a Question