GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
FSELECT(1) FreeBSD General Commands Manual FSELECT(1)

fselect - find files with SQL-like queries

fselect [ARGS] COLUMN [, COLUMN ...] [ from ROOT [, ROOT...] ] [where EXPR] [order by COLUMNS] [limit N] [into FORMAT]

fselect is a simple utility with a SQL-like query for finding files.

You write SQL-like query, that's it.

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.

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.

Where to search? Specify with from keyword. You can list one or more directories separated with comma. If you leave the from, then current directory will be processed.

What to search? Use where with any number of conditions.

Order results like in real SQL with order by. All columns are supported for ordering by, as well as asc/desc parameters and positional numeric shortcuts.

Limiting search results is possible with limit. Formatting options are supported with into keyword.

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

  • name
  • extension or ext
  • path
  • abspath
  • directory or dirname or dir
  • absdir
  • size
  • hsize or fsize
  • uid
  • gid
  • user
  • group
  • created
  • accessed
  • modified
  • is_dir
  • is_file
  • is_symlink
  • is_pipe or is_fifo
  • is_character or is_char
  • is_block
  • is_socket
  • device
  • inode
  • blocks
  • hardlinks
  • mode
  • user_read
  • user_write
  • user_exec
  • user_all
  • group_read
  • group_write
  • group_exec
  • group_all
  • other_read
  • other_write
  • other_exec
  • other_all
  • suid
  • sgid
  • is_hidden
  • has_xattrs
  • is_shebang
  • is_empty
  • width
  • height
  • duration
  • mp3_bitrate or bitrate
  • mp3_freq or freq
  • mp3_title or title
  • mp3_artist or artist
  • mp3_album or album
  • mp3_genre or genre
  • mp3_year
  • exif_datetime
  • exif_altitude or exif_alt
  • exif_latitude or exif_lat
  • exif_longitude or exif_lng or exif_lon
  • exif_make
  • exif_model
  • exif_software
  • exif_version
  • mime
  • is_binary
  • is_text
  • line_count
  • is_archive
  • is_audio
  • is_book
  • is_doc
  • is_image
  • is_source
  • is_video
  • sha1
  • sha2_256 or sha256
  • sha2_512 or sha512
  • sha3_512 or sha3

LS_COLORS
Determines how to colorize search results, see dircolors(1).

The fselect utility exists with status 0 as long as the provided query parses correctly.

Find files and directories that match the pattern 'needle':
$ fselect name WHERE name =~ "needle"
Start a search in a given directory (/var/log):
$ fselect name FROM /var/log

find(1) fd(1)

Search for    or go to Top of page |  Section 1 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.