Skip to content

Instantly share code, notes, and snippets.

@gbarreiro
Created December 6, 2020 19:05
Show Gist options
  • Save gbarreiro/709230939b009bab28456b3b4fd0908d to your computer and use it in GitHub Desktop.
Save gbarreiro/709230939b009bab28456b3b4fd0908d to your computer and use it in GitHub Desktop.
Bash cheatsheet: clipboard
# Linux
echo "Hello my friend!" | xclip # copy "Hello my friend!" to the clipboard
xclip -o >> pasted_text.txt # paste the content of the clipboard into a text file
# macOS
echo "Hello my friend!" | pbcopy # copy "Hello my friend!" to the clipboard
pbpaste >> pasted_text.txt # paste the content of the clipboard into a text file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment