Specifying Rules on the Command Line
Filtering rules may be specified on the command line to make ascp skip or
include specific directories and files. The following command-line options can be
- -E pattern
- Exclude files or directories matching pattern.
- -N pattern
- Include files or directories matching pattern.
Rules are applied in the order they are encountered, and the first matching rule takes
precedence (regardless of whether -E or -N).
For example, if the following options are specified, rule1,
rule2, rule3, and rule4
are applied in that order:
-N rule1 -E rule2 -E rule3 -N rule4
Directories and files are visited in strict depth order, so that with the command-line
options -E \above\ -N \above\below , the file
\above\below is never considered. Because the directory \above\ is not scanned, \above\below has no opportunity to be checked against any
Note: If rules are specified in aspera.conf, they are applied
Notes on Path Separators, Case, and Quotation Marks
- In filtering rules, \ is exclusively a quoting operator, and / is the only
recognized path separator.
- Case always matters, even if the scanned file system does not enforce such a
distinction. For example, on Windows FAT / NTFS file systems and Mac OSX HPFS+,
if the user writes "DEBUG", it matches the files "Debug" and "debug". However,
in filtering rules, the comparison is always exact. To pick up both "Debug" and
"debug", the pattern must be "[Dd]ebug".
- Rules must be interpreted by ascp, not by the command shell.
For this reason, rules that contain wildcards must be surrounded by quotation
marks to protect them from interpretation by the shell.
Individual Matching Rules
Rules applied to directory and file names are limited regular expressions (referred to as
"globs" in UNIX terminology).
Standard Globbing, as in POSIX sh(1) and find(1)
* ? [abc] [a-z] *.[!cos] *.[^cos] [![:digit:][:blank:]]
* matches any number of characters
? matches any single character
 matches exactly one of a set of characters. The  may
also contain the following:
- regular character literals
- The ^ or ! as the first character specifies that the
sequence will match any character not in the set.
- Ranges, specified by giving the first and last characters with a
"-" between them.
- [:alnum:] – alphanumeric, same as [:alpha:][:digit:]
- [:alpha:] – alphabetic
- [:blank:] – space or tab
- [:cntrl:] – control character
- [:digit:] – digit, 0-9
- [:graph:] – not [:blank:] and not [:cntrl:]
- [:lower:] – lowercase alphabetic
- [:punct:] – [:graph:] but not [:alnum:]
- [:space:] – space, tab, linefeed, vertical tab, carriage
- [:upper:] – uppercase alphabetic
- [:xdigit:] – 0-9a-fA-F
- Directory names, file names and glob literal characters may be multibyte unicode.
For example, voilà is matched by rules voilà, voil[àáâ],
voil[[:alpha:]] (but not voil[[=a=]] or
- The \ quotes any character literally, including itself. For example, the
pattern a\*b\[c[\]]d\?e\\f matches the a*b[c]d?e\f file.
- Wildcards * ,  and ? match neither / nor .
immediately after / (for example, /. ).
- abc/def is not matched by abc*def, abc[/]def
- abc/.def is not matched by any of abc/*,
abc/[![:alpha:]]def, or abc/?def
- abc/.def is matched by */.??*
- The wildcard /** is like * but also matches / :
- abc/**/def matches abc/wxy/def
abc/**/def matches abc/def
- abc/**/def does not match abc/wxy/.def
- abc/**/def matches abc/.wxy/def (only the last
- File-type specificity:
- A rule ending with * or /** matches both directories and files.
- A rule ending with / matches only directories.
- A rule ending without / matches only files.
- Rules that start with / are anchored; that is, the entire string must be matched:
- /abc/**/def matches /abc/wxy/def
- abc/**/def matches xyz/abc/wxy/def
- /abc/**/def does not match /xyz/abc/wxy/def
|-N rule1 -N rule2
||Includes all file or directory names that match rule1 or
|-N rule1 -E rule2
||Includes all file or directory names that match rule1; of those, it
excludes all that match rule2.
|-E rule2 -N rule1
||Excludes all file or directory names that match rule2; of the rest,
it includes those that match rule1.
An anchored rule -N /a/b/c matches directories /a/ and /a/b/ in
addition to file /a/b/c . There is no such extension for -E a/b/c
A rule containing /** bounds this extension. That is, -N "/a/b/**/c/d"
matches directories /a and /a/b , but not the /a/b/c
A file or directory name that does not match any rule is still tracked, as if by a final -N
"*" . To exclude all unmatched files reliably, add -E "*" as the