Answer the question
In order to leave comments, you need to log in
How to display and update part of the log (watch tail awk)?
Where is the error in the line:
watch -n1 -t tail /var/access.log | awk '{print $1}'
watch -n1 -t tail /var/access.log
, everything works. tail /var/access.log | awk '{print $1}'
, too, everything works, Answer the question
In order to leave comments, you need to log in
You are doing something fundamentally wrong in this particular case. In the case of tail, it's done like this:
The answer above, for the watch case, is correct, but its readability leaves much to be desired. Better this way:
tail -f /var/access.log | awk '{print $1}'
watch -n1 -t "tail /var/access.log | awk '{print $1}'"
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question