<commit_before># fsq

The `fsq` utility is a tool for doing ad-hoc queries against a file system using a SQL-like expression language.  This is useful for finding files that match certain criteria without writing a one-off script to do so.

## Usage

### Example Query

`fsq` is designed to be quickly invoked from the command line.  For example, in order to find all files under the current directory that start with the characters 'hello' and are larger than 5 mb, the following query could be used:

	fsq "name in '.' where name startswith 'hello' and size > 5m"

## Query Structure

Notice that `fsq` takes a single argument: the expression.  This expression is composed of the following parts:

	<attribute list> in <root directory> where <conditions>

The attribute list specifies which attributes are printed to standard out by `fsq`.  In the above case, this is just the filename ('name').

The root directory tells `fsq` where to start searching in the file system.  Every directory under the root will be searched recursively for files matching the given conditions.  In the above case, it starts searching at the current directory ('.').  Note that if the `in <location>` part of the expression is left out, it will default to the current directory.

The set of conditions tells `fsq` what files it should print out as matches.  In the above case, it looks for a name that *startswith* the string 'hello' and has a *size* on disk greater than 5 megabytes.

### Supported Attributes

* name
* path
* size
* content

### Supported Conditional Operators

* <
* <=
* >
* >=<commit_msg>Updated README to include 'modified' attribute.<commit_after># fsq

The `fsq` utility is a tool for doing ad-hoc queries against a file system using a SQL-like expression language.  This is useful for finding files that match certain criteria without writing a one-off script to do so.

## Usage

### Example Query

`fsq` is designed to be quickly invoked from the command line.  For example, in order to find all files under the current directory that start with the characters 'hello' and are larger than 5 mb, the following query could be used:

	fsq "name in '.' where name startswith 'hello' and size > 5m"

## Query Structure

Notice that `fsq` takes a single argument: the expression.  This expression is composed of the following parts:

	<attribute list> in <root directory> where <conditions>

The attribute list specifies which attributes are printed to standard out by `fsq`.  In the above case, this is just the filename ('name').

The root directory tells `fsq` where to start searching in the file system.  Every directory under the root will be searched recursively for files matching the given conditions.  In the above case, it starts searching at the current directory ('.').  Note that if the `in <location>` part of the expression is left out, it will default to the current directory.

The set of conditions tells `fsq` what files it should print out as matches.  In the above case, it looks for a name that *startswith* the string 'hello' and has a *size* on disk greater than 5 megabytes.

### Supported Attributes

* name
* path
* size
* content
* modified

### Supported Conditional Operators

* <
* <=
* >
* >=
{'fraction_non_alphanumeric': 0.064416227934345, 'fraction_numerical': 0.0018581604211830288, 'mean_word_length': 4.151515151515151, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3761960', 'n_tokens_mistral': 840, 'n_tokens_neox': 817, 'n_words': 502}