0
votes
0answers
13 views

How to get stdout of another program [duplicate]

Some Linux program prog1 permanently prints to console. I'd like to read and analyse it's stdout in my C program prog2 as stdin. I can't change prog1 source. I expect something like this command: ...
1
vote
2answers
224 views

How to quieten tcpdump output when reading a pcap file?

I notice that when using tcpdump to read a pcap file, the tcpdump command somehow manages to print information to my console even when I redirect both STDOUT and STDERR. How can I prevent tcpdump from ...
2
votes
1answer
168 views

Using the same file as stdin and stdout results in empty file

If want to filter a file but if I use the same file as input and output the output file is empty. Is there another solution instead of using a second file? php -r "echo preg_replace('~/\* DEV ...
2
votes
1answer
157 views

What happens if dd encounters errors while output of dd is being piped to gzip?

Suppose that dd if=/dev/sda bs=100M | gzip -c > somefile.img.gz is done. If errors occur in dd, do I get to see error messages in terminal, or do they get ignored? Also, suppose that dd ...
18
votes
3answers
1k views

Why does the output of some Linux programs go to neither STDOUT nor STDERR?

Why does the output of some Linux programs go to neither STDOUT nor STDERR? Actually, I want to know how to reliably capture all program output, no matter what 'stream' it uses. The problem I have is ...
1
vote
4answers
2k views

How can I stop cat output immediately despite massive output?

I'm looking for someway to stop the output to STDOUT when I realize a command is wrong. For instance, if I accidentally cat a very large file. Usually it will eventually stop if you hold down ctrl + ...
3
votes
1answer
103 views

Any way to view stdout of a program after it has been started in gnome-shell?

So, if I run a program through the menus in gnome-shell, is there a way to view stdout and stderr? Or is there some kind of hack to achieve this functionality? Or is everything just sent to ...
1
vote
3answers
575 views

zcat | head : write error from large gz file

I was trying zcat to get only the first 1M lines of a compressed .gzip file into a new one. However, I get the following error: $ zcat path/to/R2.fq.gz | head -100 >R2.fqtest head: write error: ...
3
votes
1answer
492 views

Why can I see password prompts through redirecting output?

So, I've got a command that I'm issuing that is essentially 'ssh'ing into various hosts: command 2&>1 | grep "desired output" Every once in a while, in the midst of the command, it'll run ...
1
vote
1answer
348 views

Redirecting to /dev/null and a file at the same time

I'm trying to execute the following command: find . -name ".[ch]" | xargs grep -in pattern > file There are some errors that are printed on stderr because a few files are not found. How can I ...
2
votes
2answers
160 views

Any way to stream a file in linux

I have a terminal output which I'd like to be available to several users currently something like: command > /var/logs for the input, and: watch tail -30 /var/logs for the input terminals. ...
3
votes
3answers
1k views

Determine if output is stdout or stderr

How can I determine if what a process is outputting is stdout or stderr?
2
votes
2answers
2k views

Redirect stdout to a file when process is run in background

How can I redirect the stdout of a program to a file when it's run in the background? I have a program that generates output every second. When I run it normally and redirect to a file, the output ...
12
votes
5answers
7k views

Log rotation of stdout?

I have a Linux program which can write information to stdout and stderr. I have a shell script which redirects that output to a file in /var/log. (Via >> and 2>&1.) Is there a way to ...
1
vote
1answer
138 views

Do each application need to support writing to /dev/stdout or /dev/fd1 or is that handled transparently by the OS?

I tried this command to print the buffer of an existing screen session to stdout but I don't know why it doesn't print anything. screen -x lftp -X hardcopy /dev/fd/1 screen -x lftp -X hardcopy ...
0
votes
3answers
202 views

linux output show only right of ':'

I forgot a lot of my command line. I am doing cat file | grep "error" and i would like it to show everything to the right of G:/ including G:/ if possible. I figure its an awk command but i dont know ...