Sponsored Content
Top Forums Shell Programming and Scripting Finding files in current directory when 100,000's files in current directory Post 302291831 by kewong007 on Thursday 26th of February 2009 11:44:42 AM
Old 02-26-2009
Power Finding files in current directory when 100,000's files in current directory

Hi All

I was wondering what is the most efficient way to find files in the current directory(that may contain 100,000's files), that meets a certain specified file type and of a certain age.

I have experimented with the find command in unix but it also searches all sub directories. I have found references on internet that specify maxdepth/depth to limit search to current directory but the flavour of unix I am using does not have the maxdepth flag, I have read the man pages of find command and cannot find any way to limit search to current directory.

Can I use a unix ls command and pipe the output to another built in unix command that can check for age of file(remembering it can handle searching 100,000s of files)?

I seem to be having much issues with this and have not come up with a simple solution.

Can someone give me a sample unix script of what to do?
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Need quick help with diff files in current directory!!!

i have a problem that needs to be solved with CSH , SED or AWK as soon as possible. I need to write a program which creates a directory called backup (if it does not exist). The program then compares all the ordinary files in the current directory and if two files are identical, it moves one of... (1 Reply)
Discussion started by: tkwai
1 Replies

2. Shell Programming and Scripting

Searching for files over 30 days old in current directory

May be a simple question for experts here.... I need to get the list of files older than 30 days in the current folder. I tried "find", but it searches recursively in all the sub directories. Can I restrict the recursive search and extract the files only from current directory ? (18 Replies)
Discussion started by: cxredd4
18 Replies

3. Shell Programming and Scripting

finding 0 byte files in current directory only

Hi Gurus, I have a directory A, which has some 0 byte files in it. This directory also has a subdirectory B which also has some 0 byte files in it. The problem: I only need to find out the names of the 0 byte files in the directory A. I'm using the following command find . -name *.zip... (6 Replies)
Discussion started by: ramky79
6 Replies

4. UNIX for Dummies Questions & Answers

List files that are not directories from current directory

I can't manage to list all files that are not directories from current directory. (2 Replies)
Discussion started by: beni22sof
2 Replies

5. Shell Programming and Scripting

mget * (obtein files from current directory but not the files form sub-directories)

Hello, Using the instruction mget (within ftp) and with "Interactive mode off", I want to get all files from directory (DirAA), but not the files in sub-directories. The files names don't follow any defined rule, so they can be just letters without (.) period Directory structure example: ... (0 Replies)
Discussion started by: Peter321
0 Replies

6. Shell Programming and Scripting

How to strip ^M at end of each files for all files found in current directory

I am trying to use a loop to strip of the funny character ^M at the end of all lines in each file found in current directory and I have used the following in a script: find . -type f -name '*.txt' | while read file do echo "stripping ^M from ..." ex - "$file" > $tempfile %s/^M//g wq! # mv... (4 Replies)
Discussion started by: bisip99
4 Replies

7. Shell Programming and Scripting

Find files ONLY in current directory

Hello all, I am having a hard type in figuring out how to only gather certain files in the current directory without exploring its subdirectories. I tried: find . -name "*.ksh" -prune this also returns ksh files from lower subdirectories. I also tried find . -ls -name "*.ksh" This also... (8 Replies)
Discussion started by: gio001
8 Replies

8. HP-UX

How do I include header files outside of my current directory

I am trying to compile a file called PPFormatageMUT.c in which I have included header file which are at some other location but the point is that while compiling the file, it is throwing error saying that error : no such file or directory source code location:... (1 Reply)
Discussion started by: ezee
1 Replies

9. Shell Programming and Scripting

Find files only in current directory...not subdirectories

Hi, I have to find files only in the current directory...not in the sub directories. But when I use Find command ... it searches all the files in the current directory as well as in the subdirectories. I am using AIX-UNIX machine.Please help..I tried to use maxdepth..but it is not working in AIX. (2 Replies)
Discussion started by: vsachan
2 Replies

10. UNIX for Advanced & Expert Users

Find all files in the current directory excluding hidden files and directories

Find all files in the current directory only excluding hidden directories and files. For the below command, though it's not deleting hidden files.. it is traversing through the hidden directories and listing normal which should be avoided. `find . \( ! -name ".*" -prune \) -mtime +${n_days}... (7 Replies)
Discussion started by: ksailesh1
7 Replies
RADDEPEND(1)						      General Commands Manual						      RADDEPEND(1)

NAME
raddepend - find RADIANCE scene dependencies SYNOPSIS
raddepend file .. DESCRIPTION
Raddepend uses getbbox(1) to expand scene file arguments and find file dependencies for make(1) or rad(1). Raddepend looks only in the current directory, so dependencies hidden elsewhere in the filesystem will not be found or named. The output is the name of files, one per line, that were accessed during the expansion of the input file arguments. The file arguments are excluded from the list. If no input files are given, the standard input is read. AUTHOR
Greg Ward BUGS
On some older NFS systems, the file access dates are not updated promptly. As a result, raddepend may not be 100% reliable on these sys- tems. If the output seems to be missing essential files, this is no doubt why. The only fix is to put in a longer sleep time between the getbbox call and the final ls(1). SEE ALSO
make(1), oconv(1), rad(1), xform(1) RADIANCE
4/15/94 RADDEPEND(1)
All times are GMT -4. The time now is 09:37 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy