File tree Expand file tree Collapse file tree 2 files changed +30
-1
lines changed Expand file tree Collapse file tree 2 files changed +30
-1
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ smart people at [Hashrocket](http://hashrocket.com/).
1010For a steady stream of TILs from a variety of rocketeers, checkout
1111[ til.hashrocket.com] ( https://til.hashrocket.com/ ) .
1212
13- _ 688 TILs and counting..._
13+ _ 689 TILs and counting..._
1414
1515---
1616
@@ -642,6 +642,7 @@ _688 TILs and counting..._
642642- [ List Names Of Files With Matches] ( unix/list-names-of-files-with-matches.md )
643643- [ List Of Sessions To A Machine] ( unix/list-of-sessions-to-a-machine.md )
644644- [ List Parent pid With ps] ( unix/list-parent-pid-with-ps.md )
645+ - [ List Stats For A File] ( unix/list-stats-for-a-file.md )
645646- [ List The Available JDKs] ( unix/list-the-available-jdks.md )
646647- [ Map A Domain To localhost] ( unix/map-a-domain-to-localhost.md )
647648- [ Only Show The Matches] ( unix/only-show-the-matches.md )
Original file line number Diff line number Diff line change 1+ # List Stats For A File
2+
3+ The ` ls ` command is good for listing files. Tacking on the ` -la ` flags gives
4+ you a bunch of info about each of the listed files. To get even more info,
5+ we can use the ` stat ` command.
6+
7+ ``` bash
8+ $ stat README.md
9+ 16777220 143994676 -rw-r--r-- 1 jbranchaud staff 0 53557 " Jul 14 14:53:44 2018" " Jul 10 14:54:39 2018" " Jul 10 14:54:39 2018" " Jul 10 14:54:39 2018" 4096 112 0 README.md
10+ ```
11+
12+ That's definitely more info, but it is unlabeled and a lot to parse. We can
13+ improve the output with the ` -x ` flag.
14+
15+ ``` bash
16+ $ stat -x README.md
17+ File: " README.md"
18+ Size: 53557 FileType: Regular File
19+ Mode: (0644/-rw-r--r--) Uid: ( 501/jbranchaud) Gid: ( 20/ staff)
20+ Device: 1,4 Inode: 143994676 Links: 1
21+ Access: Sat Jul 14 14:53:44 2018
22+ Modify: Tue Jul 10 14:54:39 2018
23+ Change: Tue Jul 10 14:54:39 2018
24+ ```
25+
26+ See ` man stat ` for more details.
27+
28+ [ source] ( https://www.unixtutorial.org/2008/11/how-to-update-atime-and-mtime-for-a-file-in-unix/ )
You can’t perform that action at this time.
0 commit comments