Cls (computing)
From Wikipedia, the free encyclopedia
- The correct title of this article is cls. The initial letter is shown capitalized due to technical restrictions.
cls (for clear screen) is an MS-DOS command used to clear the screen of commands and any output generated by them. It does not clear the user's history of commands, however. In most other environments, like for instance Linux and Unix the same functionality is provided by the clear command.
While the ultimate origins of using the three-character string cls as the command to clear the screen likely predate Microsoft's use, this command was present before its MS-DOS usage, in the embedded ROM BASIC dialects Microsoft wrote for early 8-bit microcomputers (such as TRS-80 Color BASIC), where it served the same purpose. The MS-DOS dialects of BASIC written by Microsoft, BASICA and GW-BASIC, also have the cls command as a BASIC keyword. The cls command is not present in the BASIC versions for Microsoft Windows (such as Visual Basic) where clearing the screen does not make sense because the program's user interface is managed by the operating system while the program runs.
The command cls has appeared as a clear screen command in many other BASIC dialects and command interpreters, because of its familiarity through being included in MS-DOS.