Skip to main content

To copy the content of a directory /source to another existing directory /destination can be achieved with the command cp -a

cp -a source/. destination/

Changing the variables accordingly:

  • source = challenge/vendor/
  • destination = stg/vendor/

cp -a challenge/vendor/. stg/vendor/

  • The -a option is an improved recursive option, that preserve all file attributes and also preserves symlinks;
  • The full point (.) at end of the source path (i.e. challenge/vendor/.) is a specific cp syntax that allows you to copy all files and directories (included hidden ones).

Related articles

Andrew Fletcher16 Jan 2025
get IP address from terminal OSX
When troubleshooting network issues or configuring devices, knowing your IP address can be essential. Whether you're connected via Wi-Fi, Ethernet, or tethering through a mobile provider, macOS offers powerful built-in tools to quickly identify your IP address. Here's a practical guide tailored to...