08.Scripts & Batch Commands

wxterm Last Updated: 2026-10-21 10:53 Views: 36

08 Scripts & Batch Commands

WxTerm provides terminal operation recording & playback and batch command sending features, convenient for automated operations.

8.1 Terminal Script Recording

Script recording records all terminal input (keyboard keys) and time intervals, saving them as replayable script files.

Start Recording

  • Menu “Tools → Script → Start Recording”.

After starting recording:

  • The “Start Recording” menu item becomes disabled; “Stop Recording” and “Cancel Recording” become available.
  • The status bar shows no obvious marker (to avoid interfering with operations), but all keyboard input is recorded.

Stop Recording

  • Menu “Tools → Script → Stop Recording”.
  • A save dialog appears; select the save location and file name.
  • The script is saved to the scripts subdirectory under the configuration directory (configuration directory location see 01 Getting Started & UI Overview).

Cancel Recording

  • Menu “Tools → Script → Cancel Recording”.
  • Discards the recorded content without saving.

Script recording feature is not available in the Free version; available in Trial and above.

8.2 Script Playback

Plays back a recorded script in the current terminal, automatically replaying keyboard input and time intervals.

Run a Script

  • Menu “Tools → Script → Run Script”.
  • In the script manager that appears, select a script.
  • Click “Run” to start playback in the currently active terminal.

Stop Playback

  • Menu “Tools → Script → Stop Script”.
  • During playback, the “Run Script” menu is disabled; “Stop Script” is available.

Playback Notes

  • Playback executes in the currently active tab’s terminal; switch to the target terminal first.
  • Playback sends keys at the recorded time intervals; the speed multiplier can be adjusted in the script manager.
  • Do not manually operate the terminal during playback to avoid interference.
  • Sensitive input such as passwords in the script will also be replayed as-is; please sanitize before sharing scripts.

8.3 Script Manager

The script manager lists all scripts under the scripts subdirectory of the configuration directory (configuration directory location see 01 Getting Started & UI Overview).

Script manager

Features

  • Run: play back the selected script in the current terminal.
  • Delete: delete the script file.
  • Rename: rename the script.
  • Refresh: reload the script list.

8.4 Batch Send Command (Send Command)

Batch send command allows sending one command to multiple sessions/tabs simultaneously, convenient for executing the same operation across multiple hosts.

How to open

  • Menu “Tools → Send Command”.
  • Tab right-click → “Send Command”.

Dialog

Send command

Field Description
Command text The command content to send
Send to all sessions When checked, sends to all currently open tabs; when unchecked, sends only to the currently active tab
Append newline When checked, automatically adds a newline at the end of the command (Enter to execute)

Usage Flow

  1. Open multiple session tabs.
  2. Open the send command dialog.
  3. Enter a command (e.g. uptime).
  4. Check “Send to all sessions” and “Append newline”.
  5. Click “Send”.
  6. All target tabs execute the command simultaneously.

Typical Uses

  • View load on multiple servers simultaneously: uptime
  • Batch clean logs: find /var/log -name "*.log" -mtime +30 -delete
  • Batch restart services: systemctl restart nginx
  • Batch check disk: df -h

Batch send command feature is not available in the Free version; available in Trial and above.

8.5 Script and Command Safety Tips

  • Recorded scripts contain sensitive input: passwords, keys, and other input during recording are saved as-is; check and sanitize before sharing scripts.
  • Batch commands are irreversible: commands sent to all sessions execute immediately; confirm the command is safe (especially dangerous commands like rm, reboot).
  • Test in a single session first: for uncertain commands, verify in a single session first, then batch send.
← Previous Article 09.Personalization Next Article → 07.System Management

Comments

No comments yet