I know that by running
watch -n 10 xdg-open https://duckduckgo.com
in the terminal, will open the specified site in a preferred browser at each 10 seconds. I am looking for a tweak which will close the tab in which the site is loaded after 5 seconds it loads. Briefly, I want to open and close a site at regular intervals from a terminal and should be able to stop the process whenever I need. Can anybody help me with this, please?
P.S. I have already tried browser extensions and I am looking for command-line ways to do it.
Here is what I suggest:
Every 5 second it will opens the "duckduckgo" website once.
You can stop the process using Ctrl+c
Save it in a file named
script.sh
, then run:and to run it use:
Note that you don't get any output it just opens the URL once in every 5 second.
If you want to see the output you should remove
&> /dev/null
.