The ReactOS attrib command | |
Developer(s) | Intel, IBM, Microsoft, DR, Datalight, Novell, Phil Brutsche, ReactOS Contributors |
---|---|
Initial release | 1984, 40–41 years ago (DOS version) |
Operating system | ISIS-II, PC DOS, MS-DOS, MSX-DOS, SISNE plus, OS/2, eComStation, ArcaOS, Windows, DR DOS, ROM-DOS, FreeDOS, ReactOS, SymbOS |
Platform | Cross-platform |
Type | Command |
License | FreeDOS, ReactOS: GPLv2 |
In computing, ATTRIB
is a command in Intel ISIS-II, DOS, IBM OS/2, Microsoft Windows and ReactOS that allows the user to change various characteristics, or "attributes" of a computer file or directory. The command is also available in the EFI shell.
History
Several operating systems provided a set of modifiable file characteristics that could be accessed and changed through a low-level system call. For example, as of release MS-DOS 4.0, the first six bits of the file attribute byte indicated whether or not a file was read-only (as opposed to writeable), hidden, a system file, a volume label, a subdirectory, or if the file had been "archived" (with the bit being set if the file had changed since the last use of the BACKUP
command). However, initial releases of the operating system did not provide user-level method for reading or changing these values.
The initial version of the ATTRIB
command for DOS was first included in version 3.0 of PC DOS, with functionality limited to changing the read-only attribute. Subsequent versions allowed the read-only, hidden, system and archive bits to be set. MS-DOS version 3.3 added the capability of recursive searching through subdirectories to display attributes of specified files.
Digital Research DR DOS 6.0 and Datalight ROM-DOS also include an implementation of the ATTRIB
command.
The FreeDOS version was developed by Phil Brutsche and is licensed under the GPLv2.
Uses
Setting the read-only bit of a file provided only partial protection against inadvertent deletion: while commands such as del
and erase
would respect the attribute, other commands such as DELTREE
did not. Changing the system attribute was not possible in early versions of Windows, thus requiring use of ATTRIB
. Similarly, a system crash in early versions of Windows could lead to a situation where a temporary file had the read-only bit set and was additionally (and irrevocably) locked by the Windows OS; in this instance, booting into DOS (thus avoiding the Windows lock) and unsetting the read-only attribute with ATTRIB
was the recommended way of deleting the file. Manipulating the archive bit allowed users to control which files were backed up using the BACKUP
command.
See also
chattr
, the equivalent on Unix and Linuxcacls
, the Windows NT access control list (ACL) utility- List of DOS commands
References
- ISIS II Users Guide
- "JaTomes Help - OS/2 Commands". Archived from the original on 2019-04-14. Retrieved 2019-07-27.
- Microsoft TechNet Attrib article
- reactos/attrib.c at master · reactos/reactos · GitHub
- "EFI Shells and Scripting". Intel. Retrieved 2013-09-25.
- IBM Disk Operating System Version 4.00 Technical Reference (1st ed.). July 1988. p. 3:5.
- ^ Petzold, Charles (June 10, 1986). "Changing DOS File Attributes". PC Magazine. pp. 249–262.
- "DOS Attrib". Encyclopedia. PC Magazine. Archived from the original on 2012-03-02. Retrieved 2007-08-02.
- "Using ATTRIB, CHKDSK, or DIR Command to Locate Files". Microsoft. Archived from the original on 2014-09-01. Retrieved 2017-11-01.
- "DR DOS 6.0 User Guide Optimisation and Configuration Tips" (PDF). Archived from the original (PDF) on 2019-09-30. Retrieved 2019-08-13.
- "Datalight ROM-DOS User's Guide" (PDF). www.datalight.com.
- "FreeDOS 1.2 Updates Package - attrib (FreeDOS Base)". Ibiblio.org. 2003-07-01. Retrieved 2022-09-08.
- ^ O'Reilly, Tim; Mott, Troy; Glenn, Walter J. (1999). Windows 98 in a Nutshell: A Desktop Quick Reference. O'Reilly. pp. 303–306. ISBN 1-56592-486-X.
- Jones, James G.; Landes, Craig (2003). A+ Exam Cram 2: Windows 2000 Directory Services Infrastructure. Que. pp. 309–310. ISBN 0-7897-2867-2.
Further reading
- Cooper, Jim (2001). Special Edition Using MS-DOS 6.22, Third Edition. Que Publishing. ISBN 978-0789725738.
- Dyson, Peter (1995). Mastering OS/2 Warp. Sybex. ISBN 978-0782116632.
- John Paul Mueller (2007). Windows Administration at the Command Line for Windows Vista, Windows 2003, Windows XP, and Windows 2000. John Wiley & Sons. ISBN 978-0470165799.
External links
Windows command-line programs and shell builtins | |
---|---|
File system navigation | |
File management | |
Archiving | |
Disk management | |
Processes | |
Registry | |
User environment | |
File contents | |
Scripting | |
Networking | |
Maintenance and care | |
Boot management | |
Software development | |
Miscellaneous | |