Re:Linus on btime: “Let’s wait five years” (2010)
by pawadu on Thursday September 22, 2016 @04:02AM
(#12555280)
So what is the difference between "modify" and "change"??
Re:Linus on btime: “Let’s wait five years” (2010)
by Xophmeister on Thursday September 22, 2016 @04:35AM
(#12555400)
ctime is when the inode or file changes in terms of stat, ownership, etc. mtime is when the contents of the file is changed.
Re:Linus on btime: “Let’s wait five years” (2010)
by XorNot on Thursday September 22, 2016 @04:32AM
(#12555387)
Content modification vs. metadata modification I believe.
Re:Linus on btime: “Let’s wait five years” (2010)
by yAnonymous on Thursday September 22, 2016 @04:56AM
(#12555502)
It's the other way around. ctime (status change) for metadata, mtime (modification) for files contents, atime (access) for file access.
Re:Linus on btime: “Let’s wait five years” (2010)
by merraksh on Thursday September 22, 2016 @06:32AM
(#12555840)
Part of the confusion for {c,m}time probably comes from
[c]time: [c]hange [m]etadata
[m]time: [m]odify] file [c]ontents
Re:Linus on btime: “Let’s wait five years” (2010)
by pawadu on Thursday September 22, 2016 @06:58AM
(#12555921)
yeah, that was my first reaction: how do I know which one is which?
Re:Linus on btime: “Let’s wait five years” (2010)
by inopinatus on Thursday September 22, 2016 @07:21AM
(#12556011)
well, if you need to check in future, like this:
$ man 2 stat
Re:Linus on btime: “Let’s wait five years” (2010)
by guessmyname on Thursday September 22, 2016 @08:53AM
(#12556447)
Off Topic — Which one is better?
$ stat `which stat`
$ stat $(which stat)
Re:Linus on btime: “Let’s wait five years” (2010)
by hmpc on Thursday September 22, 2016 @09:04AM
(#12556511)
Backticks are discouraged for any new scripts, since they complicate nesting, quoting, and escaping, besides being graphically less explicit. See also http://mywiki.wooledge.org/BashFAQ/082. The Open Group also discourages backticks: http://pubs.opengroup.org/onlinepubs/9699919799/xrat/V4_xcu_....
Re:Linus on btime: “Let’s wait five years” (2010)
by __michaelg on Thursday September 22, 2016 @09:11AM
(#12556556)
$ stat "$(which stat)"
shellcheck or its online version http://www.shellcheck.net/ help a lot
Re:Linus on btime: “Let’s wait five years” (2010)
by striking on Thursday September 22, 2016 @08:57AM
(#12556472)
Backticks if lazy, parenthetical for complicated command lines.
Re:Linus on btime: “Let’s wait five years” (2010)
by andrewSC on Thursday September 22, 2016 @09:11AM
(#12556551)
Haha, I read that as "...complicated command times."
Re:Linus on btime: “Let’s wait five years” (2010)
by striking on Thursday September 22, 2016 @09:17AM
(#12556593)
Close enough!
Re:Linus on btime: “Let’s wait five years” (2010)
by aelleth on Thursday September 22, 2016 @09:23AM
(#12556627)
$(...) doesn't trip Shellcheck and is slightly more readable and less error-prone in complex statements, e.g. if you have to nest commands.
Re:Linus on btime: “Let’s wait five years” (2010)
by rascul on Thursday September 22, 2016 @09:47AM
(#12556764)
which probably isn't the best tool to use here.
http://unix.stackexchange.com/questions/85249/why-not-use-wh...
Re:Linus on btime: “Let’s wait five years” (2010)
by pimlottc on Thursday September 22, 2016 @11:51AM
(#12557702)
I was about to ask how you got that pretty-print output from OSX's `stat` before I noticed you were using `gstat`. Oddly enough, the native `stat -x` gives a similar output but omits birth time:
$ stat -x `which stat`
File: "/usr/bin/stat"
Size: 27376 FileType: Regular File
Mode: (0755/-rwxr-xr-x) Uid: ( 0/ root) Gid: ( 0/ wheel)
Device: 1,4 Inode: 192606219 Links: 1
Access: Thu Sep 22 11:50:55 2016
Modify: Fri Jul 8 23:03:34 2016
Change: Sun Jul 31 21:44:22 2016
btime I mean
Under Linux
Under OSX