summaryrefslogtreecommitdiffstats
path: root/docs/fselect.1
blob: dcd50a6a1ab02e11fa44fddf497e277845bc4057 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
.TH FSELECT 1
.SH NAME
fselect \- find files with SQL-like queries
.SH SYNOPSIS
.B fselect
.B [ARGS]
COLUMN
[, COLUMN ...]
[ from ROOT [, ROOT...] ]
[where EXPR]
[group by COLUMNS]
[order by COLUMNS]
[limit N]
[into FORMAT]
.SH DESCRIPTION
.B fselect
is a simple utility with a SQL-like query for finding files.
.PP
You write SQL-like query, that's it.
.PP
fselect command itself is like a first keyword (select, i.e., file select).
But if you'll put one more select behind occasionally, that's not a problem.
.PP
Next you put columns you are interested in.
It could be file name or path, size, modification date, etc.
See full list of possible columns.
You can add columns with arbitrary text (put in quotes if it contains spaces).
A few functions (aggregating and formatting) are there for your service.
You can use arithmetic expressions when it makes sense.
.PP
Where to search? Specify with
.B from
keyword. You can list one or more directories separated with comma.
If you leave the from, then current directory will be processed.
.PP
What to search? Use
.B where
with any number of conditions.
.PP
Order results like in real SQL with
.B order by.
All columns are supported for ordering by, as well as asc/desc parameters and positional numeric shortcuts.
.PP
Limiting search results is possible with limit. Formatting options are supported with
.B into
keyword.
.PP
If you want to use operators containing \> or \<, put the whole query into double quotes.
This will protect query from the shell and output redirection.
The same applies to queries with parentheses or *, ? and other special symbols that are shell metacharacters
.RE
.SH COLUMNS AND FIELDS
.IP \(bu
name
.IP \(bu
extension or ext
.IP \(bu
path
.IP \(bu
abspath
.IP \(bu
directory or dirname or dir
.IP \(bu
absdir
.IP \(bu
size
.IP \(bu
hsize or fsize
.IP \(bu
uid
.IP \(bu
gid
.IP \(bu
user
.IP \(bu
group
.IP \(bu
created
.IP \(bu
accessed
.IP \(bu
modified
.IP \(bu
is_dir
.IP \(bu
is_file
.IP \(bu
is_symlink
.IP \(bu
is_pipe or is_fifo
.IP \(bu
is_character or is_char
.IP \(bu
is_block
.IP \(bu
is_socket
.IP \(bu
device
.IP \(bu
inode
.IP \(bu
blocks
.IP \(bu
hardlinks
.IP \(bu
mode
.IP \(bu
user_read
.IP \(bu
user_write
.IP \(bu
user_exec
.IP \(bu
user_all
.IP \(bu
group_read
.IP \(bu
group_write
.IP \(bu
group_exec
.IP \(bu
group_all
.IP \(bu
other_read
.IP \(bu
other_write
.IP \(bu
other_exec
.IP \(bu
other_all
.IP \(bu
suid
.IP \(bu
sgid
.IP \(bu
is_hidden
.IP \(bu
has_xattrs
.IP \(bu
capabilities or caps
.IP \(bu
is_shebang
.IP \(bu
is_empty
.IP \(bu
width
.IP \(bu
height
.IP \(bu
duration
.IP \(bu
mp3_bitrate or bitrate
.IP \(bu
mp3_freq or freq
.IP \(bu
mp3_title or title
.IP \(bu
mp3_artist or artist
.IP \(bu
mp3_album or album
.IP \(bu
mp3_genre or genre
.IP \(bu
mp3_year
.IP \(bu
exif_datetime
.IP \(bu
exif_altitude or exif_alt
.IP \(bu
exif_latitude or exif_lat
.IP \(bu
exif_longitude or exif_lng or exif_lon
.IP \(bu
exif_make
.IP \(bu
exif_model
.IP \(bu
exif_software
.IP \(bu
exif_version
.IP \(bu
mime
.IP \(bu
is_binary
.IP \(bu
is_text
.IP \(bu
line_count
.IP \(bu
is_archive
.IP \(bu
is_audio
.IP \(bu
is_book
.IP \(bu
is_doc
.IP \(bu
is_font
.IP \(bu
is_image
.IP \(bu
is_source
.IP \(bu
is_video
.IP \(bu
sha1
.IP \(bu
sha2_256 or sha256
.IP \(bu
sha2_512 or sha512
.IP \(bu
sha3_512 or sha3
.RE
.SH ENVIRONMENT
.TP
.B LS_COLORS
Determines how to colorize search results, see
.BR dircolors (1) .
.SH EXIT STATUS
The
.B fselect
utility exists with status 0 as long as the provided query parses correctly.
.SH EXAMPLES
.TP
.RI "Find files and directories that match the pattern '" needle "':"
$ fselect name WHERE name =~ "needle"
.TP
.RI "Start a search in a given directory (" /var/log "):"
$ fselect name FROM /var/log
.SH SEE ALSO
.BR find (1)
.BR fd (1)