cmd.exe - piping into clipboard

Don
Joined
21 Oct 2002
Posts
46,830
Location
Parts Unknown
Never knew that this was possible..

Read it on Spiceworks today.

Say you're in command prompt, you probably already know that you can send output into a file..

IE..

dir /b >files.txt


You can also send the output to clipboard, using this command..

dir /b | clip


That's the pipe command, ie, the key next to Z on the keyboard.

Then you can past into notepad etc, much quicker!
 
Thats pretty nifty!, unfortunately i just know i will continue frustrating myself trying to copy and paste from the window!

also works with powershell :)
 
To copy and paste normally, right click 'mark', select the area, then tap Enter. Now it's on your clipboard.

Another super CMD tip..
Tap F7 to see previously typed commands (in this session), no more cycling through the up/down arrows :)
 
I knew about piping (as using mysql regularly pipe the output of one command into the input of another e.g. piping mysqldump uncompressed backups straight into gzip to compress them without hitting the disk), but didn't know about piping to the clipboard :)
 
Back
Top Bottom