Search files that start with current date


 
Thread Tools Search this Thread
Operating Systems Linux Debian Search files that start with current date
# 1  
Old 10-17-2012
Search files that start with current date

hi all,
i need to find same files in my directory that looks like this format
20121017145949639.xml (YYYYMMDD*.xml)
thanks for help
# 2  
Old 10-17-2012
Code:
find . -name "20121017*.xml"

This User Gave Thanks to Yoda For This Post:
# 3  
Old 10-18-2012
Quote:
Originally Posted by merouan
hi all,
i need to find same files in my directory that looks like this format
20121017145949639.xml (YYYYMMDD*.xml)
thanks for help
What bipinajith suggested is a good solution if you want all files in the file hierarchy rooted in the current directory with names that start with "20121017" and end with ".xml". If you just want files in the current directory (but not those in subdirectories) that have names that start with a YYYYMMDD value that matches today's date and end with ".xml", try this:
Code:
ls -1d $(date +%Y%m%d)*.xml

This User Gave Thanks to Don Cragun For This Post:
# 4  
Old 10-18-2012
THANKS ALL FOR REPLY IT WORKS
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Splitting week start date and end date based on custom period start dates

Below are my custom period start and end dates based on a calender, these dates are placed in a file, for each period i need to split into three weeks for each period row, example is given below. Could you please help out to achieve solution through shell script.. File content: ... (2 Replies)
Discussion started by: nani2019
2 Replies

2. UNIX for Beginners Questions & Answers

How to replace a parameter(variable) date value inside a text files daily with current date?

Hello All, we what we call a parameter file (.txt) where my application read dynamic values when the job is triggered, one of such values are below: abc.txt ------------------ line1 line2 line3 $$EDWS_DATE_INSERT=08-27-2019 line4 $$EDWS_PREV_DATE_INSERT=08-26-2019 I am trying to... (1 Reply)
Discussion started by: pradeepp
1 Replies

3. UNIX for Beginners Questions & Answers

UNIX script to replace old date with current date dynamically in multiple files present in a folder

I am trying to work on a script where it is a *(star) delimited file has a multiple lines starts with RTG and 3rd column=TD8 I want to substring the date part and I want to replace with currentdate minus 15 days. Here is an example. iam using AIX server $ cat temp.txt RTG*888*TD8*20180201~... (1 Reply)
Discussion started by: Shankar455
1 Replies

4. Shell Programming and Scripting

Script to Search Logs Several Directories Pulling out Only Current Date

Hi All.. I'm seeking assistance with editing a script to search log files in several directories. I'm close to what I'm seeking, but need additional guidance. The log files are always listed by current date; however, inside the log file includes dates that go back to 2011. What I'm... (6 Replies)
Discussion started by: lenaf7
6 Replies

5. Shell Programming and Scripting

Renaming of multiple files with current date

Hi, I have a fixed 4 files in each different directory. The total 17 directories are there each one having 4 files inside it. I need rename all of them with current date. The files formates will be as below: Folder1: abc_NOR_xyz_ddmmyyyy.txt abc_NOR_ghij_ddmmyyyy.txt Folder2:... (5 Replies)
Discussion started by: rjanardhan83
5 Replies

6. UNIX for Dummies Questions & Answers

Search for a file with Current Date

Hi, How can we search for a file with current date(sysdate). Actually i want the file name from a directory which was created today(current date). For example i have a dir /home/arch and i have files with name aglito03axyz.datetimestamp in this directory, but all these files were created... (7 Replies)
Discussion started by: sandeep_1105
7 Replies

7. UNIX for Dummies Questions & Answers

listing files that does not belong to current date

How do we list all the file names in a directory that does not belong to current date. (3 Replies)
Discussion started by: esh.mohan
3 Replies

8. Shell Programming and Scripting

listing files that do not belong to current date

How do we list all the file names in a directory that does not belong to current date. (1 Reply)
Discussion started by: esh.mohan
1 Replies

9. UNIX for Dummies Questions & Answers

how to find files less than the current date

Hai, i have one directory contains 100 files .each file name like xvb_dateformat.i want find which file names are xvb_lessthan or equal to currentdate. any one give the solution. regards (4 Replies)
Discussion started by: mallikarjuna
4 Replies

10. Shell Programming and Scripting

Command to recursivly search all html files below the current

hi! i need a command to recursivly search all html files below the current directory for the string "ABCDE". that´s very important to me, thanx!!! (3 Replies)
Discussion started by: inane
3 Replies
Login or Register to Ask a Question