DIR: long history of a short command
I have entered a DIR command countless times to list files. And once I asked myself - where did it start? Where and when was this specific command invented?
I’ll focus here on a DIR command itself, not on a sheer file listing operation, which can be triggered in many different ways on various systems. The craziest way was on Commodore 64, but I digress.
So I'm using DIR on Powershell for Microsoft Windows 11 in 2025. Obviously, that’s because it has been inherited from the Windows command line, CMD.EXE.
CMD.EXE is a default command line interface for a whole lineup of Microsoft operating systems based on Windows NT technology: Windows 10, Windows 8, Windows 7, Windows Vista, Windows XP, Windows 2000 and Windows NT, whose first version was NT 3.1, released in 1993 - 32 years ago. NT stands for New Technology. New technology, indeed...
But since it had been called New Technology then there had to be some Older Technology, right? Was there a command for listing the files there? Well, yes and no. The direct predecessor of Windows NT 3.1 was Windows 3.1, but it wasn't a full-blown OS. Instead, Windows 3.1 and its predecessors were graphical environments, running under an existing, text based operating system called MS-DOS (Microsoft Disk Operating System). In order to use the command line, Windows 3.1 users could do two things: exit Windows, which would return it to MS-DOS command prompt or run COMMAND.COM DOS program under Windows. In both cases DIR command worked flawlessly, presenting directory listing. Main difference between DIR in DOS command line and its counterpart on Windows NT - based systems is the limits in file names: only uppercase characters are allowed and maximum filename length was 8 characters plus up to three characters of filename extension, with a dot in between, e.g. FILE.TXT. One more thing - the timestamp of file modification is presented with two second resolution - so the number of seconds is always even. DIR circumvented the issue by not showing seconds at all. Clever.
OK, so we are in the MS-DOS world. Its first version (1.0 - that's not obvious at Microsoft) was released in 1981 - 44 years ago, with DIR command existing in each version. But that's not the beginning of it - the system has been acquired by Bill Gates from Seattle Computer Products in order to resell it to IBM for their upcoming IBM PC machine. The system has been originally called QDOS (Quick and Dirty Operating System - this kind of honesty is no longer present in any product name) and it of course had DIR command from the very beginning, that is 1980 - 45 years ago.
Why was IBM interested in buying an OS from the then unknown MicroSoft company? Because QDOS and hence MS-DOS was very similar to another operating system, vastly popular at the time - and it was much cheaper. The name of that other OS was CP/M (Control Program for Microcomputers - we are entering more and more geeky land of naming here) and was a de facto standard for business users at the time.
CP/M has been created by Gary Kildall, founder of a company called Digital Research. First CP/M had been released in 1974 - 51 years ago and yes, it had DIR command from the very beginning. As with MS-DOS, it listed the files, with 8.3 name convention intact. In early CP/M versions there were no file timestamps available, so there were no dates in a listing. Oh, and there were no directories, just drives, so DIR C: listed all the files on drive C. Yes, drive letter convention, still available in 2025 had been borrowed from CP/M as well.
So was Gary Kildall the inventor of a DIR command? Well, CP/M had been developed on another machine, a pretty massive one actually, called DECsystem-10, working under an operating system called TOPS-10. Surely, Gary had to list the directory contents of that machine many times. And the command for that on TOPS-10 was DIRECTORY, with an ability to be abbreviated as DIR! So another act of let's say inspiration.
TOPS-10 has been introduced in 1970 - 55 years ago and I couldn't find any older system that used DIR command, so that's where my DIR command came from - unknown engineer at DEC have crafted it, not knowing that millions and millions of users will use it every day on machines so incredibly more advanced and powerful. And yet, DIR is still with us. Respect.