Find files in specific folders


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Find files in specific folders
# 1  
Old 05-03-2017
Find files in specific folders

Hi Team,

I am new to the linux commands and I really need help . I would be really thankful if I can get some inputs.

I have below folders in the path "/home/temp"

Code:
20170428
20170427
20170429
changes
temp

I need to get the files generated in the last 15 mins in all the above folders except the folder changes and temp or in other way I need to get the files generated in last 15 mins by only looking into the date specific folders .

The command "find "/home/temp" -type f -mmin -15 is looking into all the folders. Is there any way to get what I need ?

Br,
Jack


Moderator's Comments:
Mod Comment Please use CODE tags as required by forum rules!

Last edited by RudiC; 05-03-2017 at 06:51 PM.. Reason: Added CODE tags.
# 2  
Old 05-03-2017
Code:
find "/home/temp/2*" -type f -mmin -15

This User Gave Thanks to crystal_pup For This Post:
# 3  
Old 05-04-2017
find "/home/temp/2*" doesnt work

find "/home/temp/2*" is not working.. I get the error as No such file or directory . btw the path is available.

Last edited by JackJinu; 05-04-2017 at 02:17 AM..
# 4  
Old 05-04-2017
No quotes, the start directory is to be evaluated by the shell.
Code:
find /home/temp/[0-9]* -type f -mmin -15

Note this can include yet incomplete files that are just written.
# 5  
Old 05-04-2017
Thankyou @MadeinGermany

Thanks for the valuable inputs .
Smilie

Yes its working , though I need to take care of the incomplete files, I will check that part.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Find and Replace from specific folders

Hello Experts, Any help is appreciated. I would like to find and replace a string in a specific file ( e.g abc.xml) only for the directories starting with "AB 1.0 DIR". I've 50 sub directories starting with "AB 1.0 DIR". And I would like find the file abc.xml in those sub-directories and... (4 Replies)
Discussion started by: builderj
4 Replies

2. Shell Programming and Scripting

Bash to move specific files from folders in find file

I have a directory /home/cmccabe/nfs/exportedReports that contains multiple folders in it. The find writes the name of each folder to out.txt. A new directory is then created in a new location /home/cmccabe/Desktop/NGS/API, named with the date. What I am trying to do, unsuccessfully at the moment,... (7 Replies)
Discussion started by: cmccabe
7 Replies

3. Shell Programming and Scripting

How to delete all the files and folders inside all the directories except some specific directory?

hi, i have a requirement to delete all the files from all the directories except some specific directories like archive and log. for example: there are following directories such as A B C D Archive E Log F which contains some sub directories and files. The requirement is to delete all the... (7 Replies)
Discussion started by: Little
7 Replies

4. Shell Programming and Scripting

Bash to download specific files and save in two folders

I am trying to download all files from a user authentication, password protected https site, with a particular extension (.bam). The files are ~20GB each and I am not sure if the below is the best way to do it. I am also not sure how to direct the downloaded files to a folder as well as external... (7 Replies)
Discussion started by: cmccabe
7 Replies

5. Shell Programming and Scripting

Compare 2 folders to find several missing files among huge amounts of files.

Hi, all: I've got two folders, say, "folder1" and "folder2". Under each, there are thousands of files. It's quite obvious that there are some files missing in each. I just would like to find them. I believe this can be done by "diff" command. However, if I change the above question a... (1 Reply)
Discussion started by: jiapei100
1 Replies

6. Shell Programming and Scripting

get a list of folders and find files older than...

I am trying to get a list of folders contained in a given directory and would then like to delete any folders/files older than 60mins. So far I am able to get the list of folders using: ls -l /home/uploads | grep '^d.*' the output: drwxr-xr-x 6 flk flk 4096 2010-02-11 13:30... (2 Replies)
Discussion started by: flk
2 Replies

7. UNIX for Dummies Questions & Answers

Monitoring specific files and folders

I want a mechanism to monitor a folder full of files that are sensitive. I want to log all accesses,modifications and changes to any file within the folder in a log file which should give me access/modify/change times,the user id of the process which tried and the pid. Even some idea of what to... (1 Reply)
Discussion started by: Vivek788
1 Replies

8. Shell Programming and Scripting

Copying specific files from remote m/c to specific folders

Hi All, I am trying to rsync some of the latest files from remote m/c to my local linux box. Folder structure in my remote m/c looks like this /pub/Nightly/Package/ROLL/WIN /pub/Nightly/Package/SOLL/sol /pub/Nightly/Package/SOLL/linux Each of the folder contains gzip files which on daily... (0 Replies)
Discussion started by: jhoomsharabi
0 Replies

9. Shell Programming and Scripting

decompressed files to specific folders

Hi all, I have a script below which meant to decompress *.tr.gz to allocated folder. e.g. hello.tar.gz should be decompress to a subdirectory called hello and all the files should be in hello subdirectory. How do i do it? Am i missing anything? Condition: there are existing tar.gz in teh... (3 Replies)
Discussion started by: c00kie88
3 Replies

10. Shell Programming and Scripting

Find and replace files in multiple folders

Hi there, I would like to write a script to automate the copy and renaming of files in multiple dir. I have a generic file named s253e.prb and would like to copy this to multiple dir and rename it. Example: Dir is AL-M1 and the prb file name is AL-M1.prb. I would like to be able to... (6 Replies)
Discussion started by: lodey
6 Replies
Login or Register to Ask a Question