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:
- Install with Cargo (Rust’s package manager): If Rust is already installed on your system, you can install viddy with Cargo:
cargo install viddy - 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
- Run commands periodically:
viddywill run the specified command at the default interval (2 seconds). - Scrollable interface:
viddysupports scrolling through command output using arrow keys, Page Up/Down, which is useful for long outputs. - Colored output: Unlike
watch,viddyretains the colors of the command’s output, which is especially useful for commands likegitorls --color. - History:
viddystores the output of each command execution and allows you to view past results. - Custom refresh interval: You can change the refresh interval using the
-noption:viddy -n 5 lswill refresh every 5 seconds. - Additional parameters:
-dor--no-clear: Do not clear the screen on each refresh.-hor--help: Display help information.
Comparison with watch
- Interface:
viddyoffers a more modern interface with support for scrolling and viewing history, whichwatchlacks. - Color support:
viddysupports colored output, whilewatchrequires the--coloroption to achieve the same effect. - Output history:
viddyallows you to view previous command outputs, whereaswatchonly displays the current result. - Query: For large amounts of information, viddy supports searching for specific keywords to locate relevant sections.
References
- sachaos/viddy: A modern watch command. Time … – GitHub
- viddy: 👀 Modern watch command implemented in Go. Time …