I know that , we can copy files from host to another from mac using finder/smb protocol.
But I would like to copy files from mac to windows machine using command line. so that, I can call the same pro-grammatically.
Could anyone please guide?
Set up file sharing on the MacSelect the File Sharing checkbox, then click Options. Select “Share files and folders using SMB.” In the Windows File Sharing list, select the checkbox next to the user account that will be used to share files with Windows users, enter the password for that user, then click OK.
In Remote Desktop , select a computer list in the sidebar of the main window, then select one or more computers. In the Finder, locate the item or items you want to copy, then drag the items from the Finder to the client's screen in the control window. Select your copy options, then click Copy.
Transfer Files Using an External DriveAn external storage device (external hard drive or USB flash drive) can be used to copy data between your Mac and your new PC. For the broadest compatibility, you can format that drive with the exFAT* file system, which both macOS* and Windows* can write to.
If you can copy the files using the Finder then you have connected to the SMB share. Usually, you can see this from the command line by looking in the /Volumes
folder; if it doesn't look like it's there, try running the mount
command to see other places things might be connected. The following assumes the SMB is mounted in /Volumes
, adjust as necessary for your particular case.
On the command line, issue the command:
ls /Volumes
You should see the SMB share listed along with some other names.
Then to copy files to it:
cp myfiles/* /Volumes/MySMBShare/mydirectory
If the name of the share has spaces in it you will need to escape them with backslashes like so:
cp myfiles/* /Volumes/My\ SMB\ Share/mydirectory
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With