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