Skip to content
Supporting clients since 2024 · 15 years of IT experience
Docs menuSnippets: saved commands with variables

Snippets: saved commands with variables

Save the commands you type every week, with {placeholders} you fill in when you run them. Run a snippet in the current terminal, in several at once, or on hosts with no terminal open.

Updated · Describes CybexConnect 1.3.2

Open Snippets and click New snippet, or Add examples to start from a few common ones (restart a service, tail a log, disk usage, biggest folders, listening ports).

Variables#

Write a variable as a name in braces. When you run the snippet, each one gets a box to fill in, pre-filled with its default if you set one.

Snippet
sudo tail -n {lines} -f {file}
WrittenTreated as
{service}A variable called service.
${HOME}Shell syntax, sent as is. A $ before the brace means it's not a variable.
{a,b}Shell brace expansion, sent as is.

Names start with a letter or underscore and can contain letters, digits, _ and -. A snippet won't run while a variable is still empty, so a half-filled command never reaches a server.

Running a snippet#

In terminal
Sends it to the current terminal and switches to it.
Run in several terminals
Pick open terminals and send it to all of them at once.
Broadcast
Runs it on hosts you pick without opening terminals, and shows each host's output side by side. Broadcast
Copy command
Puts the filled-in command on the clipboard.

You can also open snippets beside any terminal from its toolbar. Snippets can be filed in folders, and each one remembers how often and how recently it was run. They sync to your other PCs with everything else.

Still stuck?

Tell us what you tried and what you saw. The people who build CybexConnect answer support requests.