| name | c-clipboard |
| description | System clipboard — copy, paste, transform content between clipboard and files. |
| tags | ["clipboard","copy","paste","pbcopy","pbpaste"] |
Clipboard — Copy & Paste
Read from and write to the system clipboard. Built into macOS, no install needed.
Commands
pbpaste
echo "hello world" | pbcopy
pbcopy < /path/to/file.txt
pbpaste > /path/to/output.txt
ls -la | pbcopy
date | pbcopy
pbpaste | tr '[:lower:]' '[:upper:]' | pbcopy
pbpaste | sort | pbcopy
pbpaste | wc -w
printf "%s" "exact text" | pbcopy
Linux Equivalents
xclip -selection clipboard
xclip -selection clipboard -o
Guidelines
- When the user says "copy this" or "put this in my clipboard", use
pbcopy
- When the user says "what's in my clipboard?" or "paste", use
pbpaste
- For transformations, pipe
pbpaste through the transform and back to pbcopy
- Always confirm what was copied with a brief summary
- Never display clipboard contents unless asked — they may contain sensitive data