ATTRIB

Last updated
attrib
Developer(s) Intel, IBM, Microsoft, DR, Datalight, Novell, Phil Brutsche, ReactOS Contributors
Initial release1984, 3839 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, [1] DOS, IBM OS/2, [2] Microsoft Windows [3] and ReactOS [4] 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. [5]

Contents

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). [6] However, initial releases of the operating system did not provide user-level method for reading or changing these values. [7]

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. [7] Subsequent versions allowed the read-only, hidden, system and archive bits to be set. [8] MS-DOS version 3.3 added the capability of recursive searching through subdirectories to display attributes of specified files. [9]

Digital Research DR DOS 6.0 [10] and Datalight ROM-DOS [11] also include an implementation of the ATTRIB command.

The FreeDOS version was developed by Phil Brutsche and is licensed under the GPLv2. [12]

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. [13] Changing the system attribute was not possible in early versions of Windows, thus requiring use of ATTRIB. [13] 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. [14] Manipulating the archive bit allowed users to control which files were backed up using the BACKUP command. [7]

See also

Related Research Articles

cd (command) Computer command in various operating systems

The cd command, also known as chdir, is a command-line shell command used to change the current working directory in various operating systems. It can be used in shell scripts and batch files.

dir (command) Directory information command on various operating systems

In computing, dir (directory) is a command in various computer operating systems used for computer file and directory listing. It is one of the basic commands to help navigate the file system. The command is usually implemented as an internal command in the command-line interpreter (shell). On some systems, a more graphical representation of the directory structure can be displayed using the tree command.

mkdir Directory creation command on various operating systems

The mkdir command in the Unix, DOS, DR FlexOS, IBM OS/2, Microsoft Windows, and ReactOS operating systems is used to make a new directory. It is also available in the EFI shell and in the PHP scripting language. In DOS, OS/2, Windows and ReactOS, the command is often abbreviated to md.

fdisk Command line utility of DOS and Microsoft Windows operating systems

fdisk is a command-line utility for disk partitioning. It has been part of DOS, DR FlexOS, IBM OS/2, and early versions of Microsoft Windows, as well as certain ports of FreeBSD, NetBSD, OpenBSD, DragonFly BSD and macOS for compatibility reasons. Windows 2000 and its successors have replaced fdisk with a more advanced tool called diskpart.

In computing, CLS is a command used by the command-line interpreters COMMAND.COM and cmd.exe on DOS, Digital Research FlexOS, IBM OS/2, Microsoft Windows and ReactOS operating systems to clear the screen or console window of commands and any output generated by them. It does not clear the user's history of commands, however. The command is also available in the DEC RT-11 operating system, in the open-source MS-DOS emulator DOSBox and in the EFI shell. In other environments, such as Linux and Unix, the same functionality is provided by the clear command.

<span class="mw-page-title-main">XCOPY</span> Computing command

In computing, XCOPY is a command used on IBM PC DOS, MS-DOS, IBM OS/2, Microsoft Windows, FreeDOS, ReactOS, and related operating systems for copying multiple files or entire directory trees from one directory to another and for copying files across a network.

File attributes are a type of meta-data that describe and may modify how files and/or directories in a filesystem behave. Typical file attributes may, for example, indicate or specify whether a file is visible, modifiable, compressed, or encrypted. The availability of most file attributes depends on support by the underlying filesystem where attribute data must be stored along with other control structures. Each attribute can have one of two states: set and cleared. Attributes are considered distinct from other metadata, such as dates and times, filename extensions or file system permissions. In addition to files, folders, volumes and other file system objects may have attributes.

tree (command) Shell command in various operating systems

In computing, tree is a recursive directory listing command or program that produces a depth-indented listing of files. Originating in PC- and MS-DOS, it is found in Digital Research FlexOS, IBM/Toshiba 4690 OS, PTS-DOS, FreeDOS, IBM OS/2, Microsoft Windows, and ReactOS. A version for Unix and Unix-like systems is also available.

In computing, DELTREE is a command line command in some Microsoft operating systems, SpartaDOS X and FreeDOS that recursively deletes an entire subdirectory of files.

del (command) Command in various operating systems

In computing, del is a command in command-line interpreters (shells) such as COMMAND.COM, cmd.exe, 4DOS, NDOS, 4OS2, 4NT and Windows PowerShell. It is used to delete one or more files or directories from a file system.

ver (command) Command in many command-line interpreters

In computing, ver is a command in various command-line interpreters (shells) such as COMMAND.COM, cmd.exe and 4DOS/4NT. It prints the name and version of the operating system, the command shell, or in some implementations the version of other commands. It is roughly equivalent to the Unix command uname.

find (Windows)

In computing, find is a command in the command-line interpreters (shells) of a number of operating systems. It is used to search for a specific text string in a file or files. The command sends the specified lines to the standard output device.

In some operating systems, vol is a command within the command-line interpreters (shells) such as COMMAND.COM and cmd.exe. It is used to display the volume label and volume serial number of a logical drive, such as a hard disk partition or a floppy disk, if they exist.

help (command) Command in various command line shells

In computing, help is a command in various command line shells such as COMMAND.COM, cmd.exe, Bash, qshell, 4DOS/4NT, Windows PowerShell, Singularity shell, Python, MATLAB and GNU Octave. It provides online information about available commands and the shell environment.

copy (command)

In computing, copy is a command in various operating systems. The command copies computer files from one directory to another.

<span class="mw-page-title-main">TIME (command)</span>

In computing, TIME is a command in DEC RT-11, DOS, IBM OS/2, Microsoft Windows and a number of other operating systems that is used to display and set the current system time. It is included in command-line interpreters (shells) such as COMMAND.COM, cmd.exe, 4DOS, 4OS2 and 4NT.

format (command)

In computing, format, a command-line utility that carries out disk formatting. It is a component of various operating systems, including 86-DOS, MS-DOS, IBM PC DOS and OS/2, Microsoft Windows and ReactOS.

comp (command)

In computing, comp is a command used on DEC OS/8, DOS, DR FlexOS, IBM OS/2, Microsoft Windows and related computer operating systems such as ReactOS. It is used to perform comparisons of multiple computer files to show the differences between them.

In computing, diskcomp is a command used for comparing the complete contents of a floppy disk to another one.

References

  1. ISIS II Users Guide
  2. "JaTomes Help - OS/2 Commands". Archived from the original on 2019-04-14. Retrieved 2019-07-27.
  3. Microsoft TechNet Attrib article
  4. reactos/attrib.c at master · reactos/reactos · GitHub
  5. "EFI Shells and Scripting". Intel . Retrieved 2013-09-25.
  6. IBM Disk Operating System Version 4.00 Technical Reference (1st ed.). July 1988. p. 3:5.
  7. 1 2 3 Petzold, Charles (June 10, 1986). "Changing DOS File Attributes". PC Magazine. pp. 249–262.
  8. "DOS Attrib". Encyclopedia. PC Magazine. Archived from the original on 2012-03-02. Retrieved 2007-08-02.
  9. "Using ATTRIB, CHKDSK, or DIR Command to Locate Files". Microsoft. Archived from the original on 2014-09-01. Retrieved 2017-11-01.
  10. "DR DOS 6.0 User Guide Optimisation and Configuration Tips" (PDF). Archived from the original (PDF) on 2019-09-30. Retrieved 2019-08-13.
  11. "Datalight ROM-DOS User's Guide" (PDF). www.datalight.com.
  12. "FreeDOS 1.2 Updates Package - attrib (FreeDOS Base)". Ibiblio.org. 2003-07-01. Retrieved 2022-09-08.
  13. 1 2 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.
  14. 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