Send Desktop Notifications from the Terminal with notify-send

Use notify-send to pop up a desktop notification when a long command finishes, with optional icons, urgency and timeouts.

Linuxnotify-senddesktopnotificationTerminalLow risk
Run `notify-send "Backup finished" "All files copied successfully"` to pop up a notification on your desktop.

01Command

Command
$ notify-send "Backup finished" "All files copied successfully"

02What it does

notify-send talks to the desktop's notification daemon over D-Bus, so it works on GNOME, KDE, XFCE and any environment that implements the standard. A handy pattern for long jobs is `./long-task.sh; notify-send "Done" "long-task exited $?”` — or add `-u critical` so the popup stays until dismissed. Add `-t 5000` to control how long the popup shows (milliseconds).

03Risk

RiskLow risk
Requirementslibnotify with a notification daemon running: GNOME and KDE have one built in; minimal window managers may need dunst or mako. Icon and urgency options: `notify-send -u critical -i dialog-information "Title" "Body"`.
!Warning: If nothing appears, you are probably in a session without a notification daemon (common on minimal window managers), or running the command over SSH where DISPLAY is not set.

04Undo

✓No undo needed — this command does not change persistent state.

05Sources

  • notify-send(1) - Linux manual page
    Ubuntu Manpages · technical · 2026-09-17
    Evidence: notify-send sends a desktop notification to the notification daemon, with options for summary, body, icon (-i) and urgency level (-u).

Last verified: 2026-09-18 · Category: System & Settings

06Related solutions