.TH dos "" "" Command
.II "file, transfer to/from MS-DOS"
.II "hard disk, copy MS-DOS files to/from"
.II "floppy disk, copy MS-DOS files to/from"
.II "MS-DOS^copy files to/from"
.PC "Manipulate files on MS-DOS file systems"
\fBdos [-]dFflrtx[\fIflags\fB] [\fIdevice\^\fB] [\fIfile ...\^\fB]\fR
.PP
.HS
.SH Commands:
.IC \fBd\fR
Delete specified files
.IC \fBF\fR
Build \*(MD file system (format)
.IC \fBf\fR
Force removal of readonly files on the DOS side
.IC \fBl[\fIlabel\fB]\fR
Label disk
.IC \fBr\fR
Replace \fIfiles\fR (default, all files in `.')
.IC \fBt\fR
List contents (default, all files)
.IC \fBx\fR
Extract specified \fIfiles\fR (default, all files)
.SH Flags:
.IC \fBa\fR
ASCII data extract/replace (default, binary data)
.IC \fBc\fR
Read only; do not write changes to \*(MD file system
.IC \fBk\fR
Keep \fImtime\fR on extract/replace (default, now)
.IC \fBn\fR
Newest files first in list (default, alphabetized)
.IC \fBp\fR
Piped extract/replace
.IC \fBs\fIdir\fR
Suppress subdirectory \fIdir\fR
.IC \fBv\fR
Verbose
.IC \fB[1-9]\fR
Specify logical drive on extended \*(MD partition
.Pp
The default device is \fB/dev/dos\fR.
.HE
The command
.B dos
allows the \*(CO user to manipulate an \*(MD file system,
which may be either a hard-disk partition or a floppy disk.
It can build an empty \*(MD file system,
label it, list the files in it,
transfer files between it and \*(CO, or delete files from it.
.PP
The given
.I device
must be a special file that specifies an \*(MD file system,
such as floppy-disk drive \fB/dev/fha0\fP or hard-disk partition
\fB/dev/at0a\fP.
The default
.I device
is \fB/dev/dos\fP,
which the system administrator should link to the
most commonly used device name.
.PP
.B dos
converts between the differing file-name conventions
of \*(CO and \*(MD.
An \*(MD
.I file
argument may be specified in lower or upper case, using `/' as
the path-name separator.
When transferring files from \*(MD to \*(CO,
.B dos
converts an \*(MD file name to a \*(CO file name in lower case only.
If the \*(MD file name contains no extension,
the \*(CO file name contains no `.'.
When transferring files from \*(CO to \*(MD,
.B dos
converts all alphabetic characters in a \*(CO file name to upper case;
if a period `.' appears at the beginning or end of a file name,
.B dos
converts it to `_'.
.B dos
truncates the part of the file name before the last `.' to
a maximum of eight characters
and truncates the extension to a maximum of three characters.
.PP
The command line must specify exactly one of the following \fIfunctions\fP.
.IP \fBd\fP
Delete each
.I file
from the \*(MD file system.
This option also allows the user to delete empty directories.
.IP \fBF\fP
Create an empty \*(MD file system on a formatted diskette.
This option is analogous to the \*(CO command
.BR /etc/mkfs .
The \*(CO commands
.B /etc/fdformat
and
.B /etc/mkfs
initialize a \*(CO diskette in two steps.
The \*(MD command
.B format
initializes an \*(MD diskette by performing both the physical
and logical formatting operations with one command.
To initialize an \*(MD diskette under \*(CO, use the command
\fB/etc/fdformat -v \fIdevicename\fR,
followed by the command \fBdos F \fIdevicename\fR.
If
.I file
is named,
.B dos
copies it to the boot block of the file system.
The
.B dos
command cannot build a file system on a hard-disk partition.
.IP \fBf\fR
Force removal of \fBreadonly\fR files on the \*(MD side.
.IP \fBl\fP
Label the \*(MD file system.
The command line must specify exactly one
.I file
argument, which gives the label.
.IP \fBr\fP
Replace each
.I file
on the \*(MD file system with the \*(CO file of the same name.
If a given
.I file
argument specifies a \*(CO directory,
.B dos
replaces its subdirectories recursively
to the \*(MD file system unless the \fBs\fP flag is used.
If no
.I file
is specified,
.B dos
copies all files in the current directory to the \*(MD file system.
.IP \fBt\fP
List the files on the \*(MD file system.
If no
.I file
argument
is given,
.B dos
lists the entire \*(MD file system;
otherwise, it lists each \fIfile\fP.
If a
.I file
argument specifies an \*(MD subdirectory,
.B dos
lists its contents.
.B dos
lists directories first in alphabetical order, then ordinary files
in alphabetical order.
.IP \fBx\fP
Extract each
.I file
from the \*(MD file system to a \*(CO file of the same name.
If a given
.I file
argument specifies an \*(MD subdirectory,
.B dos
extracts its contents recursively
unless the \fBs\fP flag is used.
If no
.I file
is given,
.B dos
extracts all files from the \*(MD
file system to the current \*(CO directory.
.PP
The following \fIflags\fP are available.
.RS
.IP \fBa\fP
Perform ASCII newline conversion on file transfer.
When moving files from \*(CO to \*(MD,
this option
converts each \*(CO newline character `\en' (ASCII \fBLF\fP)
to an \*(MD end-of-line (ASCII \fBCR\fP and \fBLF\fP);
when moving files from \*(MD to \*(CO, it does the opposite.
By default,
.B dos
performs binary file transfer, without newline conversion.
.IP \fBk\fP
Keep the file modification time (mtime) on extract and replace operations.
By default,
.B dos
gives extracted or replaced files the current time.
With this option,
.B dos
gives the extracted or replaced file the same time
as the original file.
.IP \fBn\fP
List files in order of creation (newest file last) rather than in alphabetical order.
This option applies only to the table-of-contents function.
.B dos
always lists directories before files, with or without the \fBn\fP option.
.IP \fBp\fP
Perform a piped extract or replace (for use in pipelines).
The command line must specify exactly one
.I file
argument.
For extract,
.B dos
reads the given
.I file
and writes it to the standard output.
For replace,
.B dos
reads the standard input
and writes it to the given \fIfile\fP.
.IP \fBs\fP
Suppress extraction or replacement of subdirectories.
By default,
.B dos
extracts or replaces subdirectories recursively.
.IP \fBv\fP
Verbose option.
Provide additional information about each function performed.
.IP [\fB1-9\fP]
A digit specifies a logical drive number on an extended \*(MD partition.
For example, \fBdos tv2 /dev/at0c\fP
lists the directory of the second logical drive
on extended \*(MD partition \fB/dev/at0c\fP.
.SH "dos Commands"
.B dos
is an obsolete command.
It has largely been superceded by the following family of \*(CO commands that
manipulate \*(MD file systems:
.IP \fBdoscat\fR 0.75i
Concatenate a file on an \*(MD file system.
.IS \fBdoscp\fR
Copy files to/from an \*(MD file system
.IS \fBdoscpdir\fR
Copy a directory to/from an \*(MD file system
.IS \fBdosdel\fR
Delete a file from an \*(MD file system
.IS \fBdosdir\fR
List contents of an \*(MD directory
.IS \fBdosformat\fR
Build an \*(MD file system on a floppy disk
.IS \fBdoslabel\fR
Label an \*(MD floppy disk
.IS \fBdosls\fR
List files on an \*(MD file system
.IS \fBdosmkdir\fR
Create a directory in an \*(MD file system
.IS \fBdosrm\fR
Remove a file from an \*(MD file system
.IS \fBdosrmdir\fR
Remove a directory from an \*(MD file system
.PP
For details, see these commands' entries within the Lexicon.
.SH Examples
The first example
copies all files located in directories
.B sources
and
.BR include ,
as well as any subdirectories,
from floppy drive \fB/dev/fva1\fR to correspondingly named
subdirectories in the current \*(CO directory:
.DM
	dos xavk /dev/fva1 sources include
.DE
.PP
Note that
.B fva1
is a high-density, 3.5-inch floppy disk in floppy-disk drive 1
(a.k.a., drive B:).
The files will be copied with ASCII newline conversion and will
retain the time and date that they had under \*(MD.
.PP
The next example copies a file from an \*(MD partition on your hard disk.
Suppose that
.B C:
is the primary \*(MD partition on your first hard drive.
The following command copies file
.B C:\eAUTOEXEC.BAT
to
.B /autoexec.bat
in your \*(CO root partition:
.DM
	dos xa /dev/at0a /autoexec.bat
.DE
.PP
You will want to use the
.B a
switch any time you are transferring a text file.
.PP
Suppose that the second partition on your first hard drive
(\*(CO device
.BR /dev/at0b )
is an extended \*(MD partition with two logical
drives,
.B D:
and
.BR E: .
To copy a \*(CO text file
.B /tmp/foo
to
.BR D:\eTMP\eFOO ,
use the command
.DM
	dos ra1 /dev/at0b /tmp/foo
.DE
.PP
To copy non-text file
.B frotz
in the current \*(CO directory to
\*(MD file
.BR E:\eDBF\eAX\eFROTZ ,
use the command
.DM
	dos rp2 /dev/at0b dbf/ax/frotz < frotz
.DE
.SH "See Also"
.Xr "commands," commands
.Xr "fdformat," fdformat
.Xr "mkfs," mkfs
.Xr "MS-DOS" ms-dos
.SH Notes
.B dos
is an obsolete command.
It has been retained for compatibility with earlier versions of \*(CO.
We urge you to use the other members in the \fBdos\fR family of commands,
which have a cleaner syntax and are much easier to use.
.PP
.B dos
does not check for unusual characters in a \*(CO file name
or for file names that differ from other file names only in case.
.PP
The
.B dos
family of commands now support large file systems, such as
those created by \*(MD versions 4.0 and 5.0.
.PP
The \*(CO system's
.B dos
family of commands do not understand compressed \*(MD
file systems created by programs such as
.B Stacker
or \*(MD 6.0
.BR dblspace .
If you are running \*(MD with file compression,
you must copy files to an uncompressed file system
(for example, to an uncompressed floppy disk or to the uncompressed
host for a compressed file system) to make them accessible to the
\*(CO
.B dos
commands.
