09-18-2013
Find the latest file based on the date in the filename
Hi,
We've a list of files that gets created on a weekly basis and it has got a date and time embedded to it. Below are the examples. I want to find out how to get the latest files get the date and time stamp out of it.
Files are
PQR123.PLL.M989898.201308012254.gpg
PQR123.PLL.M989898.201308081254.gpg
PQR123.PLL.M989898.201308151554.gpg
PQR123.PLL.M989898.201308221454.gpg
PQR123.PLL.M989898.201308291354.gpg
So from the above files PQR123.PLL.M989898.201308291354.gpg is latest file since it was sent on August 29 at 1:54 pm. I need to get the date and timestamp of it which is "201308291354". Naming convention of the file always remains the same except 4th field is DATE AND TIME.
Need to use an awk command to get it.
Thanks,
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
:confused: There is a flat file on my system which contains email addreses of people in my company. This file is utilized when sending notifications for various things. However nobody knows where this file is located or what it is named. The only thing we know is the email address of a user who... (4 Replies)
Discussion started by: kollerj
4 Replies
2. UNIX for Dummies Questions & Answers
Hi,
I grep for a pattern in a list of files.
"grep -i -l $pattern *.datx*"
it may give me n number of files.
say for eg, it gives me 2 files.
lock_eicu_20071228_00000000.dat_20071228_05343100
lock_eicu_20080501_00000000.dat_20080501_05343900
out of these 2 files I need to get the... (7 Replies)
Discussion started by: prsshini
7 Replies
3. Shell Programming and Scripting
hi all,
not sure if this has been posted b4 but i try to search but not valid.
this is my question:
when i do a ls -ltr there will be a list generated as follows:
-rw-r--r-- 1 root sys 923260 Jan 10 04:38 FilePolling.41025.083TL021.xml
-rw-r--r-- 1 root sys 1761337 Jan 10 04:40... (12 Replies)
Discussion started by: lweegp
12 Replies
4. Shell Programming and Scripting
How to FTP the latest file, based on date, from a remote server through a shell script?
I have four files to be FTP'ed from remote server.
They are of the following format.
build1_runtime_mmddyyyy.txt
build2_runtime_mmddyyyy.txt
build3_runtime_mmddyyyy.txt
buifile_count_mmddyyyy.txt
... (9 Replies)
Discussion started by: imran_affu
9 Replies
5. Shell Programming and Scripting
I am using ksh93 on Solaris.
Ok, this may seem like a simple request at first. I have a directory that contains sets of files with a YYYYMMDD component to the name, along with other files of different filespecs. something like this:
20110501_1.dat
20110501_2.dat
20110501_3.dat... (2 Replies)
Discussion started by: gary_w
2 Replies
6. Shell Programming and Scripting
I'm having problems with my bash script. I would like to find a file matching today's date in the filename, i.e. my_file_20120902.txt and then move it to a different directory, i.e. /tmp. Thanks. (1 Reply)
Discussion started by: jamesi
1 Replies
7. Shell Programming and Scripting
hi i need the shell script to get the file with latest date.
for example in my input folder i have files like
file_20130212.txt
file_20130211.txt
now my output folder should have the file with latest date i.e..file_20120212.txt
i want to get the latest file .. i.e is should take... (6 Replies)
Discussion started by: hemanthsaikumar
6 Replies
8. Shell Programming and Scripting
HI
I have folder in home dir.
/home/kpp/07222013
/home/kpp/07212013
/home/kpp/07202013
Output :--
/home/kpp/07222013
Just find latest date (5 Replies)
Discussion started by: pareshkp
5 Replies
9. UNIX for Dummies Questions & Answers
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
10. Shell Programming and Scripting
Hi,
I have a directory that has numerous files in it, and there is two which are named "filerec_ddmmyyHH24MMSS" by the time they are created so "filerec_010615012250" was created at 01:22:50 on 1st June 2015.
I need to find the most recently created of those 2 files and get the contents of... (4 Replies)
Discussion started by: finn
4 Replies
LEARN ABOUT DEBIAN
gpg-mailkeys
GPG-MAILKEYS(1) General Commands Manual GPG-MAILKEYS(1)
NAME
gpg-mailkeys - sends emails containing keys to their owners
SYNOPSIS
gpg-mailkeys id...
DESCRIPTION
gpg-mailkeys sends the owners of the keys listed on the command line a mail each, containing their public key. After signing, you can use
this tool to send everyone the new signatures they just got.
If you're interested in encrypting the signature before it's sent, in order to verify that the associated address actually belongs to the
key owner, you should check out caff
OPTIONS
None
ENVIRONMENT
NAME Set the name to use when sending messages
EMAIL Set the email address to use when sending messages
SUBJECT Set the subject of the messages you send
TEXT Set the body text of the messages
SENDMAIL_ARGS
Set arguments to pass to /usr/sbin/sendmail. This can be useful to set credentials in order to authenticate to an smtp server
when using ssmtp for example.
FILES
The behavior of gpg-mailkeys can be updated through some files available in the user home directory.
Thus, ~/.gpg-mailkeysrc allows the user to overwrite the default value for the above environment variables, and any text in ~/.signature
will be appended to the end of the body text of the message.
SEE ALSO
gpg(1),caff(1)
AUTHOR
This manual page was written by Simon Richter <sjr@debian.org>.
Nov 23, 2010 GPG-MAILKEYS(1)