chdosattr(1) General Commands Manual chdosattr(1)

chdosattr - change DOS file attributes

chdosattr [ -RVH ] ATTR FILES...

chdosattr changes the following DOS attributes of files:

r (READONLY)
h (HIDDEN)
s (SYSTEM)
a (ARCHIVED)

The format of ATTR is in two parts, in the format of [+-=][ahrs], where the first part is the operator spec the second part the DOS attributes. The operator + causes the specified DOS attributes to be added the existing DOS attribute set; - causes them to be removed; and = causes them to be added and causes unmentioned DOS attributes to be removed. If the operator part is omitted, = is assumed.

Change files and directories recursively
Show version
Show help

0
on success
1
when no file could modified
2
on usage error
3
when an error occurred but at least one file has been successfully modified

The modification of the DOS attribute s(SYSTEM) requires CAP_LINUX_IMMUTABLE(see capabilities(7)).

For obvious reasons, the DOS attributes s(DIRECTORY) and v(VOLUME) cannot be altered.

In vFAT, exFAT and NTFS, only the READONLY attribute is controlled through owner write permission bit. Linux kernel always sets ARCHIVE on files it creates and modifies. HIDDEN and SYSTEM can only be controlled through ioctl_fat(2). lsdosattr(1) and chdosattr(1) are the wrappers for the ioctl.

chmod(1), chattr(1), ioctl_fat(2) and the documentation on ATTRIB command in Microsoft Windows and various DOS.