LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-15-2009, 03:38 AM   #1
zhaohuiyu2
LQ Newbie
 
Registered: Oct 2007
Posts: 5

Rep: Reputation: 0
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.
 
Old 04-15-2009, 03:43 AM   #2
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,528

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
jut add a "." (period) at the beginning of the file name
ie
Code:
.hidden_file
 
Old 04-15-2009, 03:50 AM   #3
zhaohuiyu2
LQ Newbie
 
Registered: Oct 2007
Posts: 5

Original Poster
Rep: Reputation: 0
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.
 
Old 04-15-2009, 03:54 AM   #4
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,528

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
make it hidden in windows ?

I don't think ntfs-3g has an option to create hidden files.
 
Old 04-15-2009, 03:59 AM   #5
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671
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.

Last edited by jschiwal; 04-15-2009 at 04:01 AM.
 
Old 04-15-2009, 04:15 AM   #6
zhaohuiyu2
LQ Newbie
 
Registered: Oct 2007
Posts: 5

Original Poster
Rep: Reputation: 0
Thumbs up

Quote:
Originally Posted by jschiwal View Post
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.

I see. Thank you very much.
anthoer question:
How to map dotted files to hidden ones?
 
Old 04-15-2009, 05:16 AM   #7
mrrangerman
Member
 
Registered: Oct 2007
Location: MI
Distribution: Debian Slackware
Posts: 528

Rep: Reputation: 59
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.
 
Old 04-15-2009, 10:09 AM   #8
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671
In the samba share definition, use "hide dot files = yes".
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to make files hidden from windows when using linux.? ciden Linux - Newbie 5 05-19-2008 03:17 AM
How to make a hidden file visible royeo Linux - Newbie 2 09-29-2006 01:45 AM
how to set "archive" attribute on windows file residing on linux server LarryFrigginWachs Linux - Newbie 2 06-01-2006 08:46 AM
changing file attribute on windows shares from linux soup21 Linux - Networking 2 11-23-2005 11:58 PM
VFAT file attribute SloppyO Linux - General 2 09-11-2001 12:24 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:11 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration