Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: How to get the COMPLETE last modified DATE and TIME for files OLDER than 6 Month  (Read 7477 times)

0 Members and 1 Guest are viewing this topic.

Ramesh0129

    Topic Starter


    Starter

    Hi UNIX GURUs,

    Please help me in finding a solution for the following strange question. I have a unique requirement for which I need to get the COMPLETE TIME STAMP of last modified DATE and TIME (that should include all time stamp parameters: YEAR, MONTH, DAY, HOUR and TIME) for all the files in the given folder/directory.

    At present I tried different forms of LS command, but the “ls” command is not giving the YEAR information for the most recent files that are last updated recently (with in 6 months), and at the same time for the files that are last modified more than 6 months ago, it is not giving the HOURS and MINUTES information. Basically for the older files, the YEAR is replacing the HOUR and TIME information.

    My requirement is that I need to get all the time stamp parameters (Year, Month, Day, Hour and Minutes) for all the files.

    Thank you very much for your time and any help is much appreciated.

    Sincerely,
    Unix Newbie.

    smeezekitty

    • Guest
    i am not very good with UNIX ether and i dont like it
    but i think it is
    Code: [Select]
    dir --full-time

    Ramesh0129

      Topic Starter


      Starter

      Thank you Smeezekitty. For some reason the DIR command is not working on my system. I am getting a message "dir: command not found." I am working on SOLARIS Operating System.

      smeezekitty

      • Guest
      hmm thats funny
      i dont think that works on ls

      Quantos



        Guru
      • Veni, Vidi, Vici
      • Thanked: 170
        • Yes
        • Yes
      • Computer: Specs
      • Experience: Guru
      • OS: Linux variant
      Thank you Smeezekitty. For some reason the DIR command is not working on my system. I am getting a message "dir: command not found." I am working on SOLARIS Operating System.

      That's because he gave you a DOS command.  It obviously won't work with UNIX.

      Sit tight and someone that DOES know will be along.
      Evil is an exact science.

      smeezekitty

      • Guest
      some unix systems hvae dir built in

      BC_Programmer


        Mastermind
      • Typing is no substitute for thinking.
      • Thanked: 1140
        • Yes
        • Yes
        • BC-Programming.com
      • Certifications: List
      • Computer: Specs
      • Experience: Beginner
      • OS: Windows 11
      some unix systems hvae dir built in


      none that I've ever seen.
      I was trying to dereference Null Pointers before it was cool.

      smeezekitty

      • Guest
      depends on the shell

      gh0std0g74



        Apprentice

        Thanked: 37
        That's because he gave you a DOS command.  It obviously won't work with UNIX.

        Sit tight and someone that DOES know will be along.
        dir comes from GNU coreutils, and yes, it definitely is a linux command (as well).
        basically its the same as ls -C -b. check info coreutils 'dir invocation' for more info.

        smeezekitty

        • Guest
        you could download the GNU utils or try
        ls --full-time

        Salmon Trout

        • Guest
        advice to Solaris user: "Download the GNU utils"  ::)

        smeezekitty

        • Guest
        if u comile from source they should work fine

        Salmon Trout

        • Guest
        If you are running Solaris (a kind of Unix) you don't need any "GNU utils"; you just need to write a shell script. I should have thought that an expert like you would have realised that.

        gh0std0g74



          Apprentice

          Thanked: 37
          @salmon, how about showing smeeze how its done then , on Solaris.