stdout is the name of the default output file descriptor of a process. Since there is nothing special about `stdout`, you *should not* use this tag. Use [tag:io-redirection] for questions on how to redirect output, use [tag:file-descriptors] for questions on how to manage file descriptors, use ...

learn more… | top users | synonyms

2
votes
2answers
45 views

Output is in console but not part of stdout or stderr

I have a command that outputs the following: READY Listening.... HELLO READY Listening.... TEST It is speech recognition from pocketsphinx_continuous. I need that output redirected to a file, and ...
3
votes
5answers
164 views

Concatenate contents from stdout and from file

How can we concatenate results from stdout (or stderr) and a file into a final file. For example ls -a | grep text1 concatenate with file2.txt into a final result (not file2.txt), without storing ...
16
votes
4answers
719 views

How to trick a command into thinking its output is going to a terminal

Given a command that changes its behaviour when its output is going to a terminal (e.g. produce coloured output), how can that output be redirected in a pipeline while preserving the changed ...
3
votes
3answers
32 views

What is regarded as “ideal” in relation to using stdout/stderr for output in different situations?

I have seen stdout and stderr used in a variety of different ways - as far as I understand, it is common to use stdout for general information and stderr for errors and the like. However, I have also ...
0
votes
1answer
33 views

vimdiff to compare output instead of files

I am trying to compare two command output (no files) vimdiff "$(tail /tmp/cachain.pem)" "$(tail /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem)" I tried playing with redirection, pipe, and vim - ...
0
votes
4answers
167 views

How to display output of command while also parsing it?

I have two commands, build and deploy. Currently I run build manually, parse its output using my own eyes, and use a value I find in the output as an argument to deploy. The process looks something ...
0
votes
0answers
19 views

Piped sequence - printing

I need to write a piped sequence of commands that prints out a list of all sub directories of a current directory. In order to get all sub directories of a current directory I use: ls -D Since I am ...
0
votes
2answers
81 views

how to redirect output of ssh to a file

I want to make ssh connection to my server but I don't want to enter password. I want to save output to a file like so: $ ssh root@x.x.x.x -p 22 1>output 2>&1 but when I run it the output ...
0
votes
4answers
50 views

How to log from inside the script along with stdout

I am aware that I can log using tee But I want to log from inside my script, at the same time display the content on the stdout. Example, my code looks something like this: names=$(print("name1 ...
0
votes
0answers
84 views

Stop stdout log being clipped (by heroku-local)

I run heroku local with the Procfile: web: start-nginx gunicorn -c gunicorn.conf.py app:app start-nginx does some environment setup, and then ends with: { nginx --some-params & $@ ; } the ...
2
votes
2answers
322 views

pipe stdout-to-file with wc

I'm working on a lab assignment for a class, which exemplifies users | wc -w as displaying the number of users currently logged in. The instructor has asked we write the output of users to a file ...
0
votes
2answers
39 views

Unclear where bash output is going

I made a small script to output the list of vim plugin remotes to a file, so I could figure out what ones I want to keep or remove. However, when I run it, the output doesn't get piped to the file. ...
1
vote
2answers
90 views

Duplicate stdin to stdout and stderr, but in a synchronized way

I need to duplicate the stdout of a producer and feed it to two consumer in a synchronized fashion. consumer 1 producer | duplicator | consumer 2 ...
0
votes
2answers
73 views

Printing on “standard out” and “standard error”

I'm puzzled over some terminology used in my homework: So, the way I understand the question is that I should print echo, cat, etc., which I would do like with the echo command, for example echo ...
0
votes
0answers
24 views

fs_usage: a part of stdout is missing.. Where did it go?

I'm using $ fs_usage -f diskio to spy on processus when I hear my hard drive spinning for no reason, so that I know who is working so hard.. Here is one sample line: 16:14:13.785568 ...
1
vote
1answer
69 views

How to know if output is being redirected to a file? [duplicate]

I am working on displaying output like ls command (just ls, no options). And I have a working program using the system calls. But I experienced a strange behavior while testing as shown below. $ ls ...
1
vote
3answers
154 views

in bash script; a process stdout as filename argument fails when you open it more than one time

Consider this bash script code: #!/bin/bash function bug_part() { cat $1 > sample.first cat $1 > sample.second #second time you open file $1, it contains no data } bug_part <(echo ...
6
votes
2answers
99 views

Notification Listener Behaving Strangely when Backgrounded

I've been struggling to get my IRC-Bouncer/Notification Script working. This is meant to be a script which will automatically login to a remote machine, attach to a screen session (or start one if ...
1
vote
1answer
121 views

Prevent ssh-keyscan from generating output

Problem: When running ssh-keyscan in cron it emails me the output of ssh-keyscan every day. The email simply contains the following. # <hostname> SSH-2.0-OpenSSH_5.3 My (simplified) cron ...
2
votes
5answers
3k views

How to add new lines when using echo

Why the following command does not inserts new lines in the generated file and what's the solution? $echo "Line 1\r\nLine2" >> readme.txt $ cat readme.txt Line 1\r\nLine2
1
vote
3answers
98 views

How to write a script that can take input from stdout

I want to be able to write a script that can take stdout as an argument, if anything is piped into it (ultimately, I would like it to be polymorphic) - The trouble is, I have searched and searched ...
3
votes
2answers
264 views

How do I filter stdout of a program through grep while still controlling the program?

I'm trying to filter the output of the mpv media player, removing a particular line, but when I do so I am unable to control mpv with the keyboard. Here is the command: mpv FILE | grep -v 'Error ...
1
vote
1answer
30 views

Pipe stdout to obexftp bluetooth transfer?

Here I have command to transfer inputFile.tar to another bluetooth device (10:68:3F:57:7D:B6). obexftp -b 10:68:3F:57:7D:B6 -p inputFile.tar However, is it possible to use stdout as input for ...
1
vote
1answer
83 views

How to redirect tarsnapper output to /dev/null?

I use tarsnapper's make command for managing tarsnap backups like this: tarsnapper -c /usr/local/etc/tarsnapper.conf make Which works like it should and I get an output like this Creating backup ...
0
votes
1answer
40 views

How to redirect the time a task takes to complete into a log file, given that such task is already redirecting?

I have a shell script running a python task, whose stdout is being redirected to a log file: python script.py >> log.txt I wish to also log the time this task takes to complete, into the same ...
0
votes
3answers
55 views

What is `>&` in simple terms? [duplicate]

What does $ command 1>&2 do? As I understand it this runs the command but with the STDOUT redirected to the STDERR. But I'm not sure exactly how >& works. I have seen it as $ command ...
4
votes
3answers
551 views

Why can't I read /dev/stdout with a text editor?

I just started learning how Everything Is A FileTM on Linux, which made me wonder what would happen if I literally read from /dev/stdout: $ cat /dev/stdout ^C $ tail /dev/stdout ^C (The ^C is me ...
-1
votes
1answer
48 views

How to get the screen logs of a oracle VM [closed]

When I start an oracle VM with Linux operating system I want to get the standard output, i.e whatever is coming in the screen. Is there any tool or is there any way to get that so that I can check ...
1
vote
0answers
24 views

How to get stdout of process? [duplicate]

I started a process from the command line, but the window server died. However I see the process I started is still running. Is it possible to connect a terminal to the process to see its output? ...
-1
votes
1answer
34 views

Does those two constructions do the same thing: proces <input.txt vs cat input.txt | process in Linux

Does those two constructions do the same thing: proces <input.txt vs cat input.txt | process in Linux?
3
votes
1answer
129 views

Is there any way to exit “less” follow mode without ^C?

Often times I find myself in need to have the output in a buffer with all the features (scrolling, searching, shortcuts, ...) and I have grown accustomed to less. However, most of the commands I use ...
1
vote
1answer
104 views

Using GNU timeout when redirecting stdout to file

Suppose I have a executable which for which I want to log STDOUT and STDERR to separate files, like so: python write.py > out 2> err When I use this command with GNU timeout, my out file is ...
4
votes
2answers
249 views

uniq and bash for loop not writing to stdout before stdin closing (for one-line website visitor notification system)

I'm trying to trigger a beep on the PC speaker for every unique visitor of a website. After some brainstorming, it seemed to be possible with one line: for e in `ssh me@mymachine "tail -n 1 -f ...
1
vote
3answers
110 views

Store stdout and stderr in file, then recreate the output later

I've redirected output to a file like so: $ ./test.bash 2> >(sed 's/^/stderr: /' >> output) > >(sed 's/^/stdout: /' >> output) $ cat output stdout: Hello World! stderr: ...
4
votes
3answers
164 views

How to not show the stdout output of a running process?

When a running process gives lots of stdout output throughout its lengthy running process, you don't want to kill it and rerun it. How can you not show the output? Thanks.
18
votes
4answers
15k views

Write Python stdout to file immediately

When trying to write the stdout from a Python script to a text file (python script.py > log), the text file is created when the command is started, but the actual content isn't written until the ...
20
votes
2answers
1k views

Pipes, how do data flow in a pipeline?

I don't understand how the data flows in the pipeline and hope someone could clarify what is going on there. I thought a pipeline of commands processes files (text, arrays of strings) in line by line ...
1
vote
1answer
306 views

Redirect all bash script output (from inside the script) to two files: one append, one rewrite; but discard output to the console

I can easily redirect both standard and error output of a bash script to the file, while discarding an output to console with simple exec statement: exec &>>/var/log/backup.log But how do ...
0
votes
1answer
288 views

How do I grep on a live log (stdout)?

I'm not sure if that what stdout is, but that's what I think. What I want to do is filter out a certain log message when running an executable. I tried this: Executable 2>&1 /dev/null | ...
19
votes
3answers
1k views

Is it safe to type another command into STDIN while the previous command is writing to STDOUT?

Perhaps this has been answered previously, I would welcome a link to another answer... If I execute a shell command (in a bash shell) like the following: make Then while the output from make is ...
0
votes
1answer
698 views

Redirecting Standard Output And Standard Error to One File [duplicate]

I have come to understand that we have two methods of redirecting both stdout and stderr to the same file. The first method is: ls -l /bin > ls-output.txt 2>&1 As the author of this book ...
3
votes
1answer
181 views

stdout redirect. sh: resource temporarily unavailable

I have large batches of bash processes. Each bash script invokes executeables which have their stdout redirected to distinct log files. About 5% of the runs end up with: sh: [name of log]: Resource ...
1
vote
1answer
40 views

Why does the -v option with rm show entries with a backquote and a normal quote?

When I do rm -v on a set of files, I see the output list of files being deleted with a backquote and a regular quote, eg: rm -v rsl.out.0??? removed `rsl.out.0579' removed `rsl.out.0580' removed ...
0
votes
1answer
136 views

Pipe stdout to command on stdout

If I had a running process like tail -F watch.txt and I wanted to capture the stdout from this running process and pipe it to another command on stdout how could this be done? Here's an example of a ...
4
votes
2answers
954 views

How does Bash get the output of an executed program?

When I execute a program in Bash, for example, [ls][2], it sends its output to standard output (fd &1). And the ouput of the executed program is displayed in the terminal. How does Bash/terminal ...
1
vote
1answer
97 views

capture log of ufsdump when backup to stdout

I am backing a file system with ufsdump. In order to gain space in the remote file system I backup to stdout then pipe the output to compress. I find is more efficient that backuping up and then ...
0
votes
1answer
107 views

Force ping to write before interrupt

I am trying to get ping to continuously write some times to a file. When I run $ ping 10 10.1.10.28 | perl -ne '/time=(\d+\.\d+)/ && print "$1\n"' It returns one number every several ...
1
vote
1answer
125 views

Dynamic ~/.ssh/config

I'd like make my ~/.ssh/config file dynamically generated by a shell script (or anything else that prints to STDOUT). Is there a UNIX trick to make reading a file result in executing a command & ...
0
votes
1answer
123 views

Keep PHP's output with tee -a

Normally when running PHP script in web server mode, this would show up: $ php -S 0.0.0.0:12345 PHP 5.6.1 Development Server started at Mon Nov 24 14:09:22 2014 Listening on http://0.0.0.0:12345 ...
1
vote
2answers
2k views

Redirect stdin and stdout to ports

I'd like to take a program P that reads from stdin & writes to stdout, but connect it to nc or whatever such that it reads from a certain port and outputs to another port. # The reading is easy, ...