In Linux shell, How can I copy all files from /folder
into /folder/sub
?
the normal way of copying recursively isn't working (which makes sense) because i'm copying a folder into itself...
In Linux shell, How can I copy all files from /folder
into /folder/sub
?
the normal way of copying recursively isn't working (which makes sense) because i'm copying a folder into itself...
cp -a !(sub) sub
You can exclude the sub directory.
From the comments on that similar question:
If this doesn't work, you might need to enable:
shopt -s extglob