From 1b056511612a51aec9f2df4930e50ef032895b4d Mon Sep 17 00:00:00 2001 From: Gilles Quenot Date: Tue, 3 Jan 2023 10:34:10 +0700 Subject: [PATCH] cp: example using -t (#9706) * Add example using -t Think of: find . -name '*foobar*' -type f -print0 | xargs -0 cp -r DEST_DIR All of the files passed by the pipe will remain in DEST_DIR * cp: add missing ":" in description * cp: fix typo * Update pages/common/cp.md * Fix typo --- pages/common/cp.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pages/common/cp.md b/pages/common/cp.md index 2fb17d1881..9b4388ed94 100644 --- a/pages/common/cp.md +++ b/pages/common/cp.md @@ -26,3 +26,7 @@ - Follow symbolic links before copying: `cp -L {{link}} {{path/to/target_directory}}` + +- Use the first argument as the destination directory (useful for `xargs ... | cp -t `): + +`cp -t {{path/to/target_directory}} {{path/to/file_or_directory1 path/to/file_or_directory2 ...}}`