Computer Hope
Software => BSD, Linux, and Unix => Topic started by: Ramesh0129 on August 21, 2009, 09:28:50 AM
-
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.
-
i am not very good with UNIX ether and i dont like it
but i think it is
dir --full-time
-
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.
-
hmm thats funny
i dont think that works on ls
-
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.
-
some unix systems hvae dir built in
-
some unix systems hvae dir built in
none that I've ever seen.
-
depends on the shell
-
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.
-
you could download the GNU utils or try
ls --full-time
-
advice to Solaris user: "Download the GNU utils" ::)
-
if u comile from source they should work fine
-
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.
-
@salmon, how about showing smeeze how its done then , on Solaris.