Paths

We can use both absolute and relative paths to files.

copy 'a.txt', 'c:/b/a.txt'

If names in certain file system are case insensitive (like for example in Windows or Mac OS), then paths are also case insensitive. We can use both / and \ as separators. All consecutive separators are merged into one. Starting and ending spaces are trimmed. String literals does not support escape sequences, so they mean exactly what they show and backslash \ can be used safely in paths.

copy '/a.txt/', 'c:/b///\a.txt\ '

We can insert asterisks into paths. This is how Asterisk Patterns are formed.

copy '*.txt', 'c:/b/*/data/**.txt'

Paths can start with ./ and .\. These characters are trimmed anyways and are unnecessary. For example, '././a.txt' and 'a.txt' are equivalent.

copy './a.txt', '././a.txt'

We can use .. to enter the parent directory.

copy '../../a.txt'

If double dot pushes us too far to the left, then the path becomes empty and commands cannot be executed on it.