Skip to main content
added 47 characters in body; edited title
Source Link

How to follow constantly keywordsa keyword in multiple files and include filename beginning of each reported line

tail -f a/b/c.log d/e/f.log

logs like this:

==> a/b/c.log <==
xxx
yyy
Exception happened 1
zzz

==> d/e/f.log <==
rrr
Exception happened 2
sss

How to change command so that result isthe lines containing "Exception" are picked up like this:

a/b/c.log: Exception happened 1
d/e/f.log: Exception happened 2

The solution can use any Linux commands.

How to follow constantly keywords in multiple files and include filename beginning of each reported line

tail -f a/b/c.log d/e/f.log

logs like this:

==> a/b/c.log <==
xxx
yyy
Exception happened 1
zzz

==> d/e/f.log <==
rrr
Exception happened 2
sss

How to change command so that result is:

a/b/c.log: Exception happened 1
d/e/f.log: Exception happened 2

The solution can use any Linux commands.

How to follow constantly a keyword in multiple files and include filename beginning of each reported line

tail -f a/b/c.log d/e/f.log

logs like this:

==> a/b/c.log <==
xxx
yyy
Exception happened 1
zzz

==> d/e/f.log <==
rrr
Exception happened 2
sss

How to change command so that the lines containing "Exception" are picked up like this:

a/b/c.log: Exception happened 1
d/e/f.log: Exception happened 2

The solution can use any Linux commands.

Source Link

How to follow constantly keywords in multiple files and include filename beginning of each reported line

tail -f a/b/c.log d/e/f.log

logs like this:

==> a/b/c.log <==
xxx
yyy
Exception happened 1
zzz

==> d/e/f.log <==
rrr
Exception happened 2
sss

How to change command so that result is:

a/b/c.log: Exception happened 1
d/e/f.log: Exception happened 2

The solution can use any Linux commands.