Questions tagged [stdout]

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 the [io-redirection] tag for questions on how to redirect output, use [file-descriptors] for questions on how to manage file descriptors, use [lock] for questions of file locking, and use [files] for general questions on file operations.

Filter by
Sorted by
Tagged with
0 votes
1 answer
27 views

Why is “echo $SHELL” not captured by remote SSH output?

When I capture the output of a remote SSH call using cat, whether in bash or in Python, things work as expected. E.g, this works just fine: import subprocess rc = subprocess.getoutput(“ssh user@host; ...
user avatar
3 votes
2 answers
170 views

How to get the "process IDs" which are logging output to stdout?

How do I get the PIDs of all the processes which are dumping output to stdout.
user avatar
0 votes
0 answers
38 views

Questions on shell redirection [duplicate]

I am studying for my RHCSA and already have my Linux+ and I'm trying to better understand shell redirection beyond just understanding the basic use cases and I am trying to grasp it at a deeper ...
user avatar
  • 9
0 votes
1 answer
41 views

Why dmesg output displayed on /dev/tty1

This is still related to my yesterday thread, so there's alert or maybe it's just log that displayed on my terminal on /dev/tty1. Ofcourse it's annoying because it's displayed in my bash prompt, so ...
user avatar
0 votes
0 answers
14 views

Why are keystrokes not intercepted after reattaching a "screen -dmS session bash -c 'command'"?

I'm using screen -dmS mysession bash -c 'command > test.txt' to start a screen, launch a command + write its stdout to a file, and detach. Later, after reattaching it with screen -r mysession, I ...
user avatar
  • 2,163
0 votes
1 answer
51 views

Why does this screen session exit when the command is finished? [duplicate]

I know screen -dmS mysession command to start a screen, launch a command and detach. When we need to redirect the stdout to a file, this works: (see How to run a program in a screen, redirect all ...
user avatar
  • 2,163
0 votes
0 answers
50 views

How to call pinentry from bash script

How to call pinentry from bash script so I am prompted for single input on the same terminal from which my script was invoked from and then pipe the entry to some other command via stdout for the sake ...
user avatar
  • 101
1 vote
1 answer
47 views

websocat / wscat save a new file per seconds

This question is about saving a wss:// stream into multiple files... while execution (NOT AFTER) EXAMPLE : websocat "wss://stream.binance.com:9443/ws/btcusdt@depth" > /path/$(date +%s)....
user avatar
  • 115
0 votes
0 answers
18 views

Tool to convert HTML to plain text and print it to stdout [duplicate]

I have a shell script which uses curl to post a request to an HTTP API. The API returns the result as an HTML document. Upon receiving the result, I would like to print it to stdout. I could just cat ...
user avatar
2 votes
2 answers
101 views

Watch output piped to /dev/null

I have a few scientific programs that can run from a few minutes up to several days. The program prints progress information to stdout which ends in a carriage return. If the program runs for several ...
user avatar
  • 23
0 votes
0 answers
57 views

How do I capture binary output from a process different from the console output?

I'm currently able to launch a process from within Java's ProcessBuilder, which continually appends to a (binary) file output.WAV, and is continually dumping lines of console updates. That works ...
user avatar
0 votes
1 answer
165 views

echo "Hello World" > /dev/stdout prints nothing

Scenario: $ echo "Hello World" > /dev/stderr Hello World $ echo "Hello World" > /dev/stdout $ uname -a CYGWIN_NT-10.0 xxx 3.3.4(0.341/5/3) 2022-01-31 19:35 x86_64 Cygwin ...
user avatar
  • 397
2 votes
1 answer
31 views

Send stdout to multiple downstream processes in a chain

I have a series of commands I run like this: cmd1 < input > foo cmd2 < foo > bar cmd3 foo bar > output Is there a way to do this without the intermediate files foo and bar? I'd also ...
user avatar
  • 123
1 vote
0 answers
22 views

cut file and overwrite file [duplicate]

Let's say I have file.txt water 1 lorem 0 ipsum 0 I cut the last column and redirect output to file itself with this: cut -d' ' -f 1 file.txt > file.txt I expect current content of file.txt is ...
user avatar
0 votes
0 answers
99 views

Listening to stdout of a remote machine

I'm looking for a way to get a local terminal tail log from an stdout execution on a remote machine without directly executing with ssh. The general procedure is: The local client machine runs a ...
user avatar
  • 101
0 votes
0 answers
27 views

Behaviour for output of Command Substitution working with String variable with Pipes [duplicate]

For simplicity and how source/input of this post for the coming scenarios, observe the following java --version openjdk 11.0.13 2021-10-19 OpenJDK Runtime Environment Temurin-11.0.13+8 (build 11.0.13+...
user avatar
0 votes
1 answer
48 views

mount cifs: how to retrieve the status of the command execution from the terminal?

The following mount cifs code works fine: sudo mount -t cifs //192.168.1.77/something /mnt/192.168.1.77/something \ -o username=alpha,rw,uid=alpha,gid=tango,dir_mode=0770,file_mode=0770,...
user avatar
1 vote
0 answers
46 views

What is the proper way to check whether stdout was deleted

I need to check from a running C program whether stdout was deleted. By "deleted" I mean a situation when in /proc/pid/fd is written "deleted": ll /proc/91495/fd total 0 dr-x------ ...
user avatar
  • 205
1 vote
0 answers
33 views

sed + how to be sure that sed replaced the value correctly

here is a nice example how to replace the value on match key on file str="192.2.34.40:2181,192.2.34.34:2181,192.2.34.32:2181,192.2.34.52:2181,192.2.34.53:2181" sed -i "s~^[[:space:]]*...
user avatar
  • 11.1k
0 votes
1 answer
220 views

how to enable debug logs in stdout for logstash?

I'm struggling as newbie in logstash, below is some info of my env Logstash Version: logstash-7.16.2-1.x86_64 java Version: openjdk version "11.0.13" 2021-10-19 LTS Logstash Conf input { ...
user avatar
  • 1,703
4 votes
2 answers
97 views

Looking for a general split+merge syntax for IO streams

I often want to perform an operation that requires splitting the stdout of a pipeline (let's call it pipeline-before) into two parallel streams; feeding the resulting stream, as their stdin, to two ...
user avatar
  • 13k
0 votes
3 answers
82 views

Using `1>&- 2>&- &' as an alias after a shell command

To run a program with bash in background, with no text output, it is possible to use: 1>&- 2>&- &. I would like to define an alias for this. However, if I write in .bashrc alias ...
user avatar
  • 4,503
0 votes
1 answer
89 views

Pipe output of two commands into another script as arguments

ntopng can handle multiple network interfaces and I've a script that takes the name of the interface and outputs it in to stdout. I can pipe this output into ntopng my_packet_tracer.sh | ntopng -i - ...
user avatar
0 votes
1 answer
62 views

Please how do I retrieve files saved in STDOUT after using the extract while downloading function?

I used the below function to download a large tar.gz file and extract it simultaneously. The files are now saved in STDOUT. Please how do I move them to a different file directory? wget -q -O - target ...
user avatar
  • 1
0 votes
1 answer
136 views

How it comes that ldapsearch output can't be piped

ldapsearch always outputs an authentication message with every query at the beginning: SASL/GSS-SPNEGO authentication started SASL username: user.principal@DOMAIN.NAME SASL SSF: 56 SASL data security ...
user avatar
  • 1
0 votes
1 answer
47 views

When is it beneficial to add -u to tr?

One of the arguments to the tr command is: -u Guarantee that any output is unbuffered. Under what circumstances is it a good idea to not buffer the output? e.g. should I use -u if I expect each ...
user avatar
1 vote
2 answers
205 views

Capture stdout of a crashing program and shell's "segfault error" message

I have a compiled program main.bin that is supposed to print: hello world another line This program generates a segmentation fault right after printing the first line. If I run it in the shell (zsh), ...
user avatar
0 votes
1 answer
75 views

Debugging ssh connection that prints incorrect characters to terminal what appears randomly after ssh logins

With random occurence for ssh logins into remote terminal ('agetty') there is immediate output of unrelated characters into that ssh session terminal. With periodical repetition these are "hh��...
user avatar
5 votes
1 answer
212 views

On `tty <&1` vs `echo $(tty <&1)` vs `echo $(tty <&2)`

The key statements in the snippet below (i.e. other than those for printing labels and blank lines, for spacing) come in pairs. In each pair, the first and second statements have the forms tty... and ...
user avatar
  • 13k
0 votes
0 answers
700 views

How can I redirect journalctl output from a systemctl --user service to a file?

I need to redirect systemd output (Not the binaries stdout / stderr. I mean the actual systemd output send to journalctl) to a file for a specific user unit. I know the user can view journalctl with ...
user avatar
  • 294
0 votes
1 answer
45 views

How to redirect running process output from pipe to something else?

Is there any way to redirect stdout (1) from that "pipe" (I don't know exacly how I suppose interpret this, I will be glad if someone could explain how to treat this, or give me some read on ...
user avatar
  • 103
0 votes
2 answers
147 views

How to capture output that is going neither to stdout nor to stderr?

As far as I can tell, some of the output generated by the command /usr/bin/modulecmd goes neither to stdout nor stderr, as illustrated by the following example: % /usr/bin/modulecmd bash help null >...
user avatar
  • 13k
0 votes
0 answers
35 views

Is there an output character to indicate the end of a command in bash from stdout?

I am trying to build a web-app where i can run a bash terminal directly from the browser. I have got the basic functionality working where i fire up a bash process and redirect the stdout to a ...
user avatar
  • 161
0 votes
0 answers
80 views

How to show the output for the execution for any command and/or script in stdout and file but keeping the color in the stdout?

For some commands, in the terminal they print with some colors in the stdout, for example: git status mvn help:help -Ddetail=true gradle build Any Linux command (ls [-...], etc) Note: it applies for ...
user avatar
1 vote
0 answers
25 views

systemd NOT directing standard output to a file [duplicate]

Our service-definition, running under systemd --user, begins with: [Service] StandardOutput=append:logs/foo.log StandardError=fd:stdout The service starts without obvious errors and the actual ...
user avatar
0 votes
1 answer
94 views

Why is this shell output cannot be written to a file? [duplicate]

I'm working on a linux pinephone script that would launch a touchpad emulator. In order to do so, I need to compare the output string of: ./TouchpadEmulator /dev/input/event2 /dev/input/event1 once I ...
user avatar
0 votes
1 answer
199 views

Run archived script (.tar) without save it on disk, but commands inside it are not recognized

In CentOS, I would like to run a script which is archived as a .tar file, but when I try to do it, it does not recognize 'read' command. The main idea is run this script without save on disk Listing ...
user avatar
  • 3
2 votes
1 answer
130 views

How to write less buffer to stdout in interactive mode

My scenario is the following: When I ask the psql program for \help, it pipes its output to less. Sometimes, I would like to keep the help contents while writing my next query. I imagine this could ...
user avatar
5 votes
1 answer
292 views

Why is mawk's output (STDOUT) buffered even though it is the terminal?

I am aware that STDOUT is usually buffered by commands like mawk (but not gawk), grep, sed, and so on, unless used with the appropriate options (i.e. mawk --Winteractive, or grep --line-buffered, or ...
user avatar
  • 1,030
0 votes
1 answer
707 views

View live output of remote ssh command [duplicate]

Suppose I have a python script script.py from time import sleep for i in range(3): print(i) sleep(1) print('done') which I want to run on a remote server via an ssh command e.g. ssh me@server ...
user avatar
  • 429
2 votes
1 answer
72 views

Redirecting output from within disk operations does not work

I am not able to successfully redirect STDOUT+STDERR on commands that operates with disks. Standard redirecting which always works, is somehow now catching the output. Two practical examples: Example ...
user avatar
1 vote
1 answer
51 views

bash I/O redirection - how to append to stderr

I have a script that loops over some big collection of data and performs some lenghty operations. Then i need to sort | uniq -c its output. So to let it know that its alive, I print a dot every N ...
user avatar
  • 163
0 votes
1 answer
21 views

Execute Program until specific amount of bytes has been returned on stdout, then terminate

Imagine I have the following program/script ./generate-infinite-byte-stream: #!/bin/bash echo -n 'hello' sleep infinity The infinite sleep command represents a network connection that may or may not ...
user avatar
-1 votes
1 answer
127 views

Redirect a part of mapfile function to stdout but not into the array

Summary: Like we have Stdout Stderr, I would like to create Stdstatus. Stdout can be stored in array and Stdstatus can be printed for user. I didn't know that stderr could be used for other messages ...
user avatar
  • 1,354
1 vote
1 answer
106 views

How to check if command had any output (zsh)

I want to print a new line after a command if it had any output (I hope that this will make it more readable once my terminal starts scrolling). I found this: precmd() { precmd() { print &...
user avatar
0 votes
0 answers
538 views

Where does stdout and stderr go in the background

When processes get executed in the background, for example by using systemd to start the processes at startup, why doesn't the stdout and stderr still appear on the terminal when we access the ...
user avatar
1 vote
2 answers
455 views

Spawn a terminal and redirect its stdout to original process

I'm trying to spawn a new terminal, execute a few commands and pipe their output to stdin of the original process. A mwe of what I'm trying to do is the following bash one-liner: $ xterm -e sh -c &...
user avatar
  • 347
0 votes
1 answer
618 views

The linux boot message in dmesg doesn't output to uart

My problem is my linux is success for boot but there is no more boot message output to uart(ttyPS0) after "Starting kernel...". As you can see in the pic, there is a lot of boot message in ...
user avatar
-1 votes
1 answer
47 views

Downloading a file with a trivial name without overriding a possible existing file with the same name

In CentOS with Bash I download a file with a very trivial file name, install.sh. Although extremely unlikely in my scenario, this could still, in theory, overwrite some existing file with the same ...
user avatar
0 votes
1 answer
50 views

how to get split commands output to file

I want to print output of below command to file, can you help me I tried 2>&1 even 2>> also dd if=/dev/random bs=1 count=1000 status=progress |split -b 10 -a 10 I have other dd command ...
user avatar
  • 31

1
2 3 4 5
9