I use terminal/the command line on a daily basis for front end web development.
As an example: Today, from the command-line I was trying duplicate a project to make a responsive web page design from a non-responsive template I had created. I know you can use cp -a /source/. /dest/
like shown here to copy files but it isn't quite duplication.
Instead of copying; inside of directory X
I wanted to duplicate directory A
so I have directory A
and directory A(1)
side by side.
I know I could quickly do this in the GUI but for the sake of a streamlined workflow I got curious.
So, would copying (cp
) the directory to the same folder accomplish the same thing or this also void?
Is direct duplication at the command-line not possible or is there a certain way you have to go about it?
Thanks.
mkdir -p path/to/original/dir2/ ; cp -r /path/to/original/dir/ /path/to/original/dir2/
should do the trick – Wayne_Yux Oct 30 '15 at 09:23dir
and then typedmkdir dir2/ ; cp -r dir1 dir2
and it worked all in one go. Thanks, I'll be sure to use this next time my terminal usage calls for it! Switching out and going through all the folders takes a bit of time compared to this! – ConstantFun Nov 01 '15 at 14:53