[clug] Editing FAT attributes in Linux

Scott Ferguson scott.ferguson.clug at gmail.com
Wed Feb 4 00:00:44 MST 2015

On 04/02/15 16:19, Alex Satrapa wrote:
> Dear Lazyweb,
> I would like to be able to set the "hidden" attribute on files and
> directories on a FAT filesystem (e.g.: thumb drive, SD Card) so that
> dotfiles are hidden from Windows PCs and, for example, digital
> picture frames.
> There is a question on Superuser that hasn't been answered yet, so I
> thought I would ask the knowledgeable community of Linux geeks here
> :)
> http://superuser.com/questions/656826/command-line-tool-to-edit-fat-fat32-attributes-on-mac-os-x

I'm surprised it hasn't at least been labeled - "this question has been
answered many times previously"

>  I know that Samba can do this kind of thing automatically for
> network shares (i.e.: make dotfiles on the local file system "hidden"
> to Windows clients connected over the network), but that does not
> alter the file system locally.

It's unclear to me what you want. I'm guessing you're talking about
sharing files between Linux, Mac, and Windows devices. Via samba and
portable devices(?) and not wanting .files to be visible on Windows
infected devices. The simplest solution is to simply leave Windows "hide
known file extensions" enabled - which, if memory serves correctly,
makes .files hidden.

> Also, my digital camera can't handle
> CIFS (slack, I know).
> Any suggestions for a GNU/BSD/other tool that might help?
> Alex

Windows "hides" files using attrib+H (and attrib+S), which can be set on
Linux using mattrib
for i in .*;do mattrib +h $i;done

Do note that some embedded devices will ignore the "hidden" attribute,
and on Windoof itself, it only applies if "show hidden files" is not
enabled.  e.g. my mothers digital picture frame, I've never seen a
Windows one (or a Windows camera), just Linux ones that use a basic vfat
file system to cater to tlcd)

With my lack of understanding on what you want to do, it would seem
better to simply set "hide known file extensions" in Windows and achieve
the same effect (.files are hidden) - but I'm uncertain of how the
latest versions of Windoof handles those files (and too lazy to check).
You could, maybe, (also) force the "hide .files for Windoof clients"
effect with smb.conf by selectively applying veto to dot files by %a
(architecture of the smbclient).

Curious - why/how would .files be on your camera?
Why would you have .files on a removable files system at all except to
back up .config from ~ (unless XDG allergic)? It'd 'seem' simpler to not
put them there in the first place (but I can be a bit thick)

Kind regards

More information about the linux mailing list