chdosattr(1)

chdosattr1

Change dos file attributes

Usage

chdosattr [-RVH] ATTR FILES ...

Overview

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.

Options

-R

Change files and directories recursively

-V

Show version

-H

Show help

Exit status

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

Bugs and limitations

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.

Note

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.

From exfatprogs 1.4.3-1 in Arch Linux 2026-11-01. Parsed by carta from the page's man source.