From: Jon LaBadie on 31 Dec 2009 12:33 Atropo wrote: > Hi all, > > I searched similar post about, but some of them i didn't understand > and the others were about file name manipulation. what i want is just > list the files of an specific hour (any minute) from specific date. > i stuck with the hour part. > > ls -l | awk ' if (($6=="Dec") && ($7=="29") && ( $8 ~ /08/ )) {print > $0}' > > /usr/bin/awk on solaris 9 > > the last time it worked was > > ls -l | awk ' $6=="Dec" && $7=="29" {print $0}' > You could use the -newer option of find and some limit files: touch -t 200912291059.59 oldest touch -t 200912291200.00 newest find <dir> -newer oldest ! -newer newest -ls
From: stan on 31 Dec 2009 16:27 pk wrote: > mop2 wrote: > >>>> $ \ls -l|grep '2009-12-29 11' >>>> drwxr-xr-x 5 web ppp 4096 2009-12-29 11:55 gtkdialog-0.7.20 >>>> -rw-r--r-- 1 web ppp 280408 2009-12-29 11:54 gtkdialog-0.7.20.tar.gz >>>> drwx------ 5 web ppp 4096 2009-12-29 11:40 yaf-splash-1.02 >>>> -rw-r--r-- 1 web ppp 81391 2009-12-29 11:30 yaf-splash-1.02.tar.gz >>> >>> What shell are you using? I tried bash on cygwin and ksh on Solaris and >>> they both produce the "monthname dayname time" timestamp. >> >> Hi Ed, >> >> $ $0 --version|head -n1;ls --version|head -n1 >> GNU bash, version 4.0.35(1)-release (i686-pc-linux-gnu) >> ls (GNU coreutils) 8.2 >> >> $ for s in `\ls /bin/*sh`;do $s -c "printf \"\$0:\t\";ls -l xtctl";done >> 2>/dev/null >> /bin/ash: -rwxr-xr-x 1 web ppp 3515 2009-10-16 12:08 xtctl >> /bin/bash: -rwxr-xr-x 1 web ppp 3515 2009-10-16 12:08 xtctl >> /bin/ksh: -rwxr-xr-x 1 web ppp 3515 2009-10-16 12:08 xtctl >> /bin/rksh: -rwxr-xr-x 1 web ppp 3515 2009-10-16 12:08 xtctl >> /bin/sh: -rwxr-xr-x 1 web ppp 3515 2009-10-16 12:08 xtctl >> /bin/zsh: -rwxr-xr-x 1 web ppp 3515 2009-10-16 12:08 xtctl >> >> I don't know why this time format is here, but I like it. > > It seems somehow related to localization, eg see > > # LC_ALL=C ls -l foo > -rw-r--r-- 1 root root 356 Nov 17 23:14 foo > # LC_ALL=en_US.utf8 ls -l foo > -rw-r--r-- 1 root root 356 2009-11-17 23:14 foo cygwin recently switched to using LC_ALL=C.UTF-8 as the default system locale. It's very new and the growing pains are still non-trivial. It's worse than simply switching a linux distribution to utf-8 because you have the underlying windows and it's locale intermixing with the cygwin layer interpolating things on top. It's been productive as some corner cases have been popping up and patches pushed back upstream; in a strange sense MS has been contributing to the improvement of Free software. Since many apps are inconsistent about checking locale info it's not surprising that comparing different environments produce different results. It's actually surprising that anything works at all. It's somehow comforting to be fighting backspace and delete problems yet again. It's less frustrating that struggling with the language/api de jour. On a portability note, I find myself writing things like LC_ALL=C sed ... I'm certainly much more aware of assumptions that I've been blissfully ignorant of in the past.
First
|
Prev
|
Pages: 1 2 3 Prev: unzip | touch | re-zip Next: What's the point of using tar *for backup* today? |