Friday, September 14, 2018

Linux copy command

I always battle to get this right - copying from everything from a folder to the directory containing the folder...that sounds weird...here is an example:

/srv/www/htdocs/htdocs_old/

As you can guess - I want everything from htdocs_old to be moved to htdocs itself. And the command is so easy - that's why I am saving it here:

cp -r * ..

Which translates to "copy" "recursively" "everything in current directory" to "directory preceding it".

No comments: