Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
For directories, you need the flag: -r
It's always a good idea to escape variables with double quotes:
cp -r "$dir/a/src" "$dir/b/"
This will solve problems with spaces and other specials. characters...
Alternatively, you can use bash auto-completion by writing/copying the beginning of the name and pressing tab.
In this case, bash escapes everything you need with "\":
cp -r /home/user/Desktop/a/dir /home/user/Desktop/b/
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question