Visit Our UNIX and Linux User Community


How to find a file with a specific pattern for current sysdate & upon find email the details?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting How to find a file with a specific pattern for current sysdate & upon find email the details?
# 1  
Old 10-03-2013
How to find a file with a specific pattern for current sysdate & upon find email the details?

I need assistance with following requirement, I am new to Unix.
I want to do the following task but stuck with file creation date(sysdate)
Following is the requirement

I need to create a script that will read the abc/xyz/klm folder and look for *.err files for that day’s date and then send an email.

Thanks in advance.
Preet

Last edited by Scott; 10-03-2013 at 05:28 AM.. Reason: Removed overkill formatting
# 2  
Old 10-03-2013
What have you tried so far? When posting your code, enclose it in [code] and [/code] tags please.
# 3  
Old 10-03-2013
Intial Code

I use following command to find the file:

Code:
 
find [PATH] -name "[FILENAME]" -print
example:
find <abc/xyz/klm > -name "*.err" -print

Thanks
Preet

Last edited by PreetArul; 10-03-2013 at 07:14 AM.. Reason: code tags
# 4  
Old 10-03-2013
Files from today, younger than 24 hours, in the current directory
Code:
find . -type f -mtime 0 -name "*.err" -print

More information
Code:
man find

These 2 Users Gave Thanks to MadeInGermany For This Post:
# 5  
Old 10-03-2013
Thanks

Thank you so much

Previous Thread | Next Thread
Test Your Knowledge in Computers #1011
Difficulty: Easy
The number 128 in base 10 equals 10000000 in base 2.
True or False?

9 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

How to find a specific sequence pattern in a fasta file?

I have to mine the following sequence pattern from a large fasta file namely gene.fasta (contains multiple fasta sequences) along with the flanking sequences of 5 bases at starting position and ending position, AAGCZ-N16-AAGCZ Z represents A, C or G (Except T) N16 represents any of the four... (3 Replies)
Discussion started by: dineshkumarsrk
3 Replies

2. UNIX for Dummies Questions & Answers

How to find a file based on pattern & return the filename if found?

Hi all, I am a newbie here. I have this requirement to find a file based on a pattern then return the filename if found. I created a script based on online tutorials. Though, I am stuck & really appreciate if anyone can have a quick look & point me to the right direction? #Script starts... (10 Replies)
Discussion started by: buster_t
10 Replies

3. Shell Programming and Scripting

Getting file Details with find -mmin

I'm new to this and I have done a lot of research and am 99% done with my ksh script BUT I need help with. The script looks at Journal files and reports back on any that have not been updated for 15 min. Everything works but I wanted more detail (added -ls) and now I'm getting dups. Original code:... (2 Replies)
Discussion started by: blackopz
2 Replies

4. Shell Programming and Scripting

Find specific files only in current directory...not sub directories AIX

Hi, I have to find specific 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 am using the below command. And i am... (2 Replies)
Discussion started by: aakishore
2 Replies

5. Shell Programming and Scripting

Finding 4 current files having specific File Name pattern

Hi All, I am trying to find 4 latest files inside one folder having following File Name pattern and store them into 4 different variables and then use for processing in my shell script. File name is fixed length. 1) Each file starts with = ABCJmdmfbsjop letters + 7 Digit Number... (6 Replies)
Discussion started by: lancesunny
6 Replies

6. Shell Programming and Scripting

Script to find string & email

Hi I have a query that some of you may be able to help me with if poss? I'd appreciate it very much. I've got a few log files, that I would like to search for a string. When the string is found, i'd then like to email out the line/sting. If not found, i'd like to email out 'no found'... (2 Replies)
Discussion started by: horhif
2 Replies

7. Shell Programming and Scripting

How to use grep & find command to find references to a particular file

Hi all , I'm new to unix I have a checked project , there exists a file called xxx.config . now my task is to find all the files in the checked out project which references to this xxx.config file. how do i use grep or find command . (2 Replies)
Discussion started by: Gangam
2 Replies

8. UNIX for Dummies Questions & Answers

find the file names having specified pattern at specified position in the current directory

I would need a command for finding first 15000 of the file names whose 25th postion is 5 in the current directory alone. I do have this painful command find . -name '5*' | head -15000 | cut -c3- please refine this. Of course the above command also searches in the sub directories... (3 Replies)
Discussion started by: vk39221
3 Replies

9. Shell Programming and Scripting

how to find entries, NOT starting with specific pattern

Hey,I have a file in following format >1 ABC........ >2 XYZ..... >3 ABC........ >4 MNO....... >5 ABC....... now I would like to find only those entries that doesn't start with ABC (specific pattern)e.g preferred output: >2 XYZ.... >4 MNO....... it will be nice if anybody how... (2 Replies)
Discussion started by: ankitachaurasia
2 Replies

Featured Tech Videos