Users of Microsoft Windows Vista, Windows 7, Windows 8, Windows 10, and Windows 11 can copy the output of command line commands, such as dir, to the clipboard using the clip command. For example, if you want to copy the output of the dir command to the clipboard, you would type the following:
dir |clip
The above command is the dir command followed by a space and then a pipe character followed the word clip (as in clipboard).
Users not utilizing the versions of Windows mentioned above or have another operating systems cannot access this command.
Related information
- How to print a listing of files in a directory.
- See our clipboard and output definitions for further information and related links on these terms.