LKBEN11630: How to run a command line and copy the output to the clipboard so it can be pasted.


Symptom

You need to make some documentation for command line tools.

Cause

Piping output from the command line to the clipboard is very convenient.

Solution

The output from a command can be piped into the clipboard so it can be uses in an editor or word processor for documentation.

The usage is very easy, everything what can be seen on the screen can be copied to the clipboard by using a pipe into "clip".

The following command will fill the clipboard with the information from ipconfig.

ipconfig | clip

You can now paste this information in to an editor. Please note that your font should be monospaced for a nice output. A monospaced font is a font whose characters each occupy the same amount of horizontal space. Editors and IDE (= integraded development environments) normally use monospaced fonts per default.

Here are some other interesting command:

getmac /v | clip

rem this will put the MAC Address Information into your clipboard

Have fun.

 

Disclaimer:

The information provided in this document is intended for your information only. Lubby makes no claims to the validity of this information. Use of this information is at own risk!

About the Author

Author: Wim Peeters - Keskon GmbH & Co. KG

Wim Peeters is electronics engineer with an additional master in IT and over 30 years of experience, including time spent in support, development, consulting, training and database administration. Wim has worked with SQL Server since version 6.5. He has developed in C/C++, Java and C# on Windows and Linux. He writes knowledge base articles to solve IT problems and publishes them on the Lubby Knowledge Platform.

Latest update: 06/01/2023