* Re: [Comm] date & time of file modification in shell
  2005-04-06  9:53 [Comm] date & time of file modification in shell Denis G. Samsonenko
@ 2005-04-06  9:01 ` Mike Lykov
  2005-04-06 12:50   ` Denis G. Samsonenko
  0 siblings, 1 reply; 8+ messages in thread
From: Mike Lykov @ 2005-04-06  9:01 UTC (permalink / raw)
  To: community
В сообщении от Среда 06 Апрель 2005 14:53 Denis G. Samsonenko написал:
> Подскажите, пожалуйста, как можно в shell-сценарии определить дату и
> время модификации какого-то конкретного файла?
STAT(1)                          User Commands                         STAT(1)
NAME
       stat - display file or filesystem status
-- 
Mike Lykov
Samara, "Vesna" parfum company, System administrator 
^ permalink raw reply	[flat|nested] 8+ messages in thread
* [Comm] date & time of file modification in shell
@ 2005-04-06  9:53 Denis G. Samsonenko
  2005-04-06  9:01 ` Mike Lykov
  0 siblings, 1 reply; 8+ messages in thread
From: Denis G. Samsonenko @ 2005-04-06  9:53 UTC (permalink / raw)
  To: community
День добрый!
Подскажите, пожалуйста, как можно в shell-сценарии определить дату и 
время модификации какого-то конкретного файла?
-- 
Всего доброго,
Денис.
---------------
earthsea@ngs.ru
^ permalink raw reply	[flat|nested] 8+ messages in thread
* Re: [Comm] date & time of file modification in shell
  2005-04-06  9:01 ` Mike Lykov
@ 2005-04-06 12:50   ` Denis G. Samsonenko
  2005-04-06 19:15     ` Dmitry V. Levin
  0 siblings, 1 reply; 8+ messages in thread
From: Denis G. Samsonenko @ 2005-04-06 12:50 UTC (permalink / raw)
  To: community
Цитирую Mike Lykov <combr@vesna.ru>:
> > Подскажите, пожалуйста, как можно в shell-сценарии определить
> >дату и время модификации какого-то конкретного файла?
>
>        stat - display file or filesystem status
Спасибо! Жаль только, что там нельзя, на сколько я понял, регулировать
формат выдачи.
Всего доброго,
Денис.
---------------
earthsea@ngs.ru
^ permalink raw reply	[flat|nested] 8+ messages in thread
* Re: [Comm] date & time of file modification in shell
  2005-04-06 12:50   ` Denis G. Samsonenko
@ 2005-04-06 19:15     ` Dmitry V. Levin
  2005-04-08  4:01       ` php-coder
  0 siblings, 1 reply; 8+ messages in thread
From: Dmitry V. Levin @ 2005-04-06 19:15 UTC (permalink / raw)
  To: ALT Linux general discussion list
[-- Attachment #1: Type: text/plain, Size: 439 bytes --]
On Wed, Apr 06, 2005 at 07:50:45PM +0700, Denis G. Samsonenko wrote:
> Цитирую Mike Lykov <combr@vesna.ru>:
> > > Подскажите, пожалуйста, как можно в shell-сценарии определить
> > >дату и время модификации какого-то конкретного файла?
> >
> >        stat - display file or filesystem status
> 
> Спасибо! Жаль только, что там нельзя, на сколько я понял, регулировать
> формат выдачи.
Для этого есть find -printf.
-- 
ldv
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply	[flat|nested] 8+ messages in thread
* Re: [Comm] date & time of file modification in shell
  2005-04-06 19:15     ` Dmitry V. Levin
@ 2005-04-08  4:01       ` php-coder
  2005-04-08  9:20         ` Denis G. Samsonenko
  0 siblings, 1 reply; 8+ messages in thread
From: php-coder @ 2005-04-08  4:01 UTC (permalink / raw)
  To: community
--- Dmitry V. Levin 2005-04-06 23:15:44 +0400
+++ php-coder 2005-04-08 10:55:54 +0700
> > > > Подскажите, пожалуйста, как можно в shell-сценарии определить
> > > >дату и время модификации какого-то конкретного файла?
> > >        stat - display file or filesystem status
> > Спасибо! Жаль только, что там нельзя, на сколько я понял, регулировать
> > формат выдачи.
> Для этого есть find -printf.
    Либо я чего-то не понимаю, либо автор ман не читал %)
    man stat
    -c  --format=FORMAT
           use the specified FORMAT instead of the default
    ...
    %Y     Time of last modification as seconds since Epoch
    %y     Time of last modification
    Хм... попробуем проверить...
    [c0der@mycomp ~]$ stat -c %y .mutt/mail/community    10:59
    2005-04-08 10:47:35.000000000 +0700
-- 
+ php-coder
+ php-coder[at]ngs[dot]ru
+ ALTLinux Master 2.4 (kernel 2.4.26-std-up-alt10)
^ permalink raw reply	[flat|nested] 8+ messages in thread
* Re: [Comm] date & time of file modification in shell
  2005-04-08  4:01       ` php-coder
@ 2005-04-08  9:20         ` Denis G. Samsonenko
  2005-04-08 12:00           ` php-coder
  0 siblings, 1 reply; 8+ messages in thread
From: Denis G. Samsonenko @ 2005-04-08  9:20 UTC (permalink / raw)
  To: community
Hi!
php-coder пишет:
>> > >        stat - display file or filesystem status
>> > Спасибо! Жаль только, что там нельзя, на сколько я понял, регулировать
>> > формат выдачи.
>> Для этого есть find -printf.
> 
>     Либо я чего-то не понимаю, либо автор ман не читал %)
> 
>     man stat
> 
>     -c  --format=FORMAT
>            use the specified FORMAT instead of the default
>     ...
>     %Y     Time of last modification as seconds since Epoch
>     %y     Time of last modification
> 
>     Хм... попробуем проверить...
> 
>     [c0der@mycomp ~]$ stat -c %y .mutt/mail/community    10:59
>     2005-04-08 10:47:35.000000000 +0700
Конечно же первое (в смысле не понимаете). ;)
Я имел в виду, что нельзя регулировать формат выдачи даты модиыикации. 
Т.е. он даёт в виде 2005-04-08 10:47:35.000000000 +0700, а мне, 
например, хотелось бы в виде 08.04.2005 10:47:35. Ну да ладно, не может, 
и бог с ним, меня и так устроит.
-- 
Всего доброго,
Денис.
---------------
earthsea@ngs.ru
^ permalink raw reply	[flat|nested] 8+ messages in thread
* Re: [Comm] date & time of file modification in shell
  2005-04-08  9:20         ` Denis G. Samsonenko
@ 2005-04-08 12:00           ` php-coder
  2005-04-08 13:02             ` php-coder
  0 siblings, 1 reply; 8+ messages in thread
From: php-coder @ 2005-04-08 12:00 UTC (permalink / raw)
  To: community
--- Denis G. Samsonenko 2005-04-08 04:20:42 -0500
+++ php-coder 2005-04-08 18:58:12 +0700
> Я имел в виду, что нельзя регулировать формат выдачи даты модиыикации. 
> Т.е. он даёт в виде 2005-04-08 10:47:35.000000000 +0700, а мне, 
> например, хотелось бы в виде 08.04.2005 10:47:35. 
    Тут нужно использовать мощь шела ;) Не stat'ом единым))
	
    [c0der@mycomp ~]$ ./stat	18:59
    08.04.08 18:26:41
    [c0der@mycomp ~]$ cat stat	18:59
    STAT=$(stat -c %y ~/.mutt/mail/community | cut -d. -f1)
    STAT_TIME=$(echo $STAT | cut -d' ' -f2)
    STAT_DATE=$(echo $STAT | cut -d' ' -f1 | awk -F- '{printf $3"."$2"."$3}')
    echo $STAT_DATE $STAT_TIME
    [c0der@mycomp ~]$
    :-)
-- 
+ php-coder
+ php-coder[at]ngs[dot]ru
+ ALTLinux Master 2.4 (kernel 2.4.26-std-up-alt10)
^ permalink raw reply	[flat|nested] 8+ messages in thread
* Re: [Comm] date & time of file modification in shell
  2005-04-08 12:00           ` php-coder
@ 2005-04-08 13:02             ` php-coder
  0 siblings, 0 replies; 8+ messages in thread
From: php-coder @ 2005-04-08 13:02 UTC (permalink / raw)
  To: community
--- php-coder 2005-04-08 19:00:11 +0700
+++ php-coder 2005-04-08 20:00:53 +0700
> STAT_DATE=$(echo $STAT | cut -d' ' -f1 | awk -F- '{printf $3"."$2"."$3}')
    Ошибку заметил... там где printf в конце нужно $1 написать вместо $3
    Это я случайно ошибся...
-- 
+ php-coder
+ php-coder[at]ngs[dot]ru
+ ALTLinux Master 2.4 (kernel 2.4.26-std-up-alt10)
^ permalink raw reply	[flat|nested] 8+ messages in thread
end of thread, other threads:[~2005-04-08 13:02 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-04-06  9:53 [Comm] date & time of file modification in shell Denis G. Samsonenko
2005-04-06  9:01 ` Mike Lykov
2005-04-06 12:50   ` Denis G. Samsonenko
2005-04-06 19:15     ` Dmitry V. Levin
2005-04-08  4:01       ` php-coder
2005-04-08  9:20         ` Denis G. Samsonenko
2005-04-08 12:00           ` php-coder
2005-04-08 13:02             ` php-coder
ALT Linux Community general discussions
This inbox may be cloned and mirrored by anyone:
	git clone --mirror http://lore.altlinux.org/community/0 community/git/0.git
	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 community community/ http://lore.altlinux.org/community \
		mandrake-russian@linuxteam.iplabs.ru community@lists.altlinux.org community@lists.altlinux.ru community@lists.altlinux.com
	public-inbox-index community
Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.community
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git