Question: I want to copy a file (`home/remote_computer_user/Desktop/test1.txt`) from my remote office computer (a permanent URL + open port) to my home computer (`home/home_computer_user/Downloads/`).

How can I do this with shell commands in Linux?

My current thoughts:

1. `ssh <user>@<computer1address> -p <port>` - gives me a shell on the remote computer
2. (I think I should use `scp`, but I dont how exactly how in my case)

What are the exact commands I should use?

Answer: 
It should be something like:

```
scp -P <port> user@comp1:Desktop/test1.txt ~/Downloads/

```

Run this on your home PC.

Hope this will help you.
If you have FTP or SCP, use it. It's more comfortable.
If you are limited to ssh (like I am on many embedded systems)

Upload single file:

```
 ssh login@remotehost -p remoteport "cat >filename" <filename

```

Download single file:

```
 ssh login@remotehost -p remoteport "cat filename" >filename

```

Upload a directory

```
 tar -cf - dirname | ssh login@remotehost -p remoteport "tar -xf -"

```

Download a directory

```
 ssh login@remotehost -p remoteport "tar -cf - dirname" | tar -xf - 

```

Instead of `dirname` you can specify multiple files, directories or a pattern to match. Watch out for absolute paths.