Launching Crab

filename is a crab database file to open or create. If not specified, Crab will use the default database filepath is a path to scan, wildcards are supported on MacOS but not yet on Windows.If no path is specified, Crab will open the database to query previous scan results. If you specify multiple paths they will all be scanned. If a path has spaces wrap it in double quotes sql | cmd is a SQL query or Crab command, wrapped in double quotesYou can specify multiple queries, quote them separately

See -separator optionTo change the separator used in list mode results as returned by -batch

-case

Command line option to set future scans as case sensitive.

Default behaviour is that scans are case insensitive, this option changes that.Existing scan data is unaffected.

When to use the case optionWhen scanning a case sensitive file system.

Example

C:\> crab -case .

-color lightmode | default | off

Command line option to specify Crab color scheme at start up.

When to use the color optionOn Windows the default color scheme is designed for a command line window with a dark background

Use -color lightmode to get a color scheme suitable for use in a command line window with a light background

Use -color off to get monochrome output.

Examples

C:\> crab -color lightmode

C:\> crab -color off

See %color command

-column

Command line option to set output to column mode.

Example

C:\> crab -column

See %mode command%mode changes output layout, columnmode is one of the available options

-csv

Command line option to set output to csv mode.

Example

C:\> crab -csv

See %mode command%mode changes output layout, csvmode is one of the available options

-dict

Command line option to set output to dict mode.

Example

C:\> crab -dict

See %mode command%mode changes output layout, dictmode is one of the available options

-encodingencodingType:errorHandlerSpecifies how Crab should map byte sequences to characters when reading and writing files.

Affects reading from the fileslines table, and the %import and %autoimport commands. Writing is also affected for Crab's writeln and write functions, and the %output command.

Default value is utf8:skipfile. Crab will correctly interpret UTF-8 and ASCII encoded characters, and when querying fileslines will silently skip to the next file when it meets a non-utf8 character. This prevents binary file contents from being echoed to screen.

Examples

Read and write with utf8 encoding, stop with error on invalid characters

See %mode command%mode changes output layout, linemode is one of the available options

-list

Command line option to set output to list mode.

Example

C:\> crab -list

See %mode command%mode changes output layout, listmode is one of the available options

-maxdepth n

Command line option to specify how far down the directory tree Crab should scan.A maxdepth of 0 means scan only the file or directory objects specified for scanning, the scan isn't continued down the directory tree. If a path to a directory is given, only one item - the directory itself - will be recorded, not its contents.

A maxdepth of 1 means recurse into directory contents one level down, and so on.

If you don't specify any maxdepth, the scan continues recursing down the directory tree until everything below the scan list has been scanned. Soft links aren't followed, and remote filesystems may or may not be scanned depending on the -mount start up option.

When to use the -maxdepth option

You're only interested in the contents of a directory, not its subdirectories

Command line option to tell Crab to scan mounted devices when descending directory trees.By default scans only include files and directories that match devices on the original scan list: Any subdirectories that are the mount point for a different device, will be excluded. The -mount option changes this behaviour to recurse into mounted directories too.

Your command line window is making a mess of the ANSI codes Crab outputs to switch colors

You dislike both the default and the darkmode color schemes

ExampleE.g. Scan the current directory recursively, and open a Crab command line in monochrome

C:\> crab -nocolor .

-nullvalue 'string'

Set the string to be output in place of NULL valuesDefault is an empty string, ''

ExampleE.g. Set the null replacement character to a single space

C:\> crab -nullvalue ' 'See %nullvalue command

-refresh

Refresh scan results when opening Crab Triggers Crab to scan the orginal list of paths again, to repopulate the database. If the scan path was originally a set of wildcards the wildcards will not be re-evaluated, but the objects that matched will be scanned again.

Currently it's slower to scan with the -refresh option than to specify the paths again.

When to use the -refresh option

To update a Crab database in a batch job

To update a Crab database without having to retype the path

Examples

E.g. Refresh the scan data contained in wholedisk.crdb, and then exit

C:\> crab -batch -refresh -db wholedisk.crdb

E.g. Refresh the scan data contained in the default database and open a Crab command line on it

C:\> crab -refresh

-separator stringChange the separator used between fields for output in list mode, and importing text files with %importDefault list separator is ','

When to use the -separator option

to change the field separator when sending Crab output to your command line using the -batch option

to import a delimited file that uses a separator other than comma

ExampleE.g. Report names and sizes of the biggest files, using pipe symbol as separator