English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Linux mattrib command

Linux Command大全

The Linux mattrib command is used to change or display MS-DOS file attributes.

mattrib is a mtools tool command, simulating MS-DOS attrib command, can change MS-DOS file attributes.

Syntax

mattrib [-a|+a] [-h|+h] [-r|+r] [-s|+s] [-/] [-X] msdosfile [ msdosfiles ... ]

Parameters:

  • -a/+a Remove/Set backup attributes.
  • -h/+h Remove/Set hidden attributes.
  • -r/+r Remove/Set read-only attributes.
  • -s/+s Remove/Set system attributes.
  • -/ Recursive processing includes files in all subdirectories.
  • -X outputs the results in a shorter format.

Online Examples

List the attributes of all files on the MSDOS formatted disk in the A drive.

mattrib a: 

Remove the hidden, system, and read-only attributes of the msdos.sys file on the A drive.

mattrib -h -s -r a:msdos.sys

Remove the read-only attribute of all files under the subdirectories on the A drive.

mattrib -r -/ a:*.*

Linux Command大全