Help needed - find command for recursive search


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Help needed - find command for recursive search
# 1  
Old 05-22-2013
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 single file that is modified most recently in directory A (irrespective of time, just it should be the most recently modified file in that folder) and so on for sub diectory.

Any help?
# 2  
Old 05-22-2013
You had some way a similar question here
https://www.unix.com/unix-dummies-que...-one-file.html

What have you tried, regarding the solutions given there? Is this homework/classroom stuff?
# 3  
Old 05-23-2013
Quote:
Originally Posted by zaxxon
You had some way a similar question here
https://www.unix.com/unix-dummies-que...-one-file.html

What have you tried, regarding the solutions given there? Is this homework/classroom stuff?
Hey,

The requirement is different entirely. The mentioned link is for a question where all the file with the path were required. But here i have to search the last modified file from all the directory (recursively). This is required for organisational level audit report for 2k+ servers. I have done it through a shell script but was interested to know if there is any one liner that could be used to find the file which is most recently modified in all the directory starting from root directory.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Recursive folder search faster than find?

I'm trying to find folders created by a propritary data aquisition software with the .aps ending--yes, I have never encountered folder with a suffix before (some files also end in .aps) and sort them by date. I need the whole path ls -dt "$dataDir"*".aps"does exactly what I want except for the... (2 Replies)
Discussion started by: Michael Stora
2 Replies

2. UNIX for Dummies Questions & Answers

Non Recursive Find Command

Hello Unix Gurus, I am using the following find commands: 1) find Input_Path -name '*.' -exec mv -f {} Outputpath \; 2) find Inputpath -name '*.' -exec cp {} Outputpath \; 3) find Somepath -name '*.' Now the problem is my Unix version does not support maxdepth Option for find... (7 Replies)
Discussion started by: pchegoor
7 Replies

3. Shell Programming and Scripting

Help needed with find command

Hi! hi I used find command to find some file names as per input from user. I used it for current directory. It was working fine. Now I tried with giving some other directory path. Its giving issues. Here what I tried. Script will take input from user say 1_abc.txt, find the file and print... (6 Replies)
Discussion started by: sukhdip
6 Replies

4. Shell Programming and Scripting

Logic needed to recursive looping in the script

Hello i have a requirement where in a file i will get string. The length could be from 1 to 20. if the string is less than 6 characters ( ex: ABCD) . i need to append 'X' on right hand side to make it 6 characters (ex: ABCDXX). if suppose i get the same string from the file as ABCDXX then i... (5 Replies)
Discussion started by: dsdev_123
5 Replies

5. 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

6. UNIX for Dummies Questions & Answers

Help needed with find command

Hi, I'm a complete noobie at UNIX and have hit a problem. I'm using the 'Talend' ETL tool to try and extract flat files from UNIX on a weekly basis. The dates are maintained in a control table and the appropriate folder has been mounted. I am using a component in 'Talend' which enable... (1 Reply)
Discussion started by: markee
1 Replies

7. 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

8. 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

9. UNIX for Dummies Questions & Answers

Help needed with find command

Hi Guys, Can someone help with this. I have to find out a file name which calls the following sql script "abhishek_to_sdw.sql". In other words it contains a pattern like "abhishek_to_sdw.sql". I have found out using "find" command that the file abhishek_to_sdw.sql is existing on the... (4 Replies)
Discussion started by: max29583
4 Replies

10. UNIX for Advanced & Expert Users

find file with date and recursive search for a text

Hey Guyz I have a requirement something like this.. a part of file name, date of modification of that file and a text is entered as input. like Date : 080206 (MMDDYY format.) filename : hotel_rates text : Jim now the file hotel_rates.ZZZ.123 (creation date is Aug 02 2006) should be... (10 Replies)
Discussion started by: rosh0623
10 Replies
Login or Register to Ask a Question