Under linux how to set the attribute of a file to make it hidden?
I have a USB hard disk, the file system of it is NTFS.
I mount the USB hard disk under Linux through the ntfs-3g driver in order to READ/WRITE. What I want to do is to create a file on the USB hard disk and set it attributes to make it hidden so that when I plug back the USB hard disk into windows system, the user can't see the hidden file. I just don't know how to achieve this. Any help is appreciated. |
jut add a "." (period) at the beginning of the file name
ie Code:
.hidden_file |
I tried this method already.
It make the file hidden under Linux with no problem. but when you plug back the USB hard disk onto the windows system, you will see the file created. It is not hidden. |
make it hidden in windows ?
I don't think ntfs-3g has an option to create hidden files. |
You can't change permissions or attributes of files on an ntfs mounted partition. They are determined by the mount command options.
You could change the attributes from windows however. If you are offering a share with windows machines, then use a native linux filesystem and map dotted files to hidden ones. |
Quote:
I see. Thank you very much. anthoer question: How to map dotted files to hidden ones? |
In windows right click on the file go to properties select make hidden, you will also have to open windows explore go to tools > folder options > view then make sure that it is checked to not show hidden files.
|
In the samba share definition, use "hide dot files = yes".
|
All times are GMT -5. The time now is 12:05 AM. |