4 ms·
Maybe it's time ? btime I mean Under Linux $ stat `which stat` File: '/usr/bin/stat' Size: 80944 Blocks: 160 IO Block: 4096
by wener 10y ago
Maybe it's time ?
btime I mean
Under Linux
$ stat `which stat`
File: '/usr/bin/stat'
Size: 80944 Blocks: 160 IO Block: 4096 regular file
Device: fd01h/64769d Inode: 1196257 Links: 1
Access: (0755/-rwxr-xr-x) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2016-09-22 15:30:03.759501920 +0800
Modify: 2016-02-18 21:37:47.000000000 +0800
Change: 2016-09-08 18:17:26.611169858 +0800
Birth: -
Under OSX
$ stat `which stat`
File: '/usr/local/opt/coreutils/libexec/gnubin/stat' -> '../../bin/gstat'
Size: 15 Blocks: 8 IO Block: 4096 symbolic link
Device: 1000004h/16777220d Inode: 17293277 Links: 1
Access: (0755/lrwxr-xr-x) Uid: ( 501/ wener) Gid: ( 80/ admin)
Access: 2016-01-26 19:01:40.000000000 +0800
Modify: 2016-01-21 02:56:37.000000000 +0800
Change: 2016-01-26 19:01:40.000000000 +0800
Birth: 2016-01-21 02:56:37.000000000 +0800
- pawadu 10y agoSo what is the difference between "modify" and "change"??
- XorNot 10y agoContent modification vs. metadata modification I believe.
- yAnonymous 10y agoIt's the other way around. ctime (status change) for metadata, mtime (modification) for files contents, atime (access) for file access.
- merraksh 10y agoPart of the confusion for {c,m}time probably comes from [c]time: [c]hange [m]etadata [m]time: [m]odify] file [c]ontents
- pawadu 10y agoyeah, that was my first reaction: how do I know which one is which?
- inopinatus 10y agowell, if you need to check in future, like this: $ man 2 stat
- Xophmeister 10y agoctime is when the inode or file changes in terms of stat, ownership, etc. mtime is when the contents of the file is changed.
- guessmyname 10y agoOff Topic — Which one is better? $ stat `which stat` $ stat $(which stat)
- striking 10y agoBackticks if lazy, parenthetical for complicated command lines.
- hmpc 10y agoBackticks 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 http://mywiki.wooledge.org/BashFAQ/082. The Open Group also discourages backticks: http://pubs.opengroup.org/onlinepubs/9699919799/xrat/V4_xcu_chap02.html#tag_23_02_06_03 http://pubs.opengroup.org/onlinepubs/9699919799/xrat/V4_xcu_....
- __michaelg 10y ago$ stat "$(which stat)" shellcheck or its online version http://www.shellcheck.net/ http://www.shellcheck.net/ help a lot
- aelleth 10y ago$(...) doesn't trip Shellcheck and is slightly more readable and less error-prone in complex statements, e.g. if you have to nest commands.
- rascul 10y agowhich probably isn't the best tool to use here. http://unix.stackexchange.com/questions/85249/why-not-use-which-what-to-use-then http://unix.stackexchange.com/questions/85249/why-not-use-wh...
- pimlottc 10y agoI 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