![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Why cant i find my ftp directories in the unix structure | elduderino | UNIX for Dummies Questions & Answers | 2 | 02-14-2008 02:11 PM |
| Finding nth occurrence in line and replacing it | stresing | UNIX for Dummies Questions & Answers | 5 | 02-01-2008 04:56 AM |
| how to stop to current directory using find | james_falco | UNIX for Dummies Questions & Answers | 1 | 07-17-2007 09:43 PM |
| MV files from one directory structure(multiple level) to other directory structure | srmadab | UNIX for Advanced & Expert Users | 4 | 09-13-2006 05:01 PM |
| Unix/Linux Directory Structure | gdboling | UNIX for Dummies Questions & Answers | 2 | 10-25-2001 12:00 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
stop unix find on a directory structure after finding 1st occurrence
Hi,
Has anyone tried to restrict Solaris 10 unix find on a large directory structure based on time to stop running after finding the first occurrence of a matching query. Basically I'm trying to build up a usage map of user workspaces based on file modification (week/month/3 months/year etc) and I know if I can get find to stop after finding something modified in the last year in the very first directory instead of running to the bottom getting all files the program would run a lot faster: Excerpt: week=Yes; month=Yes; month6=Yes; year=Yes; year2=Yes if [[ -z `find "${DIR}/${j}" -mtime -730` ]];then week=No; month=No; month6=No; year=No; year2=No else if [[ -z `find "${DIR}/${j}" -mtime -365` ]];then week=No; month=No; month6=No; year=No else if [[ -z `find "${DIR}/${j}" -mtime -180` ]];then week=No; month=No; month6=No else if [[ -z `find "${DIR}/${j}" -mtime -30` ]];then week=No; month=No; else if [[ -z `find "${DIR}/${j}" -mtime -7` ]];then week=No; fi fi fi fi fi Thanks in advance, John |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|