Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Dynamic Bash Script (i.e top)

I'm wondering if there is a method to have a bash script present data to the console and consistently update it. Much like the functionality of top, but in a more simple form.

like image 873
viGeek Avatar asked Dec 17 '22 06:12

viGeek


2 Answers

watch -n 1 <your-command>

From the watch(1) man page:

Execute a program periodically, showing output full screen

like image 167
mdm Avatar answered Dec 28 '22 07:12

mdm


You need to use curses for this. Here's one detailed article about curses usage.

like image 20
jman Avatar answered Dec 28 '22 08:12

jman