XEmacs Java Linux Commands KDE Email man Pages Printing Home



CS1 Environment: Basic DOS Disk Commands


Mtools

MS-DOS files can be manipulated on Linux systems by using a set of tools called Mtools. The following is a list of basic commands you may need to use:

Listing Files
Copying files
Deleting files
Displaying files
Formatting a disk
Changing directories
Creating directories
Renaming files or directories
Removing directories


Listing files

To view a list of files on your DOS disk, you can use the mdir command:

mdir

You could, if you wished, specificy a directory:

mdir mydir

This would give you a list of the files in the 'mydir' directory on your DOS disk.


Copying files

You can copy a file from your home directory to your DOS disk by using the command:

mcopy filename a:

Or you can copy the file and change the filename (within the DOS restriction of eight characters followed by a three-character extension) with:

mcopy filename a:filename

To copy a file from your DOS disk to your current directory and change the filename use the command:

mcopy a:filename filename

Or you can keep the same filename and place the file in your current directory with:

mcopy a:filename .

N.B. The period in the above command indicates your current Linux directory.


Deleting files

You can delete a file on your DOS disk with the command:

mdel filename


Displaying files

You can display the contents of a plain-text file on your DOS disk with the command:

mtype filename

If the file is longer than a screenful, you can display it one screen at a time by piping the output:

mtype filename | less


Formatting a disk

If you want to format a DOS disk, you should do it on a DOS system for best results. You can then use your DOS-formatted floppy in the drive on your workstation. You should format the disk as a 1.44MB high density DOS disk.


Changing directories

It is also easy to navigate directories on the floppy disk, for instance:

mcd mydir

mcd ..

The first command above, changes to a directory in the floppy's current directory called 'mydir'.

The second command above changes "out of" the current directory on the floppy.


Creating directories

The mmd command is used to create a directory, for example:

mmd home

This will create a directory called 'home' on your DOS disk and....

mmd /home/user

this will create a subdirectory in 'home' called 'user'.


Renaming files or directories

The mmove command is used to move or rename an existing DOS file or directory, for example:

mmove user user1

Will rename the directory 'user' to 'user1'

mmove /home/user ..

Will move the subdirectory user out of the current directory 'home'.


Removing directories

The mrd command removes a directory, for example:

mrd user

Will remove the directory 'user' from the DOS disk.






Kathleen McLean
Last modified: Tue Sep 21 14:32:34 BST 1999