1
vote
2answers
58 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
143 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 ...
1
vote
4answers
1k 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 + ...
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 ...
2
votes
2answers
2k views

is there any tool that allows redirecting output to env variable in windows *.cmd script?

I mean to use it like this: echo some data | this-tool-m-searching-for -vn myvariable or time | this-tool-m-searching-for -vn current_time etc.. and then echo %myvariable% would produce some ...
3
votes
2answers
854 views

What is the use of binary output on stdout?

Some programs print their binary output directly on stdout. Here are some examples: tar -c file.png dd if=file.png Well, I see that the output can be redirected to a file. But these programs ...
10
votes
3answers
10k views

Windows: Command line redirection to text file while also seeing output

I'm writing a C program in Windows, my printf calls print to the command line, and I know that I can redirect all this output to a text file using: myProgram.exe > mylog.txt However, I wish to ...
2
votes
2answers
200 views

Doing arithmetic and passing it to the next command

I know how to do this in /bin/sh, but I'm struggling a bit in Windows. I know you can do arithmetic on 32-bit signed integers with SET /a 2+2 4 But how do I pass this to the next command? For ...
1
vote
2answers
477 views

Keep stdout on screen AND in File

I open a command prompt window in XP. There I run a command line program (foo.exe) and I want to capture stdout in a file. So I run it like this: foo > fooResult.txt However, at the same time I ...