Sponsored Content
Full Discussion: Non Recursive Find Command
Top Forums UNIX for Dummies Questions & Answers Non Recursive Find Command Post 302729549 by pchegoor on Saturday 10th of November 2012 06:27:44 AM
Old 11-10-2012
Hammer & Screwdriver Non Recursive Find Command

Hello Unix Gurus,

I am using the following find commands:

1)
Code:
find Input_Path -name '*.[Pp][Dd][Ff]' -exec mv -f
{} Outputpath \;

2)
Code:
find Inputpath -name '*.[Pp][Dd][Ff]' -exec cp 
{} Outputpath \;

3)
Code:
find Somepath -name '*.[Pp][Dd][Ff]'

Now the problem is my Unix version does not support maxdepth Option for find command and i do not want the find commnand in each of the above cases to do a recursive processing instead it should only process files in Inputpath/Somepath Directory but not their subdirectories. Also i have large number of files to process . How can i accomplish this using the find command?

Thanks,

Moderator's Comments:
Mod Comment Please use code tags next time for your code and data.

Last edited by zaxxon; 11-10-2012 at 01:15 PM.. Reason: code tags, see PM
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Performing a non-recursive find in Unix

I need to perform a non-recursive find in Unix. Sounds simple, but it doesn't actually work. The command ALWAYS searches through the subdirectories. Any ideas? I am on DEC Unix :-( (3 Replies)
Discussion started by: christallott
3 Replies

2. UNIX for Dummies Questions & Answers

Question: non-recursive find syntax

Hello, I am trying to search a directory for all files matching "G*" without looking in sub-directories "success" and "error". I've searched this forum and found the following syntax, but can't make it work: find . \( ! -name success -prune -name error -prune \) -type f -name "G*" Have... (6 Replies)
Discussion started by: alexkav
6 Replies

3. UNIX for Dummies Questions & Answers

making a recursive find more useful..

Hi everyone, I'm using a recursive find (you know the type, find . -name qwert*) to find a set of files. However, because I'm new to the system and there is not much documentation about these particular files I'm trying to find them using this recursive find. I started off at the location... (3 Replies)
Discussion started by: spanish_tony
3 Replies

4. Shell Programming and Scripting

Recursive find and store

I HAVE A TEXT FILE CONTAINING THE VALUES 1.CPP 2.CPP 3.CPP 4.CPP 5.CPP 6.CPP I WANT TO TAKE EACH .CPP AND USE THE FIND COMMAND TO FIND THE LATEST VERSION OF THE FOLDER IN WHICH IT IS PRESENT. HOW DO I IMPLEMENT IT IN A WHILE LOOP I TRIED SOMETHING LIKE THIS WHILE CAT... (3 Replies)
Discussion started by: ultimatix
3 Replies

5. UNIX for Advanced & Expert Users

Non recursive find command

Hi, I have question is related to find command. I want to find command should search in current folder only not recursive mode(sub-folders). I found a one way of, find . \( -name success -prune \) -o -name "Rajini*" How ever, my current folder is having lots sub-folders and am not... (7 Replies)
Discussion started by: Nagapandi
7 Replies

6. Shell Programming and Scripting

Command to sort directories after a recursive find

find -type d -name "TC_*" | sort That's what I have so far... it finds the appropriate directories and then sorts them. But, when it comes to nested subdirectories, it only sorts relative to the first subdirectory. I want it to sort based on the directory at the end of the path. Does anyone know... (3 Replies)
Discussion started by: crimsondarkn
3 Replies

7. UNIX for Advanced & Expert Users

Recursive directory search using ls instead of find

I was working on a shell script and found that the find command took too long, especially when I had to execute it multiple times. After some thought and research I came up with two functions. fileScan() filescan will cd into a directory and perform any operations you would like from within... (8 Replies)
Discussion started by: newreverie
8 Replies

8. UNIX for Dummies Questions & Answers

Some advice please on non-recursive find

Hi all, I am currently writing a find-and-remove kind of script that is to be used for Solaris and Linux. Currently am using the find command below that I is in find only current directory (universal) | commandlinefu.com This however gives me the "ksh: /bin/find: arg list too long" error... (6 Replies)
Discussion started by: newbie_01
6 Replies

9. UNIX for Dummies Questions & Answers

Recursive Find on file size

Is there a way to use the find command to recursively scan directories for files greater than 1Gb in size and print out the directory path and file name only? Thanks in advance. (6 Replies)
Discussion started by: jimbojames
6 Replies

10. UNIX for Dummies Questions & Answers

Help needed - find command for recursive search

Hi All I have a requirement to find the file that are most latest to be modified in each directory. Can somebody help with the command please? E.g of the problem. The directory A is having sub directory which are having subdirectory an so on. I need a command which will find the... (2 Replies)
Discussion started by: sudeep.id
2 Replies
Locale::Codes::LangVar(3pm)				 Perl Programmers Reference Guide			       Locale::Codes::LangVar(3pm)

NAME
Locale::Codes::LangVar - standard codes for language variation identification SYNOPSIS
use Locale::Codes::LangVar; $lvar = code2langvar('acm'); # $lvar gets 'Mesopotamian Arabic' $code = langvar2code('Mesopotamian Arabic'); # $code gets 'acm' @codes = all_langvar_codes(); @names = all_langvar_names(); DESCRIPTION
The "Locale::Codes::LangVar" module provides access to standard codes used for identifying language variations, such as those as defined in the IANA language registry. Most of the routines take an optional additional argument which specifies the code set to use. If not specified, the default IANA language registry codes will be used. SUPPORTED CODE SETS
There are several different code sets you can use for identifying language variations. A code set may be specified using either a name, or a constant that is automatically exported by this module. For example, the two are equivalent: $lvar = code2langvar('en','alpha-2'); $lvar = code2langvar('en',LOCALE_CODE_ALPHA_2); The codesets currently supported are: alpha This is the set of alphanumeric codes from the IANA language registry, such as 'arevela' for Eastern Armenian. This code set is identified with the symbol "LOCALE_LANGVAR_ALPHA". This is the default code set. ROUTINES
code2langvar ( CODE [,CODESET] ) langvar2code ( NAME [,CODESET] ) langvar_code2code ( CODE ,CODESET ,CODESET2 ) all_langvar_codes ( [CODESET] ) all_langvar_names ( [CODESET] ) Locale::Codes::LangVar::rename_langvar ( CODE ,NEW_NAME [,CODESET] ) Locale::Codes::LangVar::add_langvar ( CODE ,NAME [,CODESET] ) Locale::Codes::LangVar::delete_langvar ( CODE [,CODESET] ) Locale::Codes::LangVar::add_langvar_alias ( NAME ,NEW_NAME ) Locale::Codes::LangVar::delete_langvar_alias ( NAME ) Locale::Codes::LangVar::rename_langvar_code ( CODE ,NEW_CODE [,CODESET] ) Locale::Codes::LangVar::add_langvar_code_alias ( CODE ,NEW_CODE [,CODESET] ) Locale::Codes::LangVar::delete_langvar_code_alias ( CODE [,CODESET] ) These routines are all documented in the Locale::Codes::API man page. SEE ALSO
Locale::Codes The Locale-Codes distribution. Locale::Codes::API The list of functions supported by this module. http://www.iana.org/assignments/language-subtag-registry The IANA language subtag registry. AUTHOR
See Locale::Codes for full author history. Currently maintained by Sullivan Beck (sbeck@cpan.org). COPYRIGHT
Copyright (c) 2011-2013 Sullivan Beck This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.18.2 2014-01-06 Locale::Codes::LangVar(3pm)
All times are GMT -4. The time now is 06:02 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy