[#]: subject: "Navigate your FreeDOS system" [#]: via: "https://opensource.com/article/21/2/freedos-dir" [#]: author: "Kevin O'Brien https://opensource.com/users/ahuka" [#]: collector: "lkxed" [#]: translator: " " [#]: reviewer: " " [#]: publisher: " " [#]: url: " " Navigate your FreeDOS system ====== Master the DIR command to navigate your way around FreeDOS. ![A map with a route highlighted][1] [FreeDOS][2] is an open source implementation of DOS. It's not a remix of Linux, and it is compatible with the operating system that introduced many people to personal computing. This makes it an important resource for running legacy applications, playing retro games, updating firmware on motherboards, and experiencing a little bit of living computer history. In this article, I'll look at some of the essential commands used to navigate a FreeDOS system. ### Change your current directory with CD When you first boot FreeDOS, you're "in" the root directory, which is called `C:\`. This represents the foundation of your filesystem, specifically the system hard drive. It's labeled with a `C` because, back in the old days of MS-DOS and PC-DOS, there were always `A` and `B` floppy drives, making the physical hard drive the third drive by default. The convention has been retained to this day in FreeDOS and the operating system that grew out of MS-DOS, Windows. There are many reasons not to work exclusively in your root directory. First of all, there are limitations to the FAT filesystem that would make that impractical at scale. Secondly, it would make for a very poorly organized filesystem. So it's common to make new directories (or "folders," as we often refer to them) to help keep your work tidy. To access these files easily, it's convenient to change your working directory. The FreeDOS `CD` command changes your current working subdirectory to another subdirectory. Imagine a computer with the following directory structure: ``` C:\ \LETTERS\ \LOVE\ \BUSINESS\ \DND\ \MEMOS\ \SCHOOL\ ``` You start in the `C:\` directory, so to navigate to your love letter directory, you can use `CD` : ``` C:\>CD \LETTERS\LOVE\ ``` To navigate to your `\LETTERS\BUSINESS` directory, you must specify the path to your business letters from a common fixed point on your filesystem. The most reliable starting location is `C:\`, because it's where *everything* on your computer is stored. ``` C:\LETTERS\LOVE\>CD C:\LETTERS\BUSINESS ``` #### Navigating with dots There's a useful shortcut for navigating your FreeDOS system, which takes the form of dots. Two dots (`..` ) tell FreeDOS you want to move "back" or "down" in your directory tree. For instance, the `LETTERS` directory in this example system contains one subdirectory called `LOVE` and another called `BUSINESS`. If you're in `LOVE` currently, and you want to step back and change over to `BUSINESS`, you can just use two dots to represent that move: ``` C:\LETTERS\LOVE\>CD ..\BUSINESS C:\LETTERS\BUSINESS\> ``` To get all the way back to your root directory, just use the right number of dots: ``` C:\LETTERS\BUSINESS\: CD ..\.. C:\> ``` #### Navigational shortcuts There are some shortcuts for navigating directories, too. To get back to the root directory from wherever you are: ``` C:\LETTERS\BUSINESS\>CD \ C:\> ``` ### List directory contents with DIR The `DIR` command displays the contents of a subdirectory, but it can also function as a search command. This is one of the most used commands in FreeDOS, and learning to use it properly is a great time saver. `DIR` displays the contents of the current working subdirectory, and with an optional path argument, it displays the contents of some other subdirectory: ``` C:\LETTERS\BUSINESS\>DIR MTG_CARD TXT 1344 12-29-2020 3:06p NON TXT 381 12-31-2020 8:12p SOMUCHFO TXT 889 12-31-2020 9:36p TEST BAT 32 01-03-2021 10:34a ``` #### Attributes With a special attribute argument, you can use `DIR` to find and filter out certain kinds of files. There are 10 attributes you can specify: | - | - | | :- | :- | | H | Hidden | | -H | Not hidden | | S | System | | -S | Not system | | A | Archivable files | | -A | Already archived files | | R | Read-only files | | -R | Not read-only (i.e., editable and deletable) files | | D | Directories only, no files | | -D | Files only, no directories | These special designators are denoted with `/A:` followed by the attribute letter. You can enter as many attributes as you like, in order, without leaving a space between them. For instance, to view only hidden directories: ``` C:\MEMOS\>DIR /A:HD .OBSCURE