From ab8b7e3460bd506bd1b6e74fd1f065f153bc680a Mon Sep 17 00:00:00 2001 From: Juan Martin Enriquez Date: Thu, 5 Oct 2017 00:21:26 -0300 Subject: [PATCH 1/6] stat: add page --- pages/common/stat.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 pages/common/stat.md diff --git a/pages/common/stat.md b/pages/common/stat.md new file mode 100644 index 0000000000..0826c3bf6a --- /dev/null +++ b/pages/common/stat.md @@ -0,0 +1,27 @@ +# stat + +> Display file and filesystem information. + +- Show file properties such as size, permissions, creation and access dates among others: + +`stat {{file}}` + +- Same as a above but in a more concise way: + +`stat -t {{file}}` + +- Display filesystem information: + +`stat -f {{file}}` + +- Use stat to show only octal file permissions: + +`stat -c "%a %n" {{file}}` + +- Show octal file permissions, name and group of the file owner: + +`stat -c "%a %n %U %G" {{file}}` + +- Show the size in bytes of the file: + +`stat -c "%s %n" {{file}}` From 095a89cc7280a95c019e4433b20b98db6b367f52 Mon Sep 17 00:00:00 2001 From: Juan Martin Enriquez Date: Mon, 9 Oct 2017 00:18:01 -0300 Subject: [PATCH 2/6] stat: fixed location of page to pages/linux --- pages/{common => linux}/stat.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename pages/{common => linux}/stat.md (100%) diff --git a/pages/common/stat.md b/pages/linux/stat.md similarity index 100% rename from pages/common/stat.md rename to pages/linux/stat.md From 3490cc61a840ac7a2eb3140690a040dd03b2ab11 Mon Sep 17 00:00:00 2001 From: Juan Martin Enriquez Date: Sun, 15 Oct 2017 22:02:25 -0300 Subject: [PATCH 3/6] stat: add osx page --- pages/osx/stat.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 pages/osx/stat.md diff --git a/pages/osx/stat.md b/pages/osx/stat.md new file mode 100644 index 0000000000..81407a38a5 --- /dev/null +++ b/pages/osx/stat.md @@ -0,0 +1,23 @@ +# stat + +> Display file status. + +- Show file properties such as size, permissions, creation and access dates among others: + +`stat {{file}}` + +- Same as a but verbose (more similar to linux's `stat`: + +`stat -x {{file}}` + +- Use stat to show only octal file permissions: + +`stat -f %Mp%Lp {{file}}` + +- Show octal file permissions, name and group of the file owner: + +`stat -f "%Mp%Lp %N %Su %Sg" {{file}}` + +- Show the size in bytes of the file: + +`stat -f "%z %N" {{file}}` From 6dd84e41fe901322d781d69d2ceb894a7a57ab41 Mon Sep 17 00:00:00 2001 From: Agniva De Sarker Date: Mon, 16 Oct 2017 11:33:38 +0530 Subject: [PATCH 4/6] stat: simplify page - Fix minor grammar mistake - Removed the octal file permissions as they have been already mentioned above. --- pages/linux/stat.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pages/linux/stat.md b/pages/linux/stat.md index 0826c3bf6a..9104024ab8 100644 --- a/pages/linux/stat.md +++ b/pages/linux/stat.md @@ -6,11 +6,11 @@ `stat {{file}}` -- Same as a above but in a more concise way: +- Same as above but in a more concise way: `stat -t {{file}}` -- Display filesystem information: +- Show filesystem information: `stat -f {{file}}` @@ -18,10 +18,10 @@ `stat -c "%a %n" {{file}}` -- Show octal file permissions, name and group of the file owner: +- Show owner and group of the file: -`stat -c "%a %n %U %G" {{file}}` +`stat -c "%U %G" {{file}}` -- Show the size in bytes of the file: +- Show the size of the file in bytes: `stat -c "%s %n" {{file}}` From 0833e8e8d9ec552b2aa1dd94653957002049ba5e Mon Sep 17 00:00:00 2001 From: Agniva De Sarker Date: Mon, 16 Oct 2017 11:37:39 +0530 Subject: [PATCH 5/6] stat: update osx variant - Fix a minor grammar error - Removed the file permissions example and only kept the file owner and group. --- pages/osx/stat.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pages/osx/stat.md b/pages/osx/stat.md index 81407a38a5..a1a2b0cced 100644 --- a/pages/osx/stat.md +++ b/pages/osx/stat.md @@ -6,18 +6,18 @@ `stat {{file}}` -- Same as a but verbose (more similar to linux's `stat`: +- Same as above but verbose (more similar to linux's `stat`): `stat -x {{file}}` -- Use stat to show only octal file permissions: +- Show only octal file permissions: `stat -f %Mp%Lp {{file}}` -- Show octal file permissions, name and group of the file owner: +- Show owner and group of the file: -`stat -f "%Mp%Lp %N %Su %Sg" {{file}}` +`stat -f "%Su %Sg" {{file}}` -- Show the size in bytes of the file: +- Show the size of the file in bytes: `stat -f "%z %N" {{file}}` From bb165ecc579b5b79eba8b3b43ce03530423a4ed4 Mon Sep 17 00:00:00 2001 From: Agniva De Sarker Date: Mon, 16 Oct 2017 11:38:23 +0530 Subject: [PATCH 6/6] stat: remove the "use stat" --- pages/linux/stat.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/linux/stat.md b/pages/linux/stat.md index 9104024ab8..734d288732 100644 --- a/pages/linux/stat.md +++ b/pages/linux/stat.md @@ -14,7 +14,7 @@ `stat -f {{file}}` -- Use stat to show only octal file permissions: +- Show only octal file permissions: `stat -c "%a %n" {{file}}`