Questions tagged [stdout]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
0answers
33 views

Accidentally ran wget -O-, and it outputted stdout to terminal

Accidentally ran wget -O- https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-boost-8.0.22.tar.gz with the -O- thing, and it outputted random stuff to terminal. Is it possible that it could've done ...
0
votes
1answer
29 views

How to use find command and filter error messages

I'm running this command : find / | grep corectrl | grep log And I get a lot of permission denied errors and I would like to send stderr to null
1
vote
1answer
138 views

Pipe password argument to mount shell command

Status quo Given are following /etc/fstab mount points: //server/app /home/user/server/app cifs noauto,user,vers=3.11 0 0 //server/code /home/user/server/code cifs noauto,user,vers=3.11 0 0 These ...
2
votes
1answer
3k views

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:...
4
votes
4answers
1k views

How to redirect the output of a command to a function but suppress the error and output to console?

I need to redirect the output of a command that I am running to a log file with timestamp (hence a function instead of the log file itself) but the error and the output, both should not be showing in ...
1
vote
2answers
137 views

(K)ubuntu 19.10 can't print text files from console

I have trouble with printing system on my Kubuntu 19.10 I tried so many things that i can't track completely, but the following is the core of the problem. $ echo "test" | lp -d Boomaga request id ...
0
votes
0answers
36 views

Redirect output to the terminal screen AND to a file without tee?

I am currently using a tool called probequest for pentesting. I want to see the realtime output as wel as writing it away to a log file realtime. Sadly the output from probequest stops showing if i ...
1
vote
1answer
65 views

Failing to Redirect Output to File

I want to redirect output from "time" to a file. However, my attempts to redirect stdout, stderr, or both, are not working. For example, when I use: time python process-column.py 2>/tmp/times....
7
votes
2answers
1k views

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/...
1
vote
1answer
330 views

SSH local STDOUT to file on remote server

I need to copy output from local command to remote server f.e: user@localhost$ ls | scp - user@remotehost:/user/remotefile got an error: -: No such file or directory sorry, but a cannot identify ...
2
votes
0answers
48 views

OS laggy after echoing a string in file descriptors 0,1,2 (stdin, stdout, stderr)

I was trying to exploit capacity leaking to a C program (see below), by taking advantage of the non-existence of fclose() function to a file, that the program previously opened. In short, the ...
1
vote
0answers
37 views

Is there a terminal utility that I can use to 'occasionally' record stdout for long running processes?

An example would be the badblocks. Just now I was using it as sudo badblocks -sv /dev/sdb This utility takes a long time to work. Particularly for large disks from years ago that aren't in the best ...
5
votes
2answers
887 views

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:...
13
votes
3answers
3k views

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 ...
-2
votes
1answer
97 views

What is the stdout output in stream-redirection labs?

Inside the ‘stream-redirection’ folder there is a program called ‘program’. When you run this it will output to stdout and stderr. What is the stdout output? I have tried ./program, but it did not ...
3
votes
1answer
284 views

Bash file redirection bug?

From what I understand about program IO, there are stdin, stdout, and stderr data streams (and a return code). stdout and stderr are the two data output streams. So if I use bash redirection to close ...
0
votes
0answers
80 views

need help with commands in terminal [duplicate]

I am stuck trying to figure this out. the question for my homework goes like this: For this question, run the script at /var/standardStreams.sh. This script will create some output text on different ...
1
vote
0answers
127 views

Print netplan config

Does netplan have any options available for writing how it interprets its config files to stdout, an arbitrary directory, or something similar? The context for my question is that I'm updating a ...
0
votes
0answers
72 views

Output logs to dynamically created folder structure (based on the current date), using upstart to create the service

I have the following upstart configuration: start on runlevel [2345] stop on runlevel [06] respawn respawn limit 99 5 #respawn is used to start the nodejs again, even if it fails. env NODE_ENV=...
0
votes
0answers
317 views

Error message was neither redirected to STDERR nor to STDOUT, but it was really exist when output logs to screen?

The following commands were ran in Ubuntu 16.04 and the version of python is 3.5. When I ran the python routine without data redirection python3 opt_CNN2_dense.py Screen output ResourceExhausted ...
0
votes
0answers
184 views

Communicating with background service

I have a process registered as a service running in the background which occasionally logs to stdout. It is some linux executable which, if run in the foreground, can receive user commands and respond ...
1
vote
2answers
737 views

bash retry function with silencer

I found a bash function, that let's me retry commands. function retry { local n=1 local max=50 local delay=1 while true; do "$@" && break || { if [[ $n -lt $max ]]; then ...
0
votes
2answers
1k views

Git produces output in realtime to a file but I'm unable to echo it out in realtime directly in a while loop

What I want My actual long term goal is bypassing all the output of a git process into another function (in order to make a progress bar - see my older question for more details about that). What I'...
3
votes
2answers
19k views

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 ...
0
votes
0answers
153 views

Pipe stdout through sed or awk command BEFORE redirecting to file? [duplicate]

I am still kind of new to programming, but willing to learn: I am struggling with a problem in following project: I am logging analog read-outs of an Arduino board. The Arduino board sends tab-...
0
votes
0answers
253 views

How to stop file-roller from outputting anything and hanging on the process

I'm writing a program that uses file-roller to extract an ISO file. However I keep getting a warning and I don't want to see this warning. Also file-roller hangs after this warning. Gtk-Message: ...
2
votes
1answer
2k views

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 (...
0
votes
1answer
800 views

grep in bash-script doesn't print message in log file

I'm trying to write the output of a command to a log file using grep: ./exeFile dir1/file.conf | grep textError > logTest.txt & But it doesn't write anything to the log file. If I use ./...
1
vote
1answer
101 views

How to write the most recent line of a process to a readable file

I’ve got a question for you that is theoretical. While running a process in the terminal I often just care about the most recent last line. And I want to call the data in that line from another ...
3
votes
2answers
2k views

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 ...
1
vote
1answer
6k views

How do I save a shell's stderr and stdout to a file while still having it output to the terminal window? [duplicate]

I need stdout and stderr to a file, and my shell simultaneously. command > file.txt, the usual goto, will not output stderr to the file, nor output stdout to the terminal. command > file.txt &...
0
votes
1answer
53 views

How can I set the terminal to not automatically go to the last line if there the output in the terminal has been updated?

I have some programs that are continuously outputting data on the terminal. I however want to be able to scroll up and down while the program is outputting all this data to the terminal, but every ...
0
votes
1answer
271 views

How to use the output of ettercap

To encrypt tshark output, I use tshark -w - | gpg -e > capture.pcap.gpg How do I do the same for ettercap? This command does not work ettercap -M arp -w - -T //// | gpg -e > capture.pcap....
3
votes
2answers
2k views

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 ...
3
votes
2answers
14k views

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 ...
-1
votes
1answer
95 views

Some programs print errors to stdout instead of stderr, and don't set $? when an error occurs. Why? [closed]

See title. I've seen this twice recently, with both udisks and pacmd, and they are 100 times harder to script because of it. Why do programmers do this? For example, I want to switch the audio output ...
1
vote
1answer
63 views

Why is stdin/stdout failing with gplay on ubuntu?

I am trying to change gplay's volume level programmatically in a Java app. The video plays fine; I see gplay's menu; I get my first "Playing" prompt, and I write a "v" for "[v]Volume" but I never see ...
3
votes
1answer
439 views

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....
0
votes
1answer
204 views

run a command, send output to mail with stderror colored

I have a script that writes to the STDOUT and STDERR. I can pipe the script to mail so it sends me an email of the output. What I want to do now is have the STDERR of the output colored such that the ...
0
votes
1answer
80 views

Why does man -P behave differently when the output is redirected or piped?

man -P whoami ls This command will output user's name, just like whoami. But when you use pipe to redirect it to a file or to your screen like man -P whoami ls | cat or man -P whoami ls > file, ...
1
vote
0answers
605 views

run a process in background and give stdout for it even if terminal is closed

I found some link here(Hide stdout of a process only when it is running in background) about redirecting running process' output but my case(a module logging to stdout) is a bit different. Cause I am ...
15
votes
2answers
8k views

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 Server [Service] Type=simple ExecStart=/opt/foo/.cabal-...
2
votes
1answer
2k views

How to copy the stdout of a command to the clipboard in a default Ubuntu installation?

I ran up against this question, and i found it quite interesting. While researching for that, i found out that a solution had been posted already here on AskUbuntu, plus multiple times on ...
0
votes
1answer
162 views

Upstart and isstty(STDOUT_FILENO)

Many Linux programs use istty to determine whether STDOUT is a terminal or not. For example, ls will (by default) suppress coloured output if it's redirected (istty == 0). When running upstart jobs, ...
0
votes
1answer
62 views

Could someone explain what the following command does?

Could someone explain me what the following command does? find / > allfiles.txt 2>/dev/null
1
vote
1answer
165 views

untar content of folder from tar.gz archive that gets data from STDOUT (wget)

I want to extract the content of a single folder from a tar.gz archive that gets its input from the STDOUT of wget. My command looks like this: wget -O - http://example.com/file.tar.gz | tar -C /...
1
vote
2answers
4k views

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 ...
3
votes
1answer
1k views

When piping output to a file, why are stderr and stdout in the wrong order?

I have a perl script: warn "1\n"; print "2\n"; warn "3\n"; print "4\n"; I pipe the output to a file: perl script.pl &> foo cat foo: 1 3 2 4 Why isn't the output in order, and how do I fix ...
331
votes
5answers
547k views

What does 2>/dev/null mean?

I would like a brief explanation of the following command line: grep -i 'abc' content 2>/dev/null
0
votes
1answer
2k views

“Bad file descriptor” with /dev/stdin using dd

I've been using this method (Running off a live CD on both ends, and in root shell, as suggested in another of my questions) to clone one computer I've got set up to my liking to four others with the ...