Copy directory in server to directory in local machine My class requires for us to make the homework in a linux server, but i want to copy those files to my local machine. I've tried so far to to use the cp command but it doesn't seem to take my arguments. It always return with either the host directory does not exist or with the target directory does not exist.

My approach so far has been:

cp -R /chapter2 ~/Documents/Projects


Keep in mind that i'm connected to a remote server on ssh.
I got it to work with the help of @klanomath. It never occurred to me that the command is supposed to be executed without connection to the host@IP:. I just added -r and /*file. to the command to get all files in one instance.

scp -r host@IP:/home/username/chapter2/*.c ~/Documents/Projects