stat enzo
In-Reply-To: <[🔎] 20210404210631.ed1f65228e53b15e59396891@lucassen.org>
Previous-Subject: Re: Kuren bij starten van Testing
On Sun, Apr 04, 2021 at 09:06:31PM +0200, Richard Lucassen wrote:
> On Sun, 4 Apr 2021 18:16:44 +0200 Sjoerd <shiems@mailbox.org> wrote:
> > Richard Lucassen schreef:
> > > # stat .bashrc
> > > File: .bashrc
> > > Size: 633 Blocks: 8 IO Block: 4096 regular file
> > > Device: 803h/2051d Inode: 929948 Links: 1
> > > Access: (0644/-rw-r--r--) Uid: ( 0/ root) Gid: ( 0/ root)
> > > Access: 2021-03-31 10:37:22.817269536 +0200
> > > Modify: 2018-12-07 15:50:43.130872342 +0100
> > > Change: 2019-08-05 11:25:01.763408345 +0200
> > > Birth: 2019-08-05 11:25:01.763408345 +0200
> > >
> > > Die Access time schrijft-ie dan niet naar disk. Omdat dat vaak niet
> > > interessant is scheelt dat weer schrijfacties.
> >
> > Interessant allemaal, 'stat' kende ik nog niet.
> > Wel curieus dat een file al vóór zijn 'birth' gemodificeerd kan
> > worden. Maar misschien heb je in het bovenstaande zitten editen?
>
> Nee, maar het zal wel weer een kopie zijn van.
En de manier van kopie\"eren is iets geweest wat de "modify time"
meegeeft. (Bijvoorbeeld `cp -p`)
> En volgens mij is er geen birth flag onder Linux, tenminste, dat meen
> ik ooit eens ergens gelezen te hebben. Onder BSD werkt het wel
Het is een filesystem ding, niet een operating system ding.
> Even een test:
>
> $ touch test
> $ stat test
> File: test
> Size: 0 Blocks: 0 IO Block: 4096 regular
> empty file Device: 803h/2051d Inode: 2104831 Links: 1
> Access: (0644/-rw-r--r--) Uid: ( 1001/ richard) Gid: ( 1001/ richard)
> Access: 2021-04-04 20:55:52.261812469 +0200
> Modify: 2021-04-04 20:55:52.261812469 +0200
> Change: 2021-04-04 20:55:52.261812469 +0200
> Birth: 2021-04-04 20:55:52.261812469 +0200
> $ touch test
> $ stat test
> File: test
> Size: 0 Blocks: 0 IO Block: 4096 regular
> empty file Device: 803h/2051d Inode: 2104831 Links: 1
> Access: (0644/-rw-r--r--) Uid: ( 1001/ richard) Gid: ( 1001/ richard)
> Access: 2021-04-04 20:56:02.734804889 +0200
> Modify: 2021-04-04 20:56:02.734804889 +0200
> Change: 2021-04-04 20:56:02.734804889 +0200
> Birth: 2021-04-04 20:55:52.261812469 +0200
>
> Beetje raar
Nope. De eerste `touch` heeft het bestand aangemaakt en zet create
time. Tweede `touch` is voor het filesystem geen reden om te gaan
creeren wat al gecreeerd is.
crtime wordt door `stat` getoond als 'Birth'.
Groeten
Geert Stappers
--
| $ man stat
| STAT(1) User Commands STAT(1)
|
| NAME
| stat - display file or file system status
|
| SYNOPSIS
| stat [OPTION]... FILE...
|
| DESCRIPTION
| Display file or file system status.
Reply to: