Skip to content

[Linux] viddy: An Enhanced Version of the Watch Command

Last Updated on 2024-09-26 by Clay

Introduction

viddy is a tool similar to watch for running a command at regular intervals in a Linux terminal and displaying the output.

However, compared to watch, viddy offers a more polished interface, supports colored output, scrolling, querying, and history. I have now almost completely replaced watch with viddy.


Installation

On most Linux distributions, you can install it as follows:

  1. Install with Cargo (Rust’s package manager): If Rust is already installed on your system, you can install viddy with Cargo: cargo install viddy
  2. Manual Download: You can download the binary from the official GitHub page and manually add it to your system’s PATH.

Basic Usage

viddy follows a syntax similar to watch:

viddy "<COMMANDS>"

Key Features

  1. Run commands periodically: viddy will run the specified command at the default interval (2 seconds).
  2. Scrollable interface: viddy supports scrolling through command output using arrow keys, Page Up/Down, which is useful for long outputs.
  3. Colored output: Unlike watch, viddy retains the colors of the command’s output, which is especially useful for commands like git or ls --color.
  4. History: viddy stores the output of each command execution and allows you to view past results.
  5. Custom refresh interval: You can change the refresh interval using the -n option: viddy -n 5 ls will refresh every 5 seconds.
  6. Additional parameters:
    • -d or --no-clear: Do not clear the screen on each refresh.
    • -h or --help: Display help information.

Comparison with watch

  • Interface: viddy offers a more modern interface with support for scrolling and viewing history, which watch lacks.
  • Color support: viddy supports colored output, while watch requires the --color option to achieve the same effect.
  • Output history: viddy allows you to view previous command outputs, whereas watch only displays the current result.
  • Query: For large amounts of information, viddy supports searching for specific keywords to locate relevant sections.

References


Read More

Tags:

Leave a ReplyCancel reply

Exit mobile version