I have a folder structure like this
a/
-b/
-c.txt
-d.txt
-backups/
I want to move the contents of folder a
into backups
so the folder structure is this.
a/
-b/
-c.txt
-d.txt
-backups/
-b/
-c.txt
-d.txt
Here are the commands I have used so far.
for d in a/*/ ; do
mkdir -p ${d}backups/
cp -ra ${d}* backups
done
I make the folder backups then I try to copy the content into the backups
folder. However, I get the error: CP Hardlink cannot copy folder onto itself. How can i do this?
Thank You