To copy all files from a subdirectory into another directory without have to copy the original folder I do this:
cp -r dir1/* dir2
So dir2 has all the files of dir1 but it doesn’t contain the dir1. I want to replicate it in bash script. But I get an error when I run the below code:
cp -r $pck_dir"/*" $TAR_DIR"/pck/"
This is the error I got:
cp: cannot stat ‘./mailman/lists/mailman/*’: No such file or directory
Can anyone tell me how to copy all the files from a directory to another using bash script?