Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [stdout]

Stdout is the standard output stream is the default destination of regular output for applications.

0
votes
0answers
24 views

Extract tar file directly to stdout or other command like partition image extractor

Let's say I have TAR file with some partition images (dd/patclone/partimage/fsarchiver/whatever) and text file with MD5 sums (of image file and original partitions). I don't want to extract the image ...
0
votes
0answers
48 views

Bash Output-Prompt

So i'm customizing my PS1-Bash-Prompt at the moment and found the iPython way of displaying in- and output pretty neat. As you can see, i have my PS1-Prompt configured to look (almost) like the ...
3
votes
2answers
299 views

How can I redirect output from stdout into vim? [duplicate]

I would like to view the output of echo in vim, and save to a file after having a look at it. I have tried echo $PATH | vim, but I get the following error: Vim: Warning: Input is not from a terminal ...
0
votes
2answers
69 views

How to pipe output of command to another command while also displaying it on the console?

I want to write part of the results of a stream to a file, but I want the entire contents of the stream printed to the console. Is there some command that would help with this? Minimal example: Say ...
1
vote
1answer
39 views

Is there a Windows program for loading child process images with redirected stdout/stderr?

I have a program that has stdout and stderr available, so it can and does write important output on these channels. You only see this output when you e.g. launch it from a Windows console window, ...
0
votes
2answers
44 views

Unexpected result while using pipe operator inside a shell variable

I have a process that dumps some zipped output to the stdout. What I do with this output is pipe and send it through an SSH tunnel to another machine where it is dumped to a file. Like so: /usr/bin/...
0
votes
0answers
203 views

How to redirect stdout and stderr in bash script with dialog boxes?

For a single script redirecting stdout and stderr to a file with this: ./myscript.sh 2>&1 | tee -a out_file works fine. When I try to run the same way a script containing multiple dialog ...
0
votes
1answer
391 views

PowerShell: **reading** input from the keyboard AND **redirecting output** to a variable/file

Sorry if my question is trivial; I'm a beginner with PowerShell. My program (plink) is expecting for an answer from the keyboard and will return some output. Is it possible to redirect the output to ...
1
vote
1answer
59 views

Piping StdOut adds more text

I am running a simple command (some Kafka related stuff): curl localhost:8083 Its output is very simple: root@debian:/etc/kafka# curl localhost:8083/ {"version":"0.11.0.0-cp1","commit":"...
0
votes
0answers
119 views

How to make a background process foreground in Linux

I started a program in Linux with the command screen -d -m sbt run. How to make it again to foreground or at least view it's logs and prints? My application is a dev mode play framework web ...
0
votes
1answer
125 views

How to list processes using my current terminal for their stdout/stderr

Sometimes I have processes which are not descendents of the shell I am using, but they still have my console open as their stdout or stderr (eg running setsid yes & will get me in this state). How ...
1
vote
1answer
63 views

PID of TTY/stdout users

Is there a way in Linux to see the statistics for userspace apps that end up printing data to TTYs or to stdout (the actual stdout, not apps with stdout redirected to files on storage devices)? ...
4
votes
2answers
640 views

How to truncate file used to redirect stdout

I am trying to truncate a file, used for redirected stdout. For example: ping localhost>/tmp/test.log If I call rm /tmp/test.log then redirection stops but the command works. If I call truncate -...
0
votes
1answer
91 views

Disable stdout in Windows commands

Is there a way to disabled the stdout in a windows command specifically the net start/stop spooler command?
4
votes
2answers
6k views

What does > /dev/null 2>&1 || true mean in Linux?

"command "> /dev/null 2>&1 || true Now I get that we are sending the output of a command we run, to a null file. I need to know specific meaning for *2>&1 || true*
1
vote
1answer
76 views

Multiple stdout to one stdin

I'm on Windows, although I could be on Linux so solutions for either are welcome. I have a program that is essentially a game with 4 players that take an instruction from each of those players. ...
9
votes
2answers
323 views

Peek at `at` output before it completes

Let's say I run a script with at on Linux (example below) that I know is going to take several hours, or maybe even multiple days. I'm accustomed to at sending an email with the output of the command ...
1
vote
0answers
1k views

How do I redirect output from python to file

I want to redirect all output (stdout and stderr) of console to the text file. I make the following steps: Open cmd.exe Start command: "python.exe" > "file.txt" After that, I'm waiting for the ...
11
votes
3answers
1k views

Two Programs having their StdIn and StdOut tied

Suppose I have two programs called ProgramA and ProgramB. I want to run them both simultaneously in the Windows cmd interpreter. But I want the StdOut of ProgramA hooked to the StdIn of ProgramB and ...
1
vote
2answers
66 views

How to terminate a cli app when stdout contains a certain string?

I've got a command line app that outputs lots of information to stdout. How can I terminate the program when stdout contains a certain string? e.g. something like: my_program | ...
2
votes
0answers
217 views

See contents of conhost

Every now and then, various programs create conhost.exe processes on my (Windows 7 x64) computer. I know they are console windows, except the windows themselves are hidden. I don't suspect any ...
0
votes
1answer
219 views

how to see the output of a cron/at jobs while it is still running?

The output of a cron or atq job is automatically send by email to the user, when the job is finished. However I am running a time consuming script, and I would like to check that it is running ...
3
votes
2answers
373 views

PowerShell v5: Suppress Out-Default output in nested functions

I'd like to suppress any output then function_b is invoked: Function function_a { "test" | Out-Default } function function_b { [CmdletBInding()] param() function_a } # These are ...
1
vote
0answers
33 views

Parsing (or Converting) Buffered Output

If a dynamic, text-based, CLI application doesn't include an option for producing unbuffered text output; what options do I have for parsing said output? Can it be converted to a more appropriate ...
1
vote
1answer
990 views

Redirect STDERR and STDOUT to file with timestamp on each line

On my CentOS I am trying to execute a php script that contains an endless loop to do some fancy stuff inside. It doesn't matter that an endless loop may not be an accurate solution for most cases, but ...
0
votes
1answer
64 views

How to stop background processes from outputting permanently?

In my newly installed Lubuntu virtual machine terminal, when I run firefox & firefox runs in the background, but it keeps on outputting in my terminal. I found a way to stop it from another ...
2
votes
1answer
4k views

How to echo only 1st line from 'curl' command output?

I'm trying to get only first line of the curl command output. (Sorry if this is confusing) Let's say, for an instance, i run simply: # curl http://localhost <!-- This is the hidden line i want to ...
1
vote
2answers
55 views

How to unset a “>” echo in Linux

I've just realized I don't know how to unset an echo I set with >. The exact current situation is I just set dmesg > /var/log/syslog and now wanted to unset it, realizing I've never done that ...
2
votes
1answer
780 views

reading stdout in pipeline using “-” fails for “docker exec”

I want to launch a bash terminal for my Docker instance by piping the first container ID to docker exec: docker ps | head -2 | grep -v CONTAINER | cut -d' ' -f1 | docker exec -i -t - bash The final -...
1
vote
1answer
115 views

Unexpected BPython console output behaviour

I am using BPython to run Python scripts, and I found the console output has a different behavior than the regular Python console.. For example this small snippet: import time for i in range(100): ...
2
votes
4answers
264 views

python2.7 from macports stdin issue

My python2.7 from macports seems to mess up with osx terminal in a weird way. Here is what I mean. The exact input from the keyboard was: /opt/local/bin/python2.7<ENTER> a = 3<ENTER> a&...
1
vote
1answer
2k views

How to get stdout of a “lost” session

I don't well what's the name of the situation, I think yesterday I closed a session with a background ipython process, but I am still able to connect to it (the process is running a web server and I ...
0
votes
1answer
127 views

Weird result of initiating a variable with the output of 'git describe'

For some reason this assignment: OUT=$(git describe HEAD) prints to the stdout (for example): fatal: No names found, cannot describe anything. Is this a normal behavior? Why doesn't this happen with ...
0
votes
1answer
134 views

Modify terminal STDOUT/STDERR to change the line colour based on a REGEX

Is this possible? What I would like to achieve is when running unit tests (Python) to highlight any line which matches the path to the current project directory and leave other output untouched. ...
0
votes
2answers
1k views

Redirect stderr to second terminal / tty

I've tried things like rse to differentiate standard-output and standard-error streams from a program; but I'd really like the option of viewing the two in separate terminals, without redirecting to a ...
2
votes
1answer
2k views

Using PuTTY SSH, how do I capture the remote output of a command?

In Linux ssh me@server "echo this ran remotely" The output this ran remotely is put to standard out. This is perfect. In Windows echo "echo this ran remotely" > test.cmd putty -i privatekey.ppk ...
3
votes
1answer
3k views

shell standard streams redirection order OR 2>&1 1>/dev/null vs 1>/dev/null 2>&1

Can somebody please clarify differences? Is some of those considered as best practice? If I remember correct I somehow on SO read that this 1>/dev/null should precede this: 2>&1 ls -al /...
0
votes
1answer
63 views

Which is the preferred approach to pass command/script arguments to a log file?

Generally, I am wondering how I can pass the arguments from a terminal command to stdout. More specifically, I am using tar as part of my backup process and I would like the parameters (especially ...
1
vote
1answer
1k views

How to split and recombine stdout pipe in bash?

I am parsing text on the command line. How can I take the output of one command and use it in two places in the next command? some_command | head -n $( awk '/search_term/ {print FNR} ...
0
votes
1answer
875 views

`if` statement with stdout && passing xargs through pipe

Say I have a list.txt of files I want to check. cat list.txt and for each file, I want to perform an action cat list.txt | xargs -I {} touch {} But depending on the outcome of the action, I want ...
1
vote
2answers
156 views

How do I output a variable without changing if it has a newline or not in a shell script?

I have a shell script that takes input from another shell script. The stream gets piped in on stdin. I need to capture all the bytes of the stdin stream to a single variable in the shell script. Then,...
0
votes
0answers
21 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
1answer
4k views

Receiving FFMPEG error -22 when piping data to stdout

I am attempting to use FFMPEG to transcode avi files to mp4 and pipe the data to stdout using the following command (technically through NodeJS, but I receive the same error when executing the ...
1
vote
2answers
3k 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 ...
0
votes
2answers
2k views

How to redirect a part of stderr and stdout to /dev/null

My program outputs to stderr and stdout. I want to grep for "pattern" either in stderr and stdout. And I want the rest to be sent to /dev/null. If I pipe after redirect stderr : ./prog 2>/dev/null ...
1
vote
2answers
844 views

Stdout and stderror in CentOS

I am exec command: yum info mcrypt | grep -i error > /dev/null yum info mcrypt | grep -i error 2> /dev/null But i see: Error: No matching Packages to list How I can hide this messasge from ...
2
votes
1answer
410 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 \*/(.*)/...
6
votes
1answer
3k views

How can I pipe the output of *all* entered shell commands into another? (e.g. pipe everything into 'lolcat')

Good Afternoon, (OS X user) I am specifically trying to pipe the output of every shell command I type into the ruby gem 'lolcat' (which makes the output to the terminal rainbow colored). Is there a ...
2
votes
1answer
666 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 ...
20
votes
4answers
6k 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 ...