Questions tagged [stdout]
Stdout is the standard output stream is the default destination of regular output for applications.
121
questions
4
votes
0
answers
890
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
1
answer
1k
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
2
answers
1k
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
0
answers
51
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
1
answer
2k
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
1
answer
94
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 ...
8
votes
3
answers
16k
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
2
answers
115
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
1
answer
1k
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
1
answer
149
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
4
answers
294
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&...
11
votes
1
answer
23k
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
1
answer
337
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
1
answer
372
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. ...
3
votes
2
answers
3k
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 ...
3
votes
1
answer
5k
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 ...
4
votes
1
answer
4k
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
1
answer
139
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 ...
2
votes
1
answer
5k
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} ...
1
vote
1
answer
2k
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
2
answers
875
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,...
4
votes
1
answer
17k
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
2
answers
7k
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 ...
1
vote
2
answers
5k
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
2
answers
1k
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
1
answer
777
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 \*/(.*)/...
8
votes
3
answers
8k
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 ...
3
votes
1
answer
2k
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 ...
22
votes
4
answers
8k
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 ...
14
votes
4
answers
41k
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 + c,...
4
votes
2
answers
1k
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 /dev/null?...
565
votes
12
answers
326k
views
Can I make cURL fail with an exitCode different than 0 if the HTTP status code is not 200?
I was always assuming that when curl got an HTTP 500 response it was returning an exit code that meant failure (!= 0), but that seems to be not the case.
Is there a way I can I make cURL fail with an ...
1
vote
3
answers
5k
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: ...
10
votes
1
answer
4k
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 ...
7
votes
1
answer
16k
views
Redirect Eclipse's console / ouput to a text file
I'm doing a Java project using Eclipse. Currently by default, it shows the output in the Console. Is there any way to redirect it into a text file?
At least in python, I used to do
python somefile....
2
votes
1
answer
3k
views
How to get rid of UDP checksum error messages in virtual console?
Whenever I am streaming a video in the web browser, while connected to my school LAN via ethernet, and switch to the virtual console (ctrl-alt-f1) on Ubuntu, I get an error that looks like the ...
1
vote
2
answers
2k
views
reading output of a python file being logged in the console
I started playing with the logging module in Python recently. My output gets sent to a log file now. So far, so good. But I'd also like to be able to keep tabs on it in progress, without dealing with ...
3
votes
1
answer
680
views
Is it possible to send the output of -w and -o Curl streams to different files? How?
I'd like to run a curl command,
grep the output (response payload) for some keywords,
then also print some metrics via the -w option.
I think this would be easy to do if I could direct the -o ...
3
votes
1
answer
2k
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 ...
8
votes
2
answers
19k
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.
...
34
votes
4
answers
28k
views
Determine if output is stdout or stderr
How can I determine if what a process is outputting is stdout or stderr?
3
votes
2
answers
8k
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 ...
4
votes
1
answer
3k
views
How to open the stdout with Notepad++?
On OSX TextMate have the alias mate which you can use with the pipe to open other program's stdout.
How can I achieve the same effect in Windows 7 with Notepad++?
Ex.: git diff master|edit
30
votes
3
answers
26k
views
Pipe gunzip and mysql to gunzip a dump and import it
I have a .gz sql dump file (example: foo.sql.gz) that i want import in my database with the classic mysql command.
gunzip -c foo.sql.gz > foo.sql
mysql -uroot -ppassword foo < foo.sql
foo is ...
26
votes
1
answer
13k
views
Copy terminal output to Mac clipboard?
I need to directly copy the terminal stdout to the clipboard on Mac. How would I do this?
Example:
echo sometext | copy_to_clipboard
or
echo sometext > /private/clipboard.txt
12
votes
4
answers
19k
views
Encrypting to standard output with gnupg
I'm trying to encrypt something with gpg -a and return the result to standard out rather than a file. According to the manual, it should be sufficient to omit an --output flag, but that doesn't seem ...
1
vote
1
answer
2k
views
How can you move (or copy) all files of a certain type to a directory in Unix?
I'm not very familiar with all the tricks of grep/find/awk/xargs quite yet, so be patient with me =]
I have a particular file type say *.xxx, in random places throughout a certain directory. How can ...
0
votes
0
answers
3k
views
bash: redirect the stderr/stdout of a running process?
I have a running process running in a bash terminal that is printing some prompt, and I would like to send it to the background with the stderr/stdout prompt that is printing either redirected to /dev/...
0
votes
0
answers
2k
views
STDOUT redirection to a file does not work if Groovy script run directly from command line (.groovy in PATHEXT)
I've updated the title, please see update below for the reason.
I have asked this question on Stackoverflow, but still didn't receive an answer.
Groovy: redirect stdout to a file does not work.
I'...
10
votes
1
answer
3k
views
Different output when redirecting
$ mysql -e 'select a,b from tablefoo' databasename
yields
+---+---+
| a | b |
+---+---+
| 1 | 0 |
| 2 | 1 |
+---+---+
whereas
$ mysql -e 'select a,b from tablefoo' databasename > file
yields a ...