Very often I get an error message on the terminal "cp: .: Invalid argument". It also happens with other commands than "cp". For example:

me@iMac:/Volumes/boot$ cp ~/Documents/wpa_supplicant.conf .
cp: .: Invalid argument
me@iMac:/Volumes/boot$ cp ~/Documents/wpa_supplicant.conf .

Note that I did not re-type the command on line three, I just hit up-arrow and enter. Does anyone know what the problem could be, or have an idea how to debug?

Thanks, Martin

  • In general it had a problem reading '.', or that directory no longer exists (e.g. it got deleted by another terminal/process)
    – smci
    Commented Sep 2, 2017 at 11:37

2 Answers 2


Set your hard disks to never sleep in System Preferences and see if the issue still persists.

  • Your answer put me into the right direction. The path '/Volumes/boot' is an SD card. Apparently two things combine to produce the error: First, the SD card is not ready to be written, and second, 'cp' produces an error message 'Invalid argument' if the file can't be written, even though the argument as such is correct. Thanks!
    – user89124
    Commented Sep 1, 2017 at 13:48

Why not use the absolute path for the destination?

cp ~/Documents/wpa_supplicant.conf /Volumes/boot

Hope it helped,

  • Thanks, see my comment above: Your proposal would change the error message a bit, but not solve the issue. But it helped to diagnose the problem!
    – user89124
    Commented Sep 1, 2017 at 12:04

You must log in to answer this question.