Tuesday, March 24, 2020

Navigating FreeDOS - FreeDOS for Linux users

If you've come to FreeDOS via Linux, you may be slightly confused about some of the commands in FreeDOS. In this quick guide, I'll provide a few "translations" to help Linux users quickly adapt to FreeDOS.

On Linux, you use the ls command to display a list of files in a directory. To get details of each file in the list, you use the ls -l command, where -l provides a long version of the output.

On FreeDOS, use the DIR command. That's very similar to ls -l. To get something similar to the plain ls command, give DIR a few options to put it into "bare" mode (/B) with lowercase letters (/L) using a wide display (/W). By default, DIR does not sort the output, so you'll need to instruct DIR to order the output (/O…) by grouping directories first (G) then sorting by base filename (N) and extension (E).

And we can create an alias for this using the built-in FreeDOS ALIAS command:

On Linux, to change to new directories and paths, you use the cd command. It's the same under FreeDOS.

On Linux, you use mkdir and rmdir to create and delete directories. These commands also exist on FreeDOS.

On Linux, to display a file, you use cat. On FreeDOS, you need to use a different command, TYPE. The usage is basically the same:
TYPE filename.txt

(Note that Linux Bash has a completely different type command.)

On Linux, you can send the output of cat into more or less to display the contents one screenful at a time. The same idea exists under FreeDOS. You can use the vertical bar as a "pipe" to different commands.
TYPE filename.txt | MORE

And you can direct output into a file using the greater-than symbol, the same as on Linux:
TYPE filename.txt > newfile.txt

I hope this helps our Linux users get started on FreeDOS.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.