Linux mattrib Command
The Linux mattrib command is used to change or display the attributes of MS-DOS files.
mattrib is an mtools utility command that emulates the MS-DOS attrib command and can change the attributes of MS-DOS files.
Syntax
mattrib [-a|+a] [-h|+h] [-r|+r] [-s|+s] [-/] [-X] msdosfile [ msdosfiles ... ]
Parameters:
- -a/+a Remove/set the archive attribute.
- -h/+h Remove/set the hidden attribute.
- -r/+r Remove/set the read-only attribute.
- -s/+s Remove/set the system attribute.
- -/ Recursively process files in all subdirectories.
- -X Output results in a shorter format.
Example
List the attributes of all files on the MSDOS-formatted disk in drive A.
mattrib a:
Remove the hidden, system, and read-only attributes of msdos.sys on the disk in drive A.
mattrib -h -s -r a:msdos.sys
Remove the read-only attribute from all files, including those in subdirectories, on the disk in drive A.
mattrib -r -/ a:*.*
Linux Command Reference