FreeDOS commands for Linux users
If you are familiar with Linux, try these commands to get started on FreeDOS.
DOS has always been a command line experience.
For example, you use commands like CD and DIR to navigate your DOS system and
explore files.
Linux (and other Unix systems) also have a command line experience. But the commands on FreeDOS are not quite the same as the Linux commands. If you're already familiar with Linux, try these commands to get started with FreeDOS.
Note that DOS is case insensitive; you can write these commands in all uppercase, all lowercase, or with mixed case. I'll use all uppercase because that is a more typical style to write DOS commands.
Navigate directories (cd)
Use the CD (change directory) command to navigate your DOS filesystem.
Like Linux, CD can go up or down a directory hierarchy, such as this command to
change "into" a directory called FILES:
CD FILES
If you want to "back out" of a directory, you can use the .. special directory
name, which always indicates the "parent" directory:
CD ..
List files (ls)
To see what's in the current directory, use the DIR (directory) command, which
is similar to the Linux ls command.
By default, this prints some additional information about the disk before and
after the file listing.
If you want to turn this off, add the /B (bare) option to the DIR command:
D:\DOCS>dir /B
ARS.DOC
SAMPLE.DOC
SHAREW.DOC
WORDPERF.DOC
If you prefer to view files in all lowercase, use the /L (lowercase) option:
D:\DOCS>dir /B /L
ars.doc
sample.doc
sharew.doc
wordperf.doc
If you don't like the vertical listing, you can also list the files in a wide
display using the /W option:
D:\DOCS>dir /B /L /W
ars.doc sample.doc sharew.doc wordperf.doc
View files (cat and less)
To view the contents of a file, use the TYPE command.
This is similar to the cat command on Linux systems.
TYPE displays the contents of a file to the standard output, which is usually
the screen.
DOS displays are usually 25 lines long, unless you've changed it to some higher
number of lines.
If your file is more than 24 lines long, you won't be able to see the top of
your file before it scrolls off the top of the screen.
To view a text file one "screenful" at a time, use the MORE command instead,
which is similar to the more or less commands on Linux.
Redirection
By default, command line programs usually print to the standard output and read
from standard input.
But you can use redirection like > to save the output to a file.
For example, to save a directory list as a file, type this:
DIR *.DOC /B /L > FILE.LST
That saves the output of the DIR command to the new file FILE.LST.
You can also use redirection to send the output of one program to another, such
as to use MORE to view any long output.
Let's say the program MYLINT generates a lot of output that you want to view.
You can send the output to the MORE program like this:
MYLINT | MORE
Other commands
FreeDOS also provides several programs that work like the Unix command line.
Run the FDIMPLES package manager to view the packages that you can install from
the Unix Like Utilities from the BonusCD.
This includes a variety of commands you may find familiar as a Linux user,
including cal, du, bc, sed, grep, head, less, and md5sum.