Wildcards in PSFTP

PuTTY

6.2.2 Wildcards in PSFTP

Several commands in PSFTP support ‘wildcards’ to select multiple files.

For local file specifications (such as the first argument to put), wildcard rules for the local operating system are used. For instance, PSFTP running on Windows might require the use of *.* where PSFTP on Unix would need *.

For remote file specifications (such as the first argument to get), PSFTP uses a standard wildcard syntax (similar to POSIX wildcards):

  • * matches any sequence of characters (including a zero-length sequence).
  • ? matches exactly one character.
  • [abc] matches exactly one character which can be a, b, or c.

    [a-z] matches any character in the range a to z.

    [^abc] matches a single character that is not a, b, or c.

    Special cases: [-a] matches a literal hyphen (-) or a; [^-a] matches all other characters. [a^] matches a literal caret (^) or a.

  • \ (backslash) before any of the above characters (or itself) removes that character's special meaning.

A leading period (.) on a filename is not treated specially, unlike in some Unix contexts; get * will fetch all files, whether or not they start with a leading period.