The diskutil said that my SD card is located on /dev/disk4, so I typed

sudo dd if=/dev/rdisk4 of=~/Desktop/backup.img bs=1m

to backup my SD card. But there is a message

dd: ~/Desktop/backup.img: No such file or directory

What's the problem?

  • Does the ~/Desktop/ directory exist? Jun 17, 2017 at 15:50
  • @SteveRobillard It exists. The command works as I change to the target directory and replace it with sudo dd if=/dev/rdisk4 of=backup.img bs=1m
    – jcwu
    Jun 21, 2017 at 7:15

1 Answer 1


If you are using sudo i.e. running with root permission you DO NOT have ~ as shortcut for your home directory.

Use FULL PATHS or cd to the target directory.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.