Skip to content

Instantly share code, notes, and snippets.

@JCharante
Created January 6, 2024 14:59
Show Gist options
  • Save JCharante/93bb27a6ef5e2f5056d447d6af926484 to your computer and use it in GitHub Desktop.
Save JCharante/93bb27a6ef5e2f5056d447d6af926484 to your computer and use it in GitHub Desktop.

Pipe output to your clipboard

Omg.. for years on linux & then macos I've been doing cat file.txt and then copying it from the terminal into the clipboard.

I just learned on macos you can use pbcopy like so

cat sample.txt | pbcopy to get the file contents directly in your clipboard.

This works for command outputs as well. If you just want the file directly you can run pbcopy < sample.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment