Snippets are saved commands that you can:
Run with a single click or tap, while in the terminal.
Auto-run right after connecting to a host.
On mobile, run snippets on several hosts at once.
Before a snippet can be used, it must be added on the Snippets screen.
Snippets are a premium feature.
Navigate to the Snippets screen.
Click + New at the top.
In the Label field, specify an optional name for the snippet.
In the Script field, add a command(s) that will be executed.
Click Save. The snippet will appear on the Snippets screen.
Navigate to the Snippets screen.
Tap + at the top and choose New Shell Snippet.
In the Name field, specify an optional name for the snippet.
In the Script field, add a command(s) that will be executed.
Tap Save. The snippet will appear on the Snippets screen.
Do not use \n
in a snippet as it will not have an effect.
It will be treated as two separate characters and not an escape sequence. For specifying several commands in a snippet, add each one of them on a new line.
If it’s Bash that runs on a remote host, you can use &&
or ;
to specify more than one command on a new line.
In the terminal, press Cmd + S (on Mac OS) or Ctrl + S (on Windows / Linux) to open the snippet picker panel.
Choose one of the following:
To run a snippet, click Run next to it.
To insert a snippet, but not run, click Paste next to it.
☝ You can resize the snippets panel by dragging its edge to the left.
In the terminal, tap {} above the keyboard.
If you don’t want run the snippet, but rather insert its contents into the terminal, uncheck Run snippet immediately.
Tap a snippet you would like to execute.
To make a snippet automatically run when you connect to a host, specify the snippet as Startup Snippet in the properties of your host.
Navigate to the Snippets screen.
Tap a snippet.
Choose one of the following:
To run the snippet on hosts that are not currently running:
Select the hosts.
If you’d like to disconnect from the host once the snippet is executed, uncheck Close sessions after running.
Tap Run <snippet name>.
To run the snippet on hosts that are currently running:
Switch to the Terminals tab.
Select the hosts (terminals).
Tap Run <snippet name>.
Snippets are powerful. There are many commands that you may run on a day-to-day basis that are either cumbersome to type (especially on a mobile device) or require command line switches you may not remember. Instead of constantly searching or referencing a sheet for these things, snippets allow you to store this knowledge and save time in your daily server tasks.
To help get you started, we've created a few for you to use:
find -type f -mtime -30
find -type f -mtime -30 -exec
The -exec
at the end allows you to specify a command. This snippet is intended to be run without pressing enter so that you can type the command to run on those matching files.
du -ch
netstat -tolpn
sudo dmesg
ps auxw
ps aux | grep
This snippet is meant to be run without pressing enter. After using the snippet, type the name of the program you are searching for (i.e. "apache2"), and the process list will be searched for this name.