That might be due to buffering. On linux, one of the coreutils is stdbuf that allows to modify the way programs use their input and output buffers. Try:
Rudi,
you are my hero of the day....it works like a charm...
I just put the tail-command into a screen-session and it keeps logging everything of the search string into the file...
thx very much for you help....I do very appreciate it!
cheers
Hi all
I've read through a few of these lists but can't find a right combination of answers (I can create VPN's but can't send an email!)
Ok - I'm using taper as backup software which generates a log file called taper_log I want the last eight lines of this log file to be sent to a specified... (3 Replies)
Hi all,
Iam trying to sort the contents of the file based on the position of the file.
Example:
$cat sample.txt
0101020060731 ## Header record
1c1 Berger Awc ANP20070201301 4000.50
1c2 Bose W G ANP20070201609 6000.70
1c2 Andy CK ANP20070201230 28000.00... (3 Replies)
Hello:
I'm a very newbee at UNIX/AIX.
What i want to do is to tail a file from the bottom until a certain string is found and write all the lines after the found string to another file.
I've tried out a lot of combination with tail and grep but doesn't find the good one.
Could someone help... (4 Replies)
Hello all,
I have some weird problem that kinda baffles me. Say I have the following test file:
claudia:~/tmp$ cat testfile.txt
This is a test line
This is the second test line
And yeah, this is the third test line
Then say I want to tail the file, grep for the word "third" then... (7 Replies)
How would I write a command(s) to read from a file (list) that looks like this: 29847374384 and grep from a second file (list) that looks like this: 29847374384, jkdfkjdf,3833,ddd:confused: (1 Reply)
The program that is running on my machine generates log files. I want to be able to know the number of lines that contain "FT" in the most recent log file. I wrote the following, but it always returns zero. And I know the count is not zero. Any ideas?
ls -rt *.log | tail -n 1 | grep -c FT (6 Replies)
I need to tail -f a file so I can monitor it as it is being written to. However, there is a lot of garbage in the file that I don't care about. So normally I would just pipe and grep for the string that is important to me. However, in this case, there are two things I need to grep for. I can't... (3 Replies)
I have a basic tail/grep question. I have logs that are generated & kept in a directory called alert_audit. I am using "tail" to see the logs that are coming in, but I only need logs that contain the IP address 10.249.185. or 10.247.231.
Here is the command I have, but it pulls all IP... (3 Replies)
Dear all,
I have a huge txt file (DATA.txt) with the following content . From this txt file, I want the following output using some shell script.
Any help is greatly appreciated.
Greetings,
emily
DATA.txt (snippet of the huge text file)
407202849... (2 Replies)
Good Morning,
i ran into some trouble this morning while 'improving' my monitoring stuff. i would like to get a warning when the number of mails sent (outbound) by postfix is above a certain number. so far, so easy. to test that i simply put
cat /var/log/mail.info | grep 'to=<' | grep -v -e... (1 Reply)
Discussion started by: Mike
1 Replies
LEARN ABOUT XFREE86
stdbuf
STDBUF(1) User Commands STDBUF(1)NAME
stdbuf - Run COMMAND, with modified buffering operations for its standard streams.
SYNOPSIS
stdbuf OPTION... COMMAND
DESCRIPTION
Run COMMAND, with modified buffering operations for its standard streams.
Mandatory arguments to long options are mandatory for short options too.
-i, --input=MODE
adjust standard input stream buffering
-o, --output=MODE
adjust standard output stream buffering
-e, --error=MODE
adjust standard error stream buffering
--help display this help and exit
--version
output version information and exit
If MODE is 'L' the corresponding stream will be line buffered. This option is invalid with standard input.
If MODE is '0' the corresponding stream will be unbuffered.
Otherwise MODE is a number which may be followed by one of the following: KB 1000, K 1024, MB 1000*1000, M 1024*1024, and so on for G, T,
P, E, Z, Y. In this case the corresponding stream will be fully buffered with the buffer size set to MODE bytes.
NOTE: If COMMAND adjusts the buffering of its standard streams ('tee' does for example) then that will override corresponding changes by
'stdbuf'. Also some filters (like 'dd' and 'cat' etc.) don't use streams for I/O, and are thus unaffected by 'stdbuf' settings.
EXAMPLES
tail -f access.log | stdbuf -oL cut -d ' ' -f1 | uniq
This will immediately display unique entries from access.log
BUGS
On GLIBC platforms, specifying a buffer size, i.e., using fully buffered mode will result in undefined operation.
AUTHOR
Written by Padraig Brady.
REPORTING BUGS
GNU coreutils online help: <http://www.gnu.org/software/coreutils/>
Report stdbuf translation bugs to <http://translationproject.org/team/>
COPYRIGHT
Copyright (C) 2017 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.
SEE ALSO
Full documentation at: <http://www.gnu.org/software/coreutils/stdbuf>
or available locally via: info '(coreutils) stdbuf invocation'
GNU coreutils 8.28 January 2018 STDBUF(1)