Sponsored Content
Top Forums Shell Programming and Scripting How to print the specific part of the file name with file creation date? Post 303011429 by sadique.manzar on Thursday 18th of January 2018 07:41:12 AM
Old 01-18-2018
How to print the specific part of the file name with file creation date?

Hello Folks,

I have an requirement, where i need to get total count of the file based on creation date with there filename selected pattern.

Filename: MobileProtocol.20171228T154200.157115.udr

I want to get the count of files created on each day based on a pattern find.


Code:
find . -type f -name "MobileProtocol.20171228T*" -printf '%TY-%Tm-%Td\n'|sort | uniq -c

Output is :

Code:
 1686 2017-12-28 
 287 2017-12-30
   1 2018-01-01
   1 2018-01-02
   2 2018-01-03
   1 2018-01-05
   2 2018-01-06
   3 2018-01-07
   1 2018-01-08
   1 2018-01-09
   1 2018-01-10
  35 2018-01-11

I want print pattern of the files too in my script.
Kindly guide and help me.

Output looking for is :

Code:
1686 2017-12-28 20171228  <--- from file pattern
 287 2017-12-30 20171228
   1 2018-01-01 20171228
   1 2018-01-02 20171228
   2 2018-01-03 20171228
   1 2018-01-05 20171228
   2 2018-01-06 20171228
   3 2018-01-07 20171228
   1 2018-01-08 20171228
   1 2018-01-09 20171228
   1 2018-01-10 20171228
  35 2018-01-11 20171228

Moderator's Comments:
Mod Comment Please use CODE tags (for data as well!) as required by forum rules!

Last edited by rbatte1; 01-18-2018 at 10:12 AM.. Reason: Added CODE tags.
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

file creation date including seconds

Hi, Is anybody can help me to get the file creation date with seconds? -rw-r--r-- 1 opsc system 422550845 Aug 22 15:41 StatData.20020821 Thanks in advance Krishna (7 Replies)
Discussion started by: krishna
7 Replies

2. UNIX for Dummies Questions & Answers

file creation date & time

Hi All, I have some files which are creates every day using a script. I want to create a log files which does write "filename,creation day and time" how can I do this ?? Alice (3 Replies)
Discussion started by: alisevA3
3 Replies

3. UNIX for Dummies Questions & Answers

Changing Creation Date to a Prespecified Date of a File In Unix

Dear Expert, Is there a command to do that in Unix? In such a way that we don't need to actually "write" or modified the content. -- monkfan (4 Replies)
Discussion started by: monkfan
4 Replies

4. Shell Programming and Scripting

How to get File creation date.

Hi All, I need to get file creation date. I have to access one file who's name is like... abc.log092308 and the date changes as per current date. And i am accessing this file next day. meance in above case i will access above file on 09-24-2008 Also one problem is that this file... (2 Replies)
Discussion started by: Jeevan Salunke
2 Replies

5. Solaris

gzip a file and append creation date stamp to file

I want to gzip a file and append the creation date to the end of the file. How can I accomplish this task. Basically they are log files which need a creation date stamp appended to make sure they do not overwrite other log files. -jack (3 Replies)
Discussion started by: jacktravine
3 Replies

6. Shell Programming and Scripting

how to find creation date of file

Hi, I just need to know way of getting date of file when it was created. eg i have a file abc created on 23 aug. Now i need to know date of file i.e. 23 aug. How can i get that data. Thanks Sarbjit (7 Replies)
Discussion started by: sarbjit
7 Replies

7. Shell Programming and Scripting

finding creation date of a file

Hi, Can anyone tell me a process to find the creation date of a file in a directory. If suppose I have a file in a directory created in 2009 -rw-r--r-- 1 xyz guest 2480 Jul 16 2009 sample.txt The command should return the the file creation date as 16/07/2009 thanks, (2 Replies)
Discussion started by: swathich
2 Replies

8. Shell Programming and Scripting

Help with creating a text file in perl with file creation date.

Hi, I am quite new to Perl scripting and i need to create a .TXT file using perl, with fields (A,B,C,D,E), and this text file should be named with current file creation date "XYZ_CCYYMMDD.TXT" (i.e.XYZ_2011042514:33 PM). Can anyone who has done this, please share their expertise on this... (5 Replies)
Discussion started by: msrahman
5 Replies

9. Shell Programming and Scripting

[Solved] Printing a part of the last line of the specific part of a file

Hi, I have 80 large files, from which I want to get a specific value to run a Bash script. Firstly, I want to get the part of a file which contains this: Name =A xxxxxx yyyyyy zzzzzz aaaaaa bbbbbb Value = 57 This is necessary because in a file there are written more lines which... (6 Replies)
Discussion started by: wenclu
6 Replies

10. Shell Programming and Scripting

Script to print file name and its creation date

Hello , I am looking for a script to print file name and its last updated time. FILE CREATION-TIME FILE-NAME 24/10/2017 12:34 TDR-IU-8-2017.10.24.07:40:00-2017.10.24.07:45:00 when we run l command it print the directory and the files with details like permission,... (1 Reply)
Discussion started by: sadique.manzar
1 Replies
CRL(1SSL)                                                             OpenSSL                                                            CRL(1SSL)

NAME
openssl-crl, crl - CRL utility SYNOPSIS
openssl crl [-help] [-inform PEM|DER] [-outform PEM|DER] [-text] [-in filename] [-out filename] [-nameopt option] [-noout] [-hash] [-issuer] [-lastupdate] [-nextupdate] [-CAfile file] [-CApath dir] DESCRIPTION
The crl command processes CRL files in DER or PEM format. OPTIONS
-help Print out a usage message. -inform DER|PEM This specifies the input format. DER format is DER encoded CRL structure. PEM (the default) is a base64 encoded version of the DER form with header and footer lines. -outform DER|PEM This specifies the output format, the options have the same meaning and default as the -inform option. -in filename This specifies the input filename to read from or standard input if this option is not specified. -out filename Specifies the output filename to write to or standard output by default. -text Print out the CRL in text form. -nameopt option Option which determines how the subject or issuer names are displayed. See the description of -nameopt in x509(1). -noout Don't output the encoded version of the CRL. -hash Output a hash of the issuer name. This can be use to lookup CRLs in a directory by issuer name. -hash_old Outputs the "hash" of the CRL issuer name using the older algorithm as used by OpenSSL before version 1.0.0. -issuer Output the issuer name. -lastupdate Output the lastUpdate field. -nextupdate Output the nextUpdate field. -CAfile file Verify the signature on a CRL by looking up the issuing certificate in file. -CApath dir Verify the signature on a CRL by looking up the issuing certificate in dir. This directory must be a standard certificate directory: that is a hash of each subject name (using x509 -hash) should be linked to each certificate. NOTES
The PEM CRL format uses the header and footer lines: -----BEGIN X509 CRL----- -----END X509 CRL----- EXAMPLES
Convert a CRL file from PEM to DER: openssl crl -in crl.pem -outform DER -out crl.der Output the text form of a DER encoded certificate: openssl crl -in crl.der -inform DER -text -noout BUGS
Ideally it should be possible to create a CRL using appropriate options and files too. SEE ALSO
crl2pkcs7(1), ca(1), x509(1) COPYRIGHT
Copyright 2000-2018 The OpenSSL Project Authors. All Rights Reserved. Licensed under the OpenSSL license (the "License"). You may not use this file except in compliance with the License. You can obtain a copy in the file LICENSE in the source distribution or at <https://www.openssl.org/source/license.html>. 1.1.1a 2018-12-18 CRL(1SSL)
All times are GMT -4. The time now is 09:53 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy