DOKK / manpages / debian 10 / gcp / gcp.1.en
GCP(1) General Commands Manual GCP(1)

gcp - Advanced command-line file copier

gcp [OPTIONS] FILE DEST
gcp [OPTIONS] FILE1 [FILE2...] DEST-DIR

gcp is a file copier, loosely inspired by cp, but with high level functionalities like:

  • transfer progression indication
  • continuous copying when there is an issue: it skips the problematic file and goes on
  • copy status logging: which files were effectively copied
  • name mangling to handle target filesystem limitations (e.g. removing incompatible chars like "?" or "*" on FAT filesystems)
  • forced copy serialization: new files to copy are added to a global queue to avoid hard drive head seeks
  • transfer list management: gcp can save a list of files to copy and reuse it later
  • approximate option compatibility with cp (approximate because the behaviour is not exactly the same, see below)

These programs follow the usual GNU command line syntax, with long options starting with two dashes (`-').

A summary of options is included below.

Show summary of options.
Show program version and copyright information and exit.

Overwrite existing files.
Always follow symbolic links in sources.
Never follow symbolic links in sources.
Same as --preserve=mode,ownership,timestamps
Preserve specified attributes. Attributes can be mode, ownership and timestamps. When several attributes are passed, they need to be separated by commas. Please note that timestamps preservation has some limits, see section LIMITATIONS.
Copy directories recursively.
Display what is being done.

gcp has the ability to modify the destination file name if the target file system would not accept the original file name. Offending characters will be replaced with similar-looking ones.
This option accept the following values:
gcp will attempt to be smart, i.e. detect incompatibilities and fix them as-needed.
Always fix file names that could cause problems on any known filesystem or OS. This is useful e.g. with NTFS, see NOTE ON NTFS below.
Renaming is disabled entirely.
Currently, gcp is only aware of FAT incompatibilities: ´\´, ´:´, ´*´, ´?´, ´"´, ´<´, ´>´ and ´|´.
Same as --fix-filenames=no. This option will be removed in a future release.
Disable progress bar.

Save the list of source files in a list named SOURCES.
Save the list of source files in a list named SOURCES; the file is overwritten it already exists.
Use the list of source files named SOURCES.
Delete the list of source files named SOURCES.
List the names of source file lists.
List the names of source file lists, including their content.

The exit status can be:

0 if files have been copied correctly or if another instance of gcp is already running and will do the copy.
1 if at least one file has not been copied, or if something went wrong.
2 if all files have been copied but with some issues

Timestamps preservation with --preserve option is limited by the os Python module on POSIX systems. Currently, Python only returns timestamps in float format, which is a smaller precision than what POSIX provides. Progress on this issue can be seen at http://bugs.python.org/issue11457.

The --preserve option cannot currently be used without an attribute list (gcp --preserve foo bar will behave as gcp --preserve=foo bar). Use the -p switch instead.

NTFS will not enforce the same file name limitations than FAT, but files that would not be accepted on a FAT filesystem will still cause problems on Windows. Hence, it is recommended to use --fix-filenames=force when copying to NTFS (when Windows compatibility is desired, anyway).

cp(1).

gcp was written by Jérôme Poisson <goffi@goffi.org>. It is currently maintained by Matteo Cypriani <mcy@lm7.fr>.

This manual page was initially written by Thomas Preud'homme <robotux@celest.fr> for the Debian project (and may be used by others).

October 14, 2018