mirror of
https://github.com/jbranchaud/til
synced 2026-01-02 22:58:01 +00:00
Add Capture Screenshot To Clipboard From CLI as a Mac TIL
This commit is contained in:
@@ -10,7 +10,7 @@ pairing with smart people at Hashrocket.
|
||||
|
||||
For a steady stream of TILs, [sign up for my newsletter](https://crafty-builder-6996.ck.page/e169c61186).
|
||||
|
||||
_1663 TILs and counting..._
|
||||
_1664 TILs and counting..._
|
||||
|
||||
See some of the other learning resources I work on:
|
||||
|
||||
@@ -681,6 +681,7 @@ If you've learned something here, support my efforts writing daily TILs by
|
||||
- [Access All Screen And Video Capture Options](mac/access-all-screen-and-video-capture-options.md)
|
||||
- [Access System Information On OS X](mac/access-system-information-on-osx.md)
|
||||
- [Access Unsupported Screen Resolutions With RDM](mac/access-unsupported-screen-resolutions-with-rdm.md)
|
||||
- [Capture Screenshot To Clipboard From CLI](mac/capture-screenshot-to-clipboard-from-cli.md)
|
||||
- [Check Network Quality Stats From The Command Line](mac/check-network-quality-stats-from-the-command-line.md)
|
||||
- [Clean Up Old Homebrew Files](mac/clean-up-old-homebrew-files.md)
|
||||
- [Convert An HEIC Image File To JPG](mac/convert-an-heic-image-file-to-jpg.md)
|
||||
|
||||
27
mac/capture-screenshot-to-clipboard-from-cli.md
Normal file
27
mac/capture-screenshot-to-clipboard-from-cli.md
Normal file
@@ -0,0 +1,27 @@
|
||||
# Capture Screenshoot To Clipboard From CLI
|
||||
|
||||
MacOS comes with a `screencapture` utility that you can run from the terminal
|
||||
to activate the built-in screenshot functionality on Mac.
|
||||
|
||||
Usually when I am taking a screenshot, I want to do something with it right
|
||||
away. Such as paste it into an application or group chat. The `-c` flag forces
|
||||
the screen capture to go the clipboard.
|
||||
|
||||
I also generally want to capture a specific area of the screen so that the
|
||||
captured image includes the right amount of context and nothing more. The `-i`
|
||||
flag puts you in interactive screen capture mode. That means your cursor will
|
||||
turn into a crosshair that you can use to make a drag selection of the capture
|
||||
area.
|
||||
|
||||
```bash
|
||||
$ screencapture -ic
|
||||
```
|
||||
|
||||
Select an area to capture, it's now on your clipboard, paste it where you need
|
||||
it.
|
||||
|
||||
Note: The first time you run this command, your terminal program (e.g. iTerm2)
|
||||
may prompt you for the necessary OS permissions in order to capture images of
|
||||
your screen. You'll need to grant those permissions and then rerun the command.
|
||||
|
||||
See `man screencapture` for more details.
|
||||
Reference in New Issue
Block a user