Having pbcopy and pbpaste in Cygwin

Just add these 2 lines in your .bashrc

alias pbcopy="cat >/dev/clipboard"
alias pbpaste="cat /dev/clipboard"

We can now copy text into clipboard by piping it to pbcopy

# Copy current path
pwd | pbcopy

# Copy current datetime
date | pbcopy

And paste it from clipboard by pbpaste

# Paste it to new file
pbpaste > path.txt

# Paste it to terminal
pbpaste

 

 

dicksonkho

 

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.