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
MPSImageEuclideanDistanceTransform(3)			 MetalPerformanceShaders.framework		     MPSImageEuclideanDistanceTransform(3)

NAME
MPSImageEuclideanDistanceTransform SYNOPSIS
#import <MPSImageDistanceTransform.h> Inherits MPSUnaryImageKernel. Instance Methods (nonnull instancetype) - initWithDevice: (nullable instancetype) - initWithCoder:device: Additional Inherited Members Detailed Description MPSImageDistanceTransform.h MetalPerformanceShaders Copyright: Copyright (c) 2018 Apple Inc. All rights reserved. MetalPerformanceShaders distance transform filters Perform a Euclidean Distance Transform Method Documentation - (nullable instancetype) initWithCoder: (NSCoder *__nonnull) aDecoder(nonnull id< MTLDevice >) device NSSecureCoding compatability While the standard NSSecureCoding/NSCoding method -initWithCoder: should work, since the file can't know which device your data is allocated on, we have to guess and may guess incorrectly. To avoid that problem, use initWithCoder:device instead. Parameters: aDecoder The NSCoder subclass with your serialized MPSKernel device The MTLDevice on which to make the MPSKernel Returns: A new MPSKernel object, or nil if failure. Reimplemented from MPSUnaryImageKernel. - (nonnull instancetype) initWithDevice: (nonnull id< MTLDevice >) device Specifies information to apply the statistics min-max operation on an image. Parameters: device The device the filter will run on Returns: A valid MPSImageEuclideanDistanceTransform object or nil, if failure. Reimplemented from MPSUnaryImageKernel. Author Generated automatically by Doxygen for MetalPerformanceShaders.framework from the source code. Version MetalPerformanceShaders-100 Thu Feb 8 2018 MPSImageEuclideanDistanceTransform(3)
All times are GMT -4. The time now is 04:48 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy