Zum Hauptinhalt springen
Echtzeit-Radar & Feeds
Alle RSS Feeds ➔
👥 Community & Social
Windows Tipps & SecurityGrafikkarte vor Überhitzung schützen: So geht’s(25.09.2026 um 08:00 Uhr)
••••••••••
Windows Tipps & SecurityGrafikkarte vor Überhitzung schützen: So geht’s(25.09.2026 um 08:00 Uhr)
••••••••••
Intelligence View
⚡ tsecurity.de Intelligence

Caffeinate your Mac to prevent it from sleeping

Originally posted on my blog. TL;DR I'll show you how to use macOS's built-in caffeinate command to keep your Mac awake: until you stop it for a set amount of time, or only while a long-running command is executing No…

0
↗ Quelle (dev.to)
Reagiere als Erste:r — dein Feedback zählt!

Originally posted on my blog.






TL;DR



I'll show you how to use macOS's built-in caffeinate command to keep your Mac awake:




  • until you stop it


  • for a set amount of time, or

  • only while a long-running command is executing



No additional apps that you need to install, no menu bar junk, no "why is my Mac sleeping again?!" drama.






Why you'd care about caffeinate



If you've ever kicked off a long download, rsync backup, Docker build, video export, or "I'll just run this migration quickly" job… and then came back to find your Mac politely sleeping like an innocent kitten — you already know why this matters.



macOS has an official tool for this, and it's been sitting right under your nose:




caffeinate






It's basically the Terminal equivalent of "No, macOS, we are not done here."






Option #0: The simplest possible usage



Open Terminal and run:




caffeinate






That's it. Your Mac won't go idle-sleep as long as this process is running.



To stop it press Ctrl + C






Option #1: Keep the Mac awake for a fixed amount of time



Sometimes you just want to keep your Mac awake for 2 hours (and keep that Slack icon 🟢 hey, I don't judge), and then you'd pass in the -t parameter (which indicates seconds):




caffeinate -t 7200






That's 2 hours (60 _ 60 _ 2 = 7200). Yes, we still count seconds like it's 1999.



A few common ones:




  • 30 minutes: 1800

  • 1 hour: 3600

  • 2 hours: 7200

  • 4 hours: 14400






Option #2: Keep the display awake as well



If for some reason you want to prevent your display from dimming, use the -d switch:




caffeinate -d









Option #3: The best trick — keep Mac awake only while a command runs



This is the chef's kiss use case; instead of running caffeinate separately, wrap your long-running command with it:




caffeinate -i your_command_here






Example: big rsync backup:




caffeinate -i rsync -av ~/Pictures/ /Volumes/Backup/Pictures/






Example: long npm build:




caffeinate -i npm run build






Example: running tests that take forever because you're "testing thoroughly" (and definitely not because of that one integration suite):




caffeinate -i ./run-tests.sh






When your command finishes, caffeinate stops automatically. No cleanup required. No "wait, did I leave it running overnight?" paranoia.






Option #4: Run caffeinate in the background



If you want to keep your Terminal usable:




caffeinate -d -i &






That & sends it to the background.



Want to see it?




ps aux | grep caffeinate






Want to stop it?



Option A: bring it back to foreground and stop:




fg






then hit Ctrl + C



Option B: kill it by PID (you'll see PID in the ps output):




kill <PID>









Handy flag cheat sheet



Here's the "print this on a sticky note" version:




  • Keep system awake until stopped:




  caffeinate







  • Keep awake for 1 hour:




  caffeinate -t 3600







  • Keep display awake:




  caffeinate -d







  • Keep awake while a command runs:




  caffeinate -i <command>







  • Display + system, background:




  caffeinate -d -i &









Bonus: a tiny alias (because typing is hard)



If you find yourself using it often, add this to your ~/.zshrc (or ~/.bashrc):




alias awake='caffeinate -d -i'






Reload:




source ~/.zshrc






Now you can do:




awake rsync -av ~/Stuff/ /Volumes/Backup/Stuff/






And voilà — your Mac stays awake, your command runs, and you look like you totally planned it this way.



Hope this was useful, and see you next time 💪

1. Sofort-Triage & Abwehrmaßnahmen

SOC Incident Playbook: Remote Code Execution (RCE) Defense
Syntax validiert (0 Fehler)
title: Detect Exploitation - Caffeinate your Mac to prevent it from sleeping
id: 28f3d652-087e-4be1-ba05-ce1d7f37c97c
status: experimental
description: Automatisch generierte SIEM-Erkennungsregel basierend auf CTI Intelligence
references:
  - https://tsecurity.de/
author: iShareStuff CTI Automated Detection Engine
date: 2026-09-26
logsource:
  category: network_connection
  product: any
detection:
  selection:
      CommandLine|contains:
        - 'exploit'
  condition: selection
falsepositives:
  - Legitime administrative Zugriffe oder Penetrationstests
level: high
tags:
  - attack.initial_access
Syntax validiert (0 Fehler)
rule CTI_Threat_Indicator {
    meta:
        author = "iShareStuff CTI Automated Detection Engine"
        date = "2026-09-26"
        description = "YARA Signature for "
    strings:
        $str = "Caffeinate your Mac to prevent" ascii wide
    condition:
        any of them
}
Syntax validiert (0 Fehler)
index=security sourcetype IN ("cisco:asa", "pan:traffic", "zeek_conn", "suricata", "WinEventLog:Security")
("Caffeinate your Mac to prevent it from s")
| stats count earliest(_time) as first_seen latest(_time) as last_seen by src_ip, dest_ip, dest_host, signature
| eval first_seen=strftime(first_seen, "%Y-%m-%d %H:%M:%S"), last_seen=strftime(last_seen, "%Y-%m-%d %H:%M:%S")
| sort - count
Syntax validiert (0 Fehler)
message: "*Caffeinate your Mac to prevent it from s*"
Syntax validiert (0 Fehler)
CommonSecurityLog
| where Message has "Caffeinate your Mac to prevent it from s"
| summarize EventCount = count(), FirstSeen = min(TimeGenerated), LastSeen = max(TimeGenerated) by SourceIP, DestinationIP, DestinationPort, Activity
| extend DetectionRule = "iShareStuff-CTI-Compiled"
| sort by EventCount desc

2. Cyber Threat Intelligence & Forensik

🎯
MITRE ATT&CK Matrix Navigator 14 Taktiken
Reconnaissance
-
Resource Development
-
Initial Access
Execution
Persistence
-
Privilege Escalation
Defense Evasion
Credential Access
-
Discovery
-
Lateral Movement
-
Collection
-
Command and Control
Exfiltration
-
Impact
tsecurity.de Cognitive Threat RAG
Fokus-Vektor:

Kognitive Analyse für identifizierte Bedrohung: Erhöhte Bedrohungslage im Bereich Caffeinate your Mac to prevent it from s.... Basierend auf 368k Vektor-Korrelationen werden sofortige Isolationsmaßnahmen für betroffene Endpunkte empfohlen.

🛡️ Angriffsfläche & Exposure

Netzwerk/Remote-Zugriff ohne Vorauthentifizierung möglich.

⚡ Empfohlene Sofortmaßnahmen
  • 1. Perimeter-Inspektion: Relevante Portfreigaben und exponierte Endpunkte unverzüglich scannen.
  • 2. Patch-Applikation: Hersteller-Hotfix einspielen oder betroffene Daemons in isolierte DMZ-Segmente überführen.
  • 3. Telemetrie & EDR-Alerts: Prozessaufrufe und Child-Processes auf anomale Shell-Spawns überwachen.
🔗 Semantisch verwandte Zero-Days MariaDB 11.7 VEC
Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten Caffeinate your Mac to prevent it from sleeping

Thematisch verwandte Begriffe: Caffeinate, your, prevent, from · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Zum Aktualisieren ziehen
ZERO-DAY CVE-2026-100618 | Capgo (capgo.app) is affected by an authorization flaw in the app icon …
Advisory →
tsecurity.de Icon
Offline-Lesen, Eilmeldungen & 0ms Ladezeit

Installiere tsecurity.de direkt auf deinen Home-Bildschirm für das ultimative Vollbild-Magazinerlebnis ohne Browser-Leisten.

Nächster Beitrag