Questions tagged [stdout]

61 questions
412
votes
5 answers

What does 2>/dev/null mean?

I would like a brief explanation of the following command line: grep -i 'abc' content 2>/dev/null
Naive
  • 4,895
  • 11
  • 28
  • 35
22
votes
3 answers

What is the meaning of & at the end of a command?

I have a startup script line: pyprogramm >> /dev/null 2>&1 & Meanings: >> /dev/null - redirect stdout to null device 2>&1 - redirect stderr to stdout (that is redirected to null device) but what does the very last & mean?
vico
  • 4,717
  • 23
  • 66
  • 89
21
votes
2 answers

systemd on 15.04 won't log stdout of unit

I'm currently trying to make a systemd unit as a web server. Currently, my foo.service file looks as follows: [Unit] Description=The Foo Web…
Athan Clark
  • 617
  • 3
  • 6
  • 9
15
votes
2 answers

How can I view stdout/stderr of a startup application?

Some of the commands that I have in Startup Applications do not start properly when I login. (In particular I am having trouble with gtk-redshift.) In order to debug, I would like to be able to view stdout/stderr. I haven't found a log file for…
11
votes
1 answer

Why should apt-key output not be parsed?

To validate that the docker gpg key is installed, I ran: sudo apt-key fingerprint 0EBFCD88 | grep "9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88" Which resulted in the following output: Warning: apt-key output should not be parsed (stdout is…
jfhr
  • 213
9
votes
3 answers

systemd service output to terminal/pty

I am not able to figure out what option to pass in StandardOutput= for a unit file (.service), where I want to show some messages on the connected terminal from where the service is started! (console/tty doesn't seem to be what I want) Maybe…
Ani
  • 59
8
votes
2 answers

How to get git producing output to a file?

I wanted to write the output of git clone to a file using git clone https://github.com/someRepository > git_clone.file But instead I get the output displayed/updated in the terminal like Cloning to 'someRepository' ... remote: Counting objects:…
derHugo
  • 3,376
  • 5
  • 34
  • 52
5
votes
2 answers

Piping the output of comand columns

I am using lolcat to get the output of ls in color. To do this i have copied /usr/bin/ls to /usr/bin/lsslss (to avoid an endless loop since alias cannot acccept $* or $@) and I have added the function: ls(){ lsslss $* | lolcat; } to .bashrc The…
4
votes
2 answers

example of console output that is not written to standard output

It seems read does not write to standard output. $ cat test.sh #!/bin/bash read -p "type a key and Enter" key echo "the key was $key" $ ./test.sh type a key and Enterx the key was x $ ./test.sh | tee file type a key and Enterx the key was x $ cat…
H2ONaCl
  • 10,039
4
votes
2 answers

How to redirect dd progress in terminal to a log.txt file but still display it on the terminal during the process?

Here is my script :- sudo mate-terminal --geometry=50x10 -x sh -c "dd if=/dev/sda of=/dev/sdb status=progress 2>&1 | tee log.txt | md5sum > hash.txt | sha1sum > hash1.txt" I've seen people giving this suggestion all the time; putting 2>&1. But this…
Najmi
  • 63
  • 1
  • 7
4
votes
2 answers

STDOUT and STDERR redirection for nc

I am trying to make a watchdog bash script which has to check if the port is open, based on the exit status, otherwise should start the daemon. Problem is I can't manage to avoid the script outputting any information by redirecting STDOUT and…
4
votes
3 answers

How can I view the stdout / stderr from the bash login shell?

I'm trying to debug a strange issue with my ~/.bash_profile, and I'd like to be able to see if there are any errors / etc printed when it's run. Is there some log or such somewhere that contains the stdout and/or stderr of the login shell process?…
3
votes
1 answer

using ffmpeg in bash script prints video data to stdout

I'm writing a bash script to convert some videos the problem is when I run ffmpeg directly in terminal it is OK and converts video correctly but when I use it in bash script it prints lots of data (like the dump of video file) in stdout…
Ariyan
  • 504
3
votes
1 answer

stderr of terminal in red, even with sudo

I am trying to make a working example for logrotate, and to help me through this I figured it was a good idea to turn stderr to red. Through some reading, I came upon stderred, which I meant to adopt. I downloaded it, make'd it and it works nicely…
Tfb9
  • 681
3
votes
2 answers

printf, redirection, crontab

I'm having trouble redirecting C printf statements to a file with a program running as root. I have a program with several informational printf statements and other libraries which print errors via stderr. I'd like to log these to a file. If I…
user2977486
  • 35
  • 1
  • 4
1
2 3 4 5