Questions tagged [stderr]
49 questions
91
votes
8 answers
How to suppress cUrl's progress meter when redirecting the output?
I'm trying to print just the verbose sections of a cURL request (which are sent to stderr) from the bash shell.
But when I redirect stdout like this:
curl -v http://somehost/somepage > /dev/null
Some sort of results table appears in the middle of…
Ian Mackinnon
- 5,924
49
votes
2 answers
why it is 2>&1 and not 2>>&1 to append to a log file
I am redirecting STDOUT and STDERR to a single file, always growing,
so I use always use "append" redirection; this is >>
my command is command >> logfile 2>&1
And it works.
But the STDERR redirection has a single >, which I was using to "create"…
Mikel Vergy
- 591
36
votes
4 answers
Determine if output is stdout or stderr
How can I determine if what a process is outputting is stdout or stderr?
Rauffle
- 694
- 2
- 8
- 13
21
votes
4 answers
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 that some programs do not seem to let their…
Will Sheppard
- 557
17
votes
7 answers
Linux less behavior and stderr
I'm watching the output of my complicated command with less, problem is the stderr gets lost. stderr lines normally get listed inbetween stdout lines inside less. I would like them to be printed to the console, and when I exit less, to see them…
haelix
- 438
12
votes
1 answer
PowerShell and Tee
I use this command to see output both in the console and a file:
powershell -command "my_command_1 | tee ('logs\{0}.log' -f (Get-Date -format 'yyyy.MM.dd-HH.mm'))"
powershell -command "my_command_2 | tee ('logs\{0}.log' -f (Get-Date -format…
race1
- 221
10
votes
1 answer
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 into a host where I don't have my keys setup. When that…
Matt Simmons
- 775
10
votes
3 answers
Using powershell call native command-line app and capture STDERR
I'm using a port of a cygwin tool on Windows which writes normal status messages to STRERR. This produces ugly output when run from PowerShell:
PS> dos2unix.exe -n StartApp.sh StartApp_fixed.sh
dos2unix.exe : dos2unix: converting file StartApp.sh…
yzorg
- 785
8
votes
6 answers
Immediately tell which output was sent to stderr
When automating a task, it is sensible to test it first manually. It would be helpful, though, if any data going to stderr was immediately recognizeable as such, and distinguishable from the data going to stdout, and to have all the output together…
Clinton Blackmore
- 1,022
7
votes
2 answers
pipe a program into less
I'm taking the dive into setting up and learning git and at the same time learning bash. I'm trying to do something simple as view the help section of
$ git config
unfortunately, when I type that the output of the help goes off the screen. Doing…
coderdave
- 257
7
votes
2 answers
ffmpeg less verbose, without hiding progress bar
Without editing and recompiling ffmpeg from source, how can one hide some of the many lines that it prints when it starts encoding, without also hiding its progress bar that updates every second or so while encoding?
Progress bar:
frame=14759…
Camille Goudeseune
- 2,721
5
votes
2 answers
Suppressing stderr in GNU Parallel
I'm using GNU Parallel to concurrently run a command several thousand times.
To get logs of the execution I'm using --files and --results.
To get nice progress bar while it's running I'm using --eta and --progress.
Now, my problem is that while…
Jasiu
- 171
5
votes
2 answers
Missing segfault output in Linux terminal when running with "&"
I am debugging an application that has to run with other components. I am wrapping everything in a script:
#!/bin/bash
./component1 > 1.log &
./my_application &
./component2 > 2.log &
I want to see the output in the terminal so I didn't…
CuriousMind
- 2,021
4
votes
1 answer
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 /doesNotExists 2>&1 1>/dev/null
ls -al /doesNotExists…
Wakan Tanka
- 769
4
votes
2 answers
Linux shell: how to add prefix string to stderr message?
I am running several tasks simultaneously at background.
command_a | tee > command_a.log &
command_b | tee > command_b.log &
If everything is fine, then messages will be saved to log files.
If something wrong, it will print errors on screen.
But…
Fisher
- 757