Merge pull request #949 from coolshaurya/docs-count

Add docs for the count command
This commit is contained in:
Jonathan Turner 2019-11-10 09:51:25 -08:00 committed by GitHub
commit 6f013d0225
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

48
docs/commands/count.md Normal file
View File

@ -0,0 +1,48 @@
# count
This command counts the number of rows in a table.
## Examples -
```shell
> ls
━━━━┯━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┯━━━━━━━━━━━┯━━━━━━━━━━┯━━━━━━━━━┯━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━
# │ name │ type │ readonly │ size │ created │ accessed │ modified
────┼──────────────────────────────┼───────────┼──────────┼─────────┼──────────────┼──────────────┼──────────────
0 │ Desktop │ Directory │ │ 4.1 KB │ 2 months ago │ 2 months ago │ 2 months ago
1 │ aur │ Directory │ │ 4.1 KB │ 4 hours ago │ 4 hours ago │ 4 hours ago
...
75 │ .emulator_console_auth_token │ File │ │ 16 B │ 2 months ago │ 2 months ago │ 2 months ago
76 │ bin │ Directory │ │ 4.1 KB │ 2 months ago │ 2 months ago │ 2 months ago
━━━━┷━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┷━━━━━━━━━━━┷━━━━━━━━━━┷━━━━━━━━━┷━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━
> ls | count
━━━━━━━━━
<value>
─────────
77
━━━━━━━━━
> ls | get name | count
━━━━━━━━━
<value>
─────────
77
━━━━━━━━━
> ls | where type == File | count
━━━━━━━━━
<value>
─────────
29
━━━━━━━━━
> ls | where type == Directory | count
━━━━━━━━━
<value>
─────────
48
━━━━━━━━━
> ls | where size > 2KB | count
━━━━━━━━━
<value>
─────────
57
━━━━━━━━━
```