Question: I try to copy files from a linux (ubuntu) machine to an external hard drive mounted on a mac but got an error message :

scp: ambiguous target

What I did is, I’m on a mac, ssh to the linux machine where files are. Then use the following command :

scp fileToCopy myMacUser@myMacMachine:/Volumes/MyExternalDrive/targetDirectory

What did I do wrong ? What is the good command to use in this case ?

Answer: If you have white space in a path, you have to escape the characters by using double backslashes \ and enclosing the entire path in quotes:

scp myfile.txt user@192.168.1.100:”/file\ path\ with\ spaces/myfile.txt”

💠

🔵 Best-selling hard drives, USB flash drives & SSDs everyone's buying.

Fast, reliable, and on sale now. Thousands pick these weekly — don't miss Amazon's lowest storage prices.

Top 10 Bestsellers
🏆 4.7★+ Reviews
📦 Prime Shipping
👉 See today's best-selling Data storage on Amazon.com HDD · USB Flash Drives · SSD · External Drives
🛒
✅ Updated hourly — Amazon real-time ranking 🔥 Limited stock deals 🔗 Affiliate
⭐ Click to see complete best-selling list ⭐