Difference between revisions of "Tail"
Jump to navigation
Jump to search
(Created page with "``` tail -F my.log | awk '/line/ {++i;printf "\r%d",i}' ``` ``` #!/usr/bin/env bash set -e logfile=my.log match='Finished: SUCCESS' while true; do # tail -F -n 0 $logfile |...") |
|||
Line 1: | Line 1: | ||
``` | ``` | ||
tail -F my.log | awk '/line/ {++i;printf "\r%d",i}' | tail -F my.log | awk '/line/ {++i;printf "\r%d",i}' | ||
+ | tail -Fn0 /var/log/mylog.20201101* | awk '/Connection/ {++i;printf "\r%d",i}' | ||
``` | ``` | ||
Latest revision as of 18:20, 1 November 2020
tail -F my.log | awk '/line/ {++i;printf "\r%d",i}' tail -Fn0 /var/log/mylog.20201101* | awk '/Connection/ {++i;printf "\r%d",i}'
#!/usr/bin/env bash set -e logfile=my.log match='Finished: SUCCESS' while true; do # tail -F -n 0 $logfile | sed "/^$match$/ q" > /dev/null tail -F -n 0 $logfile | sed "/$match/ q" > /dev/null echo found new instance of $match in $logfile done