In
computing
Computing is any goal-oriented activity requiring, benefiting from, or creating computer, computing machinery. It includes the study and experimentation of algorithmic processes, and the development of both computer hardware, hardware and softw ...
,
ATTRIB
is a
command
Command may refer to:
Computing
* Command (computing), a statement in a computer language
* command (Unix), a Unix command
* COMMAND.COM, the default operating system shell and command-line interpreter for DOS
* Command key, a modifier key on A ...
in
Intel
Intel Corporation is an American multinational corporation and technology company headquartered in Santa Clara, California, and Delaware General Corporation Law, incorporated in Delaware. Intel designs, manufactures, and sells computer compo ...
ISIS-II,
DOS
DOS (, ) is a family of disk-based operating systems for IBM PC compatible computers. The DOS family primarily consists of IBM PC DOS and a rebranded version, Microsoft's MS-DOS, both of which were introduced in 1981. Later compatible syste ...
,
IBM
International Business Machines Corporation (using the trademark IBM), nicknamed Big Blue, is an American Multinational corporation, multinational technology company headquartered in Armonk, New York, and present in over 175 countries. It is ...
OS/2
OS/2 is a Proprietary software, proprietary computer operating system for x86 and PowerPC based personal computers. It was created and initially developed jointly by IBM and Microsoft, under the leadership of IBM software designer Ed Iacobucci, ...
,
Microsoft
Microsoft Corporation is an American multinational corporation and technology company, technology conglomerate headquartered in Redmond, Washington. Founded in 1975, the company became influential in the History of personal computers#The ear ...
Windows
Windows is a Product lining, product line of Proprietary software, proprietary graphical user interface, graphical operating systems developed and marketed by Microsoft. It is grouped into families and subfamilies that cater to particular sec ...
and
ReactOS
ReactOS is a Free and open-source software, free and open-source operating system for i586/amd64 personal computers that is intended to be binary-code compatibility, binary-compatible with computer programs and device drivers developed for Wind ...
that allows the user to change various characteristics, or "
attributes" of a
computer file
A computer file is a System resource, resource for recording Data (computing), data on a Computer data storage, computer storage device, primarily identified by its filename. Just as words can be written on paper, so too can data be written to a ...
or
directory. The command is also available in the
EFI shell.
History
Several
operating system
An operating system (OS) is system software that manages computer hardware and software resources, and provides common daemon (computing), services for computer programs.
Time-sharing operating systems scheduler (computing), schedule tasks for ...
s provided a set of modifiable file characteristics that could be accessed and changed through a low-level
system call
In computing, a system call (syscall) is the programmatic way in which a computer program requests a service from the operating system on which it is executed. This may include hardware-related services (for example, accessing a hard disk drive ...
. For example, as of release
MS-DOS
MS-DOS ( ; acronym for Microsoft Disk Operating System, also known as Microsoft DOS) is an operating system for x86-based personal computers mostly developed by Microsoft. Collectively, MS-DOS, its rebranding as IBM PC DOS, and a few op ...
4.0, the first six
bit
The bit is the most basic unit of information in computing and digital communication. The name is a portmanteau of binary digit. The bit represents a logical state with one of two possible values. These values are most commonly represented as ...
s of the file attribute
byte
The byte is a unit of digital information that most commonly consists of eight bits. Historically, the byte was the number of bits used to encode a single character of text in a computer and for this reason it is the smallest addressable un ...
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
In information technology, a backup, or data backup is a copy of computer data taken and stored elsewhere so that it may be used to restore the original after a data loss event. The verb form, referring to the process of doing so, is "wikt:back ...
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
PC or pc may refer to:
Arts and entertainment
* Player character or playable character, a fictional character controlled by a human player, usually in role-playing games or computer games
* '' Port Charles'', an American daytime TV soap opera
* ...
, 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
MS-DOS ( ; acronym for Microsoft Disk Operating System, also known as Microsoft DOS) is an operating system for x86-based personal computers mostly developed by Microsoft. Collectively, MS-DOS, its rebranding as IBM PC DOS, and a few op ...
version 3.3 added the capability of recursive searching through subdirectories to display attributes of specified files.
Digital Research
Digital Research, Inc. (DR or DRI) was a privately held American software company created by Gary Kildall to market and develop his CP/M operating system and related 8-bit, 16-bit and 32-bit systems like MP/M, Concurrent DOS, FlexOS, Multiuser ...
DR DOS 6.0 and
Datalight ROM-DOS also include an implementation of the command.
The
FreeDOS
FreeDOS (formerly PD-DOS) is a free software operating system for IBM PC compatible computers. It intends to provide a complete MS-DOS-compatible environment for running Legacy system, legacy software and supporting embedded systems. FreeDOS ca ...
version was developed by Phil Brutsche and is licensed under the
GPLv2
The GNU General Public Licenses (GNU GPL or simply GPL) are a series of widely used free software licenses, or copyleft, ''copyleft'' licenses, that guarantee end users the freedom to run, study, share, or modify the software. The GPL was th ...
.
Uses
Setting the read-only bit of a file provided only partial protection against inadvertent deletion: while commands such as
del
Del, or nabla, is an operator used in mathematics (particularly in vector calculus) as a vector differential operator, usually represented by the nabla symbol ∇. When applied to a function defined on a one-dimensional domain, it denotes ...
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 Linux
*
cacls
, the Windows NT
access control list
In computer security, an access-control list (ACL) is a list of permissions associated with a system resource (object or facility). An ACL specifies which users or system processes are granted access to resources, as well as what operations are ...
(ACL) utility
*
List of DOS commands
This article lists notable commands provided by the MS-DOS disk operating system (DOS), especially as used on an IBM PC compatible computer. Other DOS variants as well as the legacy Windows shell, Command Prompt (cmd.exe), provide many of these c ...
References
Further reading
*
*
*
External links
attrib , Microsoft Docs
{{Windows commands
External DOS commands
MSX-DOS commands
OS/2 commands
ReactOS commands
Windows commands