Let's say I have a directory called A.
Directory A has a bunch of c files, and I want to cp all of these files to the directory the script is running in (in the case it would be Home in the linux system).
To make sure it successfully copied I would then echo whatever was copied.
This is what I have tried:
cp -r A Home/
echo `.c` # prints the files that have a .c at the end after they get copied
You should either be in the parent directory of A to copy it somewhere or mention the full path of the files to be copied.
Eg. if B is the parent of A.
You should already be in directory B to execute the command
cp -R A <your_destination_folder_path>
Eg. cp -R A . to denote the files are to be copied to the current path
It is better to give the full absolute path of your destination.
If you are already inside of directory A and just want to copy the directory files alone. You can give this
cp * <your_destination_folder_path>
If you are in any directory but just want to copy the contents of A, then provide the full (absolute) path or relative path to A to copy the files..