I desire to copy all files inside a directory which has only these files (all are regular files - there are no directories, symlinks, etc, inside that directory) to another pre-existing directory.
The files have pretty common names like robots.txt
and don't follow any specific pattern.
I tried a similar command:
cp -a "$HOME"/a "$HOME"/b
I understand that -a
is a shortcut-combo for -d
(preserving mode, ownership and timestamps) and -R
which orders recursive copying.
If copying is recursive, why the files aren't copied and what would be a solution?
$HOME/b
a pre-existing directory? Did you look inside it? – Kusalananda Aug 20 '19 at 21:39cp file1 ... "$HOME"/a "$HOME"/b
…” is wrong. – ctrl-alt-delor Aug 21 '19 at 08:25cp file1 file2 file3 file4 file5 "$HOME"/a "$HOME"/b
means: copy file1, file2, ... and $HOME/a into $HOME/b. (But not recursively) – ctrl-alt-delor Aug 22 '19 at 13:34