The queries here are designed to explore a set of nested directories, or an unknown drive, to find out how many and what kind of things they hold.
It's best to scan only the directory you want to investigate, so you don't have to specify a path filter in each query's WHERE clause. The scan will recurse down through the whole directory tree, unless you use the -maxdepth option to change this behaviour.
C:\> crab "C:\Users\johnsmith\terraIncognita\"
On Windows a file is executable if it has an appropriate extension such as .exe. You can identify which files are executable from the mode field in Crab's files table, which stores this information in a Linux-like format, 'x' indicates executable.
SELECT count(*) FROM files
WHERE type = 'f' and mode like '%x%';
Tip: Soft links aren't followed when scanning
Soft links are files which act as a placeholder for a file or directory elsewhere on the disk. This allows the same directory to appear in multiple places without taking up extra disk space.
When Crab scans a soft link, it records the soft link but not the contents of the target.
You can identify soft links from the mode field in the files table . For directories the mode starts with a lowercase L, 'l', directories have a mode that starts with a 'd', and files have a mode that starts with a hyphen '-'.
Tip: If you do this often, make a Crab script
If you have a set of queries you run often, put them together into a Crab script and run it with the %read command.