mirror of
https://github.com/tldr-pages/tldr.git
synced 2025-06-05 11:06:00 +02:00
fselect: add page (#2975)
This commit is contained in:
parent
f44b2ad3fa
commit
a551be0b2a
1 changed files with 24 additions and 0 deletions
24
pages/common/fselect.md
Normal file
24
pages/common/fselect.md
Normal file
|
@ -0,0 +1,24 @@
|
|||
# fselect
|
||||
|
||||
> Find files with SQL-like queries.
|
||||
> More information: <https://github.com/jhspetersson/fselect>.
|
||||
|
||||
- Select full path and size from temporary or config files in a given directory:
|
||||
|
||||
`fselect size, path from {{path/to/directory}} where name = {{'*.cfg'}} or name = {{'*.tmp'}}`
|
||||
|
||||
- Find square images:
|
||||
|
||||
`fselect path from {{path/to/directory}} where width = height`
|
||||
|
||||
- Find old-school rap 320kbps MP3 files:
|
||||
|
||||
`fselect path from {{path/to/directory}} where genre = {{Rap}} and bitrate = {{320}} and mp3_year lt {{2000}}`
|
||||
|
||||
- Select only the first 5 results and output as JSON:
|
||||
|
||||
`fselect size, path from {{path/to/directory}} limit {{5}} into json`
|
||||
|
||||
- Use SQL aggregate functions to calculate minimum, maximum and average size of files in a directory:
|
||||
|
||||
`fselect "{{MIN(size), MAX(size), AVG(size), SUM(size), COUNT(*)}} from {{path/to/directory}}"`
|
Loading…
Add table
Reference in a new issue