Hackjustu Hackjustu - 4 months ago 11
Linux Question

Equivalent Mac "cp -X" on Linux

I'm migrating some bash scripts written for Mac to Linux, in which

cp -X
is used in several places. Some research shows that
cp -X
on Mac is different from
cp -x
on Linux.

The first one means "Do not copy Extended Attributes (EAs) or resource forks" while the latter means "stay on this file system".

So is there an equivalent Mac "cp -X" on Linux?

Thanks in advance:)


cp on Linux doesn't copy xattrs by default, and Linux doesn't have resource forks at all.

Thus, you don't need it -- default behavior does what you want.

However, if you want to be completely explicit:

cp --no-preserve=xattr