How to Find the file in UNIX?

Hello Team,
I Have below list files and i have to find the file with latest date and time
CHECK_300914_200747_xxaa_account_name_20140930195924.txt
CHECK_300914_203213_xxaa_account_name_20140930203055.txt
CHECK_300914_205625_xxaa_account_name_20140930200219.txt
CHECK_300914_211345_xxaa_account_name_20140930200446.txt
CHECK_300914_213836_xxaa_account_name_20140930200718.txt
CHECK_300914_215928_xxaa_account_name_20140930201143.txt
In a list of files "CHECK_300914_215928_xxaa_account_name_20140930201143.txt" is the latest file i.e. ddmmyy:300914 and hhmmss:215928
Can you please help me to find the file in UNIX
Thanks in Advance,

touch CHECK_300914_215928_xxaa_account_name_20140930201143.txt
touch CHECK_300914_211345_xxaa_account_name_20140930200446.txt
touch CHECK_300914_205625_xxaa_account_name_20140930200219.txt
touch CHECK_300914_203213_xxaa_account_name_20140930203055.txt
touch CHECK_300914_200747_xxaa_account_name_20140930195924.txt
ll
total 0
-rw-r--r-- 1 oracle oinstall 0 Oct  7 11:27 CHECK_300914_200747_xxaa_account_name_20140930195924.txt
-rw-r--r-- 1 oracle oinstall 0 Oct  7 11:27 CHECK_300914_203213_xxaa_account_name_20140930203055.txt
-rw-r--r-- 1 oracle oinstall 0 Oct  7 11:27 CHECK_300914_205625_xxaa_account_name_20140930200219.txt
-rw-r--r-- 1 oracle oinstall 0 Oct  7 11:26 CHECK_300914_211345_xxaa_account_name_20140930200446.txt
-rw-r--r-- 1 oracle oinstall 0 Oct  7 11:25 CHECK_300914_213836_xxaa_account_name_20140930200718.txt
-rw-r--r-- 1 oracle oinstall 0 Oct  7 11:25 CHECK_300914_215928_xxaa_account_name_20140930201143.txt
We are interesting in file with maximal values in "field" 2 and 3 assuming that fields are parts of filename separated with "_". I especially created (the file we are interested in) CHECK_300914_215928_xxaa_account_name_20140930201143.txt file to be the first created/modified file.
find . -name CHECK_300914_215928_xxaa_account_name_20140930201143.txt
./CHECK_300914_215928_xxaa_account_name_20140930201143.txt
will definitely work. But we should know the file name. As for topicstarter note it is not the case.
ls -tr . | tail -1
CHECK_300914_200747_xxaa_account_name_20140930195924.txt
gave incorrect file.
ls -l . | cut -d" " -f10 | sed 's/\(^CHECK_\)\([0-9]\{2\}\)\([0-9]\{2\}\)\([0-9]\{2\}\)\(.*\)/\1\4\3\2\5/' | sort -r | head -1 | sed 's/\(^CHECK_\)\([0-9]\{2\}\)\([0-9]\{2\}\)\([0-9]\{2\}\)\(.*\)/\1\4\3\2\5/'
CHECK_300914_215928_xxaa_account_name_20140930201143.txt
P.S.
I much apologize for an error in back filename transformation. Correct is marked in bold red.

Similar Messages

  • How to find the File name using the FTP Adapter

    hi all,
    how to find the File name using the FTP Adapter with BPEL.
    Regards

    Found the solution for this.
    First In the mediator's routing rule use assign property $in.property.jca.file.FileName to $out.property.jca.file.FileName
    In the BPEL's receive activity go to the properties tab and get the property to a BPEL variable. That should do it.
    Thanks for the posts

  • How to find the file that delete from time capsule?

    How to find the file that delete from time capsule?

    I mean I saved JPEG file in Time capsule and unfortunately delete the file. Can I get it back
    IF.... .no other backups have occured since you deleted the file, you might be able to retrieve it using an application like Disk Warrior. It's about $100 as I recall, and there are no guarantees that it will work.
    DiskWarrior 4 - The Disk Utility for Mac  Disk Repair, Mac Directory ...
    Any of the free or low priced utilities that you might see or try will not be able to retrieve a deleted file from a Time Capsule.
    If any backups have occured since you deleted the file, the deleted file has almost certainly been overwritten. No way to retrieve it in that case.

  • How to find the file versions in Oracle applications?

    I am requested by the Oracle applications team to check the versions of the following files.
    POXWPA6B.pls-115.68.11510.6
    POXWPA7B.pls-115.38.11510.7
    I have zero experience in managing oracle applications. I would appreciate if some one could let me know how to find the versions in my server. My DB and the applications are in Linux servers.
    Also would appreciate if some one could provide pointers to handling Application DBA scenario like this.
    Thanks,
    -- Bala

    Here is an example:
    1) /u01/oracle/testappl/po/11.5.0/patch/115/sql>strings -a POXWPA7B.pls | grep -i Header
    /* $Header: POXWPA7B.pls 115.3 1999/11/10 16:10:34 pkm ship       $ */
    /* $Header: POXWPA7B.pls 115.3 1999/11/10 16:10:34 pkm ship       $ */
    2) /u01/oracle/testappl/po/11.5.0/patch/115/sql>adident Header POXWPA7B.pls
    POXWPA7B.pls:
    $Header POXWPA7B.pls 115.3 1999/11/10 16:10:34 pkm ship       $
    $Header POXWPA7B.pls 115.3 1999/11/10 16:10:34 pkm ship       $

  • How to find the file type without the file extension using indesign javascript (.jsx)

    hi,
    How to identify the file type (eg: InDesign or Quark) without knowing their file type. How can we find what kind of file is that??? without their extension like ('.indd','.qxd') before import to the document...

    Hi subha_oviya,
    Take a look at the file filtering section in the InDesign CS3 sample script ImageCatalog.jsx to see how to look for file types. I'm assuming that you're using InDesign CS3, and that you're using the Mac OS--you didn't say.
    Thanks,
    Ole

  • HT1199 My iTunes music list all have the exclamation point.  I do not know how to find the files to restore the music.  Any advice?

    All the songs in my iTunes have the exclamation point.  I do not know how to find location of the music...any suggestions?

    Ok, your music could be in one of a coupel formats, MP3 or, more likely, Apples AAC format, which has a m4a prefix.  Open Finder.  Hold Command and press F, this will open a search window in the top of Finder.  Type mp3 here, let it search.  If it finds your music files, double tap on one and "open Enclosing Folder"  That should show you where they are at.  If nothing is found, try searching m4a instead.  One of the two should show you where your music is.

  • How to RENAME the file in UNIX-Appl. server, after READING it?

    Hi Experts,
    Following is my requirement,
    What we are wanting here is the functionality added to this program that once the UNIX file is processed, that it can be closed and then renamed on the Application server with the yyyymmdd extension.  For example, the program reads and processes the My_file.csv file today.  Once it's finished, it then closes the file and renames it as My_file20080610.csv.  By doing this, it will prevent the same file from being run the next day in case the new file is not sent. 
    So, pls. let me know that, How to RENAME is file in the UNIX - Appl. server, after reading it? obviuosly I closes it at the end.
    thanq

    Hi Srinivas,
    You can create a My_file20080610.csv. Write the content from My_file.csv into My_file20080610.csv. Then using DELETE DATASET delete the file My_file.csv.
    Thanks
    Romit

  • How to find the file is exists or not ?

    Hi,
    I am exporting data from forms to excel file with user intervention. i need to give a message when the user select the existing file.
    How can we find whether the file is exists in the selected path or not in forms?
    Thanks in advance
    gopi

    with webutil you can use the webutil_file.exists function in the webutil pll.

  • How to find the file by name and identify its type?

    Hi,
    In a folder thare are many files, the file types are doc, docx, pdf, and rtf. The file name is something like "FirstName LastName(more extrat letters).filetype".
    Now I would like to find all the files with a certain name and identify their types. For example, by input "Bill Gates", I would get the list of all files :
    Bill Gates.doc, Bill Gates-2010.pdf etc ...
    Any good ideas are welcome.
    Pengyou

    For finding files whose names match a certain pattern, create a FileFilter or FilenameFilter that returns true when the name matches the pattern in question, and then call list() or listFiles() with that filter.
    For identifying the "type", that depends what you mean. File's don't actually have a type. It's just that they're interpreted as such in some contexts. The simplest thing is to just look at the extension. You can be more sophisticated than that, but that gets complicated real fast. It depends what you're actually trying to accomplish.

  • How to find the file name

    Hi All,
    How to test the data when a file name is given? for ex: this is file name given to me in which t.code shall i seach this?
    Here is the file name:
    IP30101/0002/420/5835/0129/T/01/420F.2008012113155 (Interface/syncra id/ TLC/ Dataid/ Rec. length/ Format/ Batch id). I assume, 420F somehow related to sales organisation.
    please let me know how to do it.
    Thanks in advance

    Hello,
    Check the TCode AL11
    Cheers,
    Vasanth

  • Consolidating itunes media library-how to shorten file names or how to find the file that is creating the problem?

    Hi I've switched to Mac for six months now, so is still new to mac and I am using my old 1TB windows PC side by side for my music collection. Now I have seen the posts already in apple community about consolidating itunes music library but could not get the proper way of doing it. My system and itunes is also saying 'file name is too long' and it stops but the questin is how do I know which file is creating the problem and how do I shorten it?
    If anybody can answer I'll be obliged to him/her, because its my 6/7 years of music collection stuck in an old pc. Thanks in advance.
    - Javed

    By 'it stops' I meant the consolidation process in itunes stops.

  • How to find the number of data items in a file written with ArryToFile function?

    I have written an array of number in 2 column groups to a file using the LabWindows/CVI function ArrayToFile...Now if I want to read the file with FileToArray Function then how do I know the number of items in the file. during the write time I know how many array items to write. but suppose I want the file to read at some later time then How to find the number of items in the file,So that I can read the exact number and present it. Thanks to all
    If you are young work to Learn, not to earn.
    Solved!
    Go to Solution.

    What about:
    OpenFile ( your file );
    cnt = 0;
    while ((br = ReadLine ( ... )) != -2) {
    if (br == -1) {
    // I/O error: handle it!
    break;
    cnt++;
    CloseFile ( ... );
    There are some ways to improve performance of this code, but if you are not reading thousands of lines it's quite fast.
    After this part you can dimension the array to pass to FileToArray... unless you want to read it yourself since you already have it open!
    Proud to use LW/CVI from 3.1 on.
    My contributions to the Developer Zone Community
    If I have helped you, why not giving me a kudos?

  • I have problem with Itunes losing where podcasts and some purchased music is located. Don't know how Itunes losing the locations of the files and I can't find the files on my hard drive. What can I do to stop Itunes losing location and restore my files?

    I have problem with Itunes losing where podcasts and some purchased music is located. Don't know how Itunes losing the locations of the files and I can't find the files on my hard drive. What can I do to stop Itunes losing location and restore my files?

    Try assigning Queen as the Album Artist on the compilations in iTunes on your computer.

  • I put in my memory card to the left side of the computer, but I cannot find the file of pictures anywhere. Its not even on my desktop. What should I do and how can I get it to show up on my desktop?

    I put in my memory card to the left side of the computer, but I cannot find the file of pictures anywhere. Its not even on my desktop. What should I do and how can I get it to show up on my desktop?

    If your Mac is new-ish and has one of the Lions as its OS, the drives, cards, USB sticks no longer show up, even though they're there. Go to Finder's Preferences and tick the corresponding items in the General and Sidebar tabs.

  • My computer is saying it can't find the file 'iTunes64.msi' when I try to update or redownload iTunes how do I fix this? I've tried just about everything I can think of. I am using a dell laptop running windows 7 and have tried changing the file loca

    My computer is saying it can't find the file 'iTunes64.msi' when I try to update or redownload iTunes how do I fix this? I've tried just about everything I can think of. I am using a dell laptop running windows 7 and have tried changing the file location to run the update in all of my iTunes files as well as when I've tried reinstalling it.

    For general advice see Troubleshooting issues with iTunes for Windows updates.
    The steps in the second box are a guide to removing everything related to iTunes and then rebuilding it which is often a good starting point unless the symptoms indicate a more specific approach. Review the other boxes and the list of support documents further down the page in case one of them applies.
    The further information area has direct links to the current and recent builds in case you have problems downloading, need to revert to an older version or want to try the iTunes for Windows (64-bit - for older video cards) release as a workaround for installation or performance issues, or compatibility with QuickTime or third party software.
    Your library should be unaffected by these steps but there are also links to backup and recovery advice should it be needed.
    tt2

Maybe you are looking for

  • Upgrade from vista to windows 7 home premium

    I want to upgrade from vista to windows home premium but I'm told I need to find out if my computer can actually support windows 7. Can someone tell me how do I find out if my computer is able to be upgraded to windows 7? I have an hp pavilion with a

  • Microsoft Outlook Doesn't Like Me Anymore

    "When I try to log on to Microsoft Outlook, my msn account, I get this message, "The connection to microsoft exchange is unavailable. Outlook must be online or connected to complete this action." I am connected to the internet. I don't know how to fi

  • Profit center not found in controlling area

    Hello all, While trying to change the wbs element of a PO in ME22N, I am getting the error message "Profit center XXXX not found in controlling area". Do any one hava an idea how to fix this problem? Thanks in advance for your help, Soumaya

  • Windows can't open this file : ***.exe.

      I am facing problem while launching any exe file on my machine and while launch any exe getting message as below. Windows can't open this file : ****.exe. for each exe file am getting the error like taskmgr.exe, cmd.exe,msconfig.exe. System config:

  • Windows version of Safari, PDF Problems

    Hi out there,                     I am having major problems with Safari in Windows ( not my choice to have to use Windows, but my choice to use Safari, Mac user at home ). Anyway I cannot get Safari to Open/Read PDF's and it is really becoming a pai