dos(1) Base System(i386) dos(1)
NAME
dos: doscat, doscp, dosdir, dosformat, dosmkdir, dosls, dosrm, dosrmdir -
access and manipulate DOS files
SYNOPSIS
doscat [-r | -m] file ...
doscp [-r | -m] file1 file2
doscp [-r | -m] file ... directory
dosdir directory
dosformat [-fqv] drive
dosls directory ...
dosmkdir directory ...
dosrm file ...
dosrmdir directory ...
DESCRIPTION
The dos commands allow access to files and directories on a DOS hard disk
partition or diskette. The DOS partition must be bootable, although not
active.
Below is a description of the dos commands:
doscat Copies one or more DOS files to the standard output. If -r
is given, the files are copied without newline conversions.
If -m is given, the files are copied with newline
conversions.
doscp Copies files from/to a DOS diskette or a DOS hard disk
partition to/from a UNIX file system. doscp will rename a
file while it is copying. For example, the command:
doscp a:file1 file2
copies the file named file1 from the DOS disk to the UNIX
file system and renames it file2.
If directory is given, one or more files are copied to that
directory. If -r is given, the files are copied without new
line conversions. If -m is given, the files are copied with
newline conversions.
dosdir Lists DOS files in the standard DOS style directory format.
(See the DOS DIR command.)
10/89 Page 1
dos(1) Base System(i386) dos(1)
dosformat Creates a DOS 2.0 formatted diskette. It cannot be used to
format a hard disk partition. The drive must be specified
using the UNIX special file names. For example, if your
system has two floppy drives, the first a 3.5" and the second
a 5.25", then the following special file names would be used
to format low and high density floppies:
_____________________________________
| DOS Format| UNIX special file name|
|___________|________________________|
| 1.4 MB | /dev/rdsk/f03ht |
| 720 KB | /dev/rdsk/f03dt |
| 1.2 MB | /dev/rdsk/f15ht |
| 360 KB | /dev/rdsk/f15d9t |
|___________|________________________|
In the above special file names, f0 refers to the first
floppy drive, and f1 refers to the second floppy drive.
The -f option suppresses the interactive feature. The -q
(quiet) option is used to suppress information normally
displayed during dosformat, but it does not suppress the
interactive feature. The -v option prompts the user for a
volume label after the diskette has been formatted. The
maximum size of the volume label is 11 characters.
dosls Lists DOS directories and files in a UNIX system style format
[see ls(1)].
dosrm Removes DOS files.
dosmkdir Creates DOS directories.
dosrmdir Deletes DOS directories.
The file and directory arguments for DOS files and directories have the
form:
device:name
where device is a UNIX system path name for the special device file
containing the DOS disk, and name is a path name to a file or directory
on the DOS disk. The two components are separated by a colon (:). For
example, the argument:
/dev/rdsk/f0t:/src/file.c
specifies the DOS file file.asm in the directory /src on diskette
/dev/rdsk/fd0t. Note that slashes (and not backslashes) are used as file
name separators for DOS path names. Arguments without a device: are
assumed to be UNIX files.
Page 2 10/89
dos(1) Base System(i386) dos(1)
For convenience, the user-configurable default file /etc/default/msdos
can define DOS drive names to be used in place of the special device file
path names. It may contain the following lines:
A=/dev/rdsk/f0t
C=/dev/rdsk/0s5
D=/dev/rdsk/1s5
The drive letter A may be used in place of special device file path name
/dev/rdsk/f0t when referencing DOS files (see ``Examples'' below). The
drive letter C or D refer to the DOS partition on the first or second
hard disk.
The commands operate on the following types of disks:
DOS partitions on a hard disk
5-1/4 inch DOS
3-1/2 inch DOS
8, 9, 15, or 18 sectors per track
40 tracks per side
1 or 2 sides
DOS versions 1.0, 2.0, or 3.0
In the case of doscp, certain name conversions can be performed when
copying a UNIX system file. File names with a base name longer than
eight characters are truncated. Filename extensions (the part of the
name following the separating period) longer than three characters are
truncated. For example, the file 123456789.12345 becomes 12345678.123.
A message informs the user that the name has been changed and the altered
name is displayed. File names containing illegal DOS characters are
stripped when writing to the DOS format. A message informs the user that
characters have been removed and displays the name as written.
All DOS text files use a carriage-return/linefeed combination, CR-LF, to
indicate a newline. UNIX system text files use a single newline LF
character. When the doscat and doscp commands transfer DOS text files to
UNIX system text files, they automatically strip the CR. When text files
are transferred to DOS, the commands insert a CR before each LF
character.
Under some circumstances, the automatic newline conversions do not occur.
The -m option may be used to ensure the newline conversion. The -r
option can be used to override the automatic conversion and force the
command to perform a true byte copy regardless of file type.
EXAMPLES
doscat /dev/rdsk/f0t:tmp/output.1
doscat /tmp/f1 /tmp/f2/A:prog/output.1
dosdir /dev/rdsk/f0t:/prog
dosdir /D:/prog
10/89 Page 3
dos(1) Base System(i386) dos(1)
doscp /mine/file.out/dev/rdsk/f0t:/mine/file.2
doscp /tmp/f1 /tmp/f2 D:
dosformat /dev/rdsk/f0d8dt
dosls /dev/rdsk:/src
dosls B:
dosmkdir /dev/fd0:/usr/docs
dosrm /dev/rdsk:/docs/memo.txt
dosrm /A:/docs/memo1.txt
dosrmdir /dev/rdsk:/usr/docs
FILES
/etc/default/msdos Default information
/dev/rdsk/f0t Floppy disk devices
/dev/rdsk/0s5 Hard disk devices
SEE ALSO
directory(3C) in the Programmer's Reference Manual
See your MS-DOS Documentation.
NOTES
It is not possible to refer to DOS directories with wild card
specifications.
The programs mentioned above cooperate among themselves so no two
programs will access the same DOS disk simultaneously. If a process
attempts to access a device already in use, it displays the error message
Device Busy, and exits with and exit code of 1.
The device argument to dosformat must be specific. For example, use
/dev/rdsk/f03ht not /dev/rdsk/f0t or a:.
The DOS partition hard disk device names correspond as follows:
/dev/dsk/0s5 is equivalent to /dev/hd0d
/dev/rdsk/0s5 is equivalent to /dev/rhd0d
/dev/dsk/1s5 is equivalent to /dev/hd1d
/dev/rdsk/1s5 is equivalent to /dev/rhd1d
All of the DOS utilities leave temporary files in /tmp. These files are
automatically removed when the system is rebooted. They can also be
manually removed.
Page 4 10/89
dos(1) Base System(i386) dos(1)
You must have DOS 3.3 or earlier. Extended DOS partitions are not
supported.
10/89 Page 5