Linux mattrib Command
The Linux mattrib command is used to change or display the attributes of MS-DOS files.
mattrib is an mtools tool command that simulates 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.
Examples
List the attributes of all files on the MS-DOS formatted disk in drive A.
mattrib a:
Remove the hidden, system, and read-only attributes of the msdos.sys file on the disk in drive A.
mattrib -h -s -r a:msdos.sys
Remove the read-only attribute of all files, including those in subdirectories, on the disk in drive A.
mattrib -r -/ a:*.*Other Extensions
Linux Command Complete Guide