I have Mac (OSX Lion) and PC (Windows 7) with a shared folder. To mount Windows shared folder I use "Connect to Server" in Finder. All files and folders are copied ok except for the files that begin with dot (e.g .htaccess). In Windows these files are created with hidden attribute.

How to copy file/folder beginning with dot without hidden attribute?

  • At the risk of asking the obvious - have you only examined the shared folder in the Finder, or have you looked at the file (or shared directory) in a terminal window? If you do not have hidden files set to visible in the Finder (most people don't) you won't be able to see hidden files. On another note, while files such as .htaccess can surely be important, others are not as they simply contain information about the directory's structure.
    – soxman
    Commented Feb 26, 2012 at 16:34
  • I often work with dot files therefore they are visible in Finder (defaults write com.apple.finder AppleShowAllFiles TRUE). If I copy dot file/folder to a shared directory it is marked as hidden in Windows. I need it not to be hidden.
    – placeba
    Commented Feb 26, 2012 at 19:27
  • Just so I fully understand here: you need the file to (a) keep the dot prepended and (b) be visible in the shared directory on your Mac (as it is in other directories). Do you need these attributes on the Windows machine as well ("invisible," yet "visible")?
    – soxman
    Commented Feb 26, 2012 at 20:23
  • I need the files to be visible in Windows without hidden attribute. However, after being copied from Mac all the files beginning with dot have hidden attribute. Please note that in Windows dot files are not hidden by default.
    – placeba
    Commented Feb 26, 2012 at 20:42
  • According to your last comment, the solution must be applied on the Windows side and not the Mac. The solution would be to show hidden files/folders in windows, which I thing it is under the Options->View... if I am correct.
    – ismail
    Commented Feb 26, 2012 at 23:06

2 Answers 2


Let's assume for this example that your ".htaccess" file is located in the root directory of your mounted Windows share. Let's also say the Windows volume is called "WindowsShare". Finally, let's say you want to copy this file to your Desktop.

Open Terminal. Type in cd /Volumes/WindowsShare. Then type in cp .htaccess ~/Desktop. You can modify this as needed based on your file locations and file names.


So here is the answer:

  1. Navigate to /etc/
  2. Use any text editor to open smb.conf for editing. You will have to use administrator credentials e.g.,
    sudo vi smb.conf
  3. Under the [global] section of this file, add the following
    hide dot files = no
  4. Save the file. Your problem should be solved from there.
  • File /etc/smb.conf doesn't exist. I created this file, wrote hide dot files = no and restarted my mac. Also I found another smb.conf (/var/db/smb.conf) and did the same manupulations. None of these steps solved my problem.
    – placeba
    Commented Feb 28, 2012 at 19:50
  • For the test purpose I mounted windows shared folder in Ubuntu and copied dot files. The files were created without hidden attribute.
    – placeba
    Commented Feb 28, 2012 at 19:59
  • Are you running Lion? I just realized that was never made clear before. Apple removed Samba from Lion in favor of a native protocol that I am unfamiliar with (still running Snow Leopard). At this point (a) I would advise you to remove the smb.conf file you created as it is useless without Samba (b) add the info that you are running Lion to your OP to make sure you get relevant answers/info, and (c) I am bowing out since I am not running familiar with the new Windows sharing protocol in Lion. Good luck.
    – soxman
    Commented Feb 28, 2012 at 21:05

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .