2

When I copy files from my osx disk to an external SSD drive, for some reason all the permission bits are set to 1. Is there a reason why and a way to preserve the original permissions? I did this with bash so not sure if there is a flag that I forget to put.

$ ls -l ~/test.txt
-rw-r--r--@ 1 bzon  staff   1.0G Aug 29  2017 test.txt
$ cp ~/test.txt /Volumes/SSD/test.txt
$ ls -l /Volumes/SSD/test.txt
-rwxrwxrwx@ 1 bzon  staff   1.0G Jan  5 20:28 /Volumes/SSD/test.txt
Saaru Lindestøkke
  • 5,515
  • 8
  • 30
  • 48
JRR
  • 131
  • 1
  • 5
  • 2
    What is the target filesystem? If it was NTFS in Linux then I would point to [this](https://superuser.com/q/57092/432690), [this](https://superuser.com/a/638339/432690) and [this](https://superuser.com/a/752395/432690). I don't know macOS but it may be similar. – Kamil Maciorowski Jan 06 '21 at 08:15

1 Answers1

1

For copying files between compatible filesystem types, try using cp -a SOURCE DEST . The a options stands for archive, which preserves permissions, file ownership & other meta data.