In this lesson you will need a formatted,
empty, not write protected floppy disk.
mtools is a collection of commands to manage data on floppies
(comparable with the MS-DOS commands: COPY, DEL, DIR, etc.)
Insert a formatted, empty and not write protected floppy in the floppy
disk drive.
Open a root shell:
Click at the Knoppix-KDE-Desktop at the bottom left with the left mouse button on the symbol with character "K" in a gear (this is comparable with the <Start> icon in Windows 98/NT/XP...). |
Click in the menu that opened with the left mouse button at the entry "KNOPPIX". |
Click in the sub menu that opened at the entry "Root Shell". A "Root" window opens. |
In the root shell window you can give mtool commands with your
keyboard.
Some examples:
Explanation of the examples:
mformat a: | Format the floppy that is in drive A: All data at the floppy is lost! |
Copy the file date from directory /bin onto the floppy in drive A: | |
mdir a: | Show the files that are on the floppy in drive A: |
Copy the file excursion.jpg from the floppy in drive A: to the directory /home/knoppix. | |
Delete the file excursion.jpg from the floppy in drive A: | |
Copy the file readme.txt from the floppy in drive A: to the
file with new name README in the directory /tmp. Because of the -t option, all CRLF (carriage return / line feed) character pairs that are used in MS-DOS files are transformed into a single LF character as used in Unix (see also the Excursion below). |
|
Copies the file motd (message of the day) from the directory
/etc onto the floppy in drive A: under the new name motd.txt Because of the -t option, all single LF character as used in Unix files are transformed into CRLF (carriage return / line feed) character pairs that are used in MS-DOS (see also the Excursion below). |
Rules of thumb:
Further information can be found in the manual pages of mtools, that
you can call using the commands "man mtools", "man mcopy",
"man mdel" in a command window, (e.g. --> --> ). (Where you can
use the space bar to turn a page and the "q"
key to quit reading the manual page.)
[Back to the beginning of the page]
Excursion: Files under windows and
UNIX: Two worlds collide!
Are you so old that you remember and used the mechanical typewriter?
Maybe you still have one on your attic somewhere...
With such a mechanical typewriter, when you are at the end of the
line, you had to pull a lever. Two things happened then mechanically.
In two to three rattles the paper was transported up one or more lines
(the line feed or LF) and then you pulled the lever through from the
far right to the left and returned the carriage with the paper (the
carriage return or CR).
In your PC and on your hard disk the characters of a text line are
stored in ASCI encoded characters in successive bytes. To indicate the
end of the line it is necessary to mark this in some way or another.
The first computer "screens" were no more than electromechanical
controlled typewriters or TELEX terminals, so they had something like
the carriage return / linefeed mechanism of the old typewriters in
them.
These mechanisms were controlled by the ASCI characters CR and LF. The
MS_DOS and later on Windows developers simply used these ASCI
characters to indicate the end of text lines in their text files. For
instance if you type in Notepad under Windows the string abc
<enter> def, then internally in the file the ASCI characters
"abcCRLFdef" are stored. And when Notepad reads this it displays:
abc
def
The editor interprets the CRLF characters as indication that it has to
start on the beginning of a new line. That 's the way it should be.
The UNIX developers (at the university of Berkeley) decided that
actually
only one character would do, as they always come in pairs, and moreover
the electronics of the computer screens can handle this command
perfectly on their own. So in Unix/Linux only the LF character is used.
When vi / gvim reads the ASCI string "abcLFdef" then this shows
correctly as:
abc
def
The big fuzz starts when you directly want to edit Linux text files
under Windows or vice versa. When Notepad under Windows read the
ASCI string: "abcLFdefLFghi" then it shows as:
abcIt still only does the linefeed and not the carriage return, so the next line does not start at the beginning of the line.
def
ghi
[Back to the beginning of the page]