Save the macOS clipboard to a file
Build a paste-ready command, then review its compatibility and effects before running it.
Complete required fields to copy the generated command.
Compatibility
macOSVerified for macOS using zsh, bash syntax.
Operational knowledgereview due 2027-01-19
Requirementspbpastepbpaste must be installed and available on PATH.
Version supportpbpaste Current supported releasesVerified for macos using zsh, bash syntax; consult compatibility notes for platform-specific differences.
Expected signals(no output on success)Representative successful output; values vary with the selected target and system state.
Known errorspbpaste: command not foundpbpaste is missing or is not available on PATH.
Verifypbpaste > {{file}}Re-run the corresponding read-only inspection and confirm the intended state.Rollback noteNo universal automatic rollback is available. Capture the current state and use the tool-specific recovery procedure before applying changes.
Command breakdown
01pbpasteClipboard readerWrites the current macOS pasteboard contents to standard output.
02>Output redirectionWrites the command output into the following file, replacing it if present.
03clipboard.txtDestination fileNames the file that will receive the clipboard contents.
Example input
pbpaste > clipboard.txt
Example output
(no output on success)
Created or replaced: clipboard.txt
Illustrative output — exact values vary by system and data.
Official sources