Friday, June 29, 2018

FreeDOS commands quick-reference

FreeDOS turns 24 years old today (June 29)! That's a long time for any open source software project. Thanks to our FreeDOS community for keeping things going. And a special "thank you" to our developers, who continue to add new features and fix old bugs. You truly make FreeDOS better!

To celebrate this year's anniversary, I wrote a "quick reference" for our new users. This reference shows the most common FreeDOS commands, including a few important notes for new users.

You may also want to check out the free ebook we published last year: 23 Years of FreeDOS.

What do you want to do?How to do it on FreeDOS:
List directory contentsDIR
-in the directory “above”DIR ..
-in a different directoryDIR C:\FDOS\BIN
Change the current driveD:
Change the current directoryCD \FDOS\BIN
-“up” one directoryCD ..
Display the contents of a fileTYPE FILE.TXT
-one screen at a timeMORE FILE.TXT
Copy a fileCOPY FILE.TXT NEW.TXT
Delete a fileDEL FILE.TXT
Copy a directory and its contentsXCOPY DIR NEWDIR
Delete a directory and its contentsDELTREE MYFILES
Create a new directoryMKDIR NEWDIR
Remove an empty directoryRMDIR MYFILES
Rename a file or directoryREN FILE.TXT FILE.OLD
Show all lines in a file that contain “HelloFIND "Hello" FILE.TXT
-without regard for caseFIND /I "Hello" FILE.TXT
Clear the screenCLS
Edit a text fileEDIT FILE.TXT
View and set the dateDATE
View and set the timeTIME
Show the usage for a programDIR /? (for most programs)
Get systemwide helpHELP
Show the command historyHISTORY
Show the DOS versionVER

A few things to remember:
  • DOS commands and filenames can be upper or lowercase (DIR is the same as dir)
  • Pipes (|) are the same on DOS as on Linux
  • Output redirection (>) is the same too
  • . and .. are the same on DOS as on Linux
  • The directory separator is \ (such as C:\ or C:\FDOS or C:\FDOS\BIN)
  • File and directory names can only be 8.3 characters long (such as FILENAME.EXT)
  • DOS uses letters for each drive (C: is the first hard drive)
  • A full path is a drive letter and a directory path

Looking for more? I wrote a full FreeDOS cheat sheet for OpenSource, which you can find here: Celebrating 24 years of FreeDOS: Useful commands cheat sheet.