Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
The results are in! See what nearly 90,000 developers picked as their most loved, dreaded, and desired coding languages and more in the 2019 Developer Survey.

Questions tagged [output]

The tag has no usage guidance.

0
votes
0answers
14 views

What ps WCHAN sync_b means?

I have this ps output: F S UID PID PPID C PRI NI ADDR SZ WCHAN STIME TTY TIME CMD 0 D root 30394 30390 0 80 0 - 25731 sync_b Apr07 ? 00:12:22 du -sh /poze/output ...
0
votes
2answers
43 views

Maintain color from script output for later viewing

I want to save the output from a script so I can view it later. However, when I save the output to a file (script > some/file) and view it later, there's no color, even though script originally ...
0
votes
1answer
17 views

How to choose between sound outputs without unplugging hardware?

I am currently running the following: 4.15.0-46-generic GNU/Linux Distributor ID: LinuxMint Release: 19.1 Codename: tessa I have my headphones plugged into their dedicated port, however, I ...
0
votes
1answer
20 views

Running command on each line of output immediately [duplicate]

I found out that when I run a command which executes a software that has continuous output lines e.g. traffic monitor like tcpdump or tshark the command keeps counting numbers on screen like 4, 8, 12 ....
1
vote
1answer
66 views

How can I know the type of each element in the output of ls -l?

I was checking what exactly each field is in the output of ls -l. The example in this post solves my question. But again I'm wondering what type of each field is. The strings are obvious. But how ...
1
vote
1answer
29 views

Show only the really extracted (non-skipped) files using tar

I'm extracting daily backup archives. I want to see only the new files since the last day. The archives contain lot of already existing files, which I don't want to overwrite, so I use the --skip-old-...
0
votes
2answers
23 views

Showkey with timestamp

How can I record keyboard actions with the timestamp, either to console, or preferably to a file? I have showkey output like: keycode 28 release keycode 30 press keycode 30 release keycode 48 ...
-2
votes
1answer
110 views

CTRL+D vs CTRL+C

Is it true to say that CTRL+D stops input execution while CTRL+C stops output displaying (as plain data, without execution)?
5
votes
1answer
809 views

What's going on with this dash '-' thing?

I was trying to export the Python environment requirements and this is what I intended to do: conda list -e > requirements.txt However I mistakenly typed this instead: conda list -e -> ...
0
votes
1answer
101 views

make json from SQL query output

I have this query: select hostname,size from tableinfo output is like this: hostname size ------------------------- ----------- host1 28 host2 ...
0
votes
1answer
22 views

How to print the version of a specific MediaWiki installation to terminal

I have a LAMP environment with /var/www/html/x which is a MediaWiki website. I have a few more MediaWiki websites but I'd like to print the version of the x one to terminal. I need to do so I could ...
0
votes
0answers
17 views

df -h inaccurate output [duplicate]

when I hit the command dh -h in my shell I'm confused why I get an inaccurate answer for / which is 29G. by inaccurate I mean the summation of avail which is 8G and Used which is 20G is 28G but the ...
0
votes
2answers
141 views

Output colored text in all major distros without using non-word color codes (like \033[0;31m)

I found these ways, for example, to output colored text in a simple way to the screen: RED="\033[0;31m" # Red color (via ANSI escape code); NC='\033[0m' # No color (via ANSI escape code); echo -e "${...
6
votes
3answers
809 views

How can I output a command to a file, without getting a blank file on error?

I'm trying to run a command, write that to a file, and then I'm using that file for something else. The gist of what I need is: myAPICommand.exe parameters > myFile.txt The problem is that ...
0
votes
2answers
50 views

Reduce space between numbers and paths in “dirs -v” output

I feel like the space between the numbers and the paths is too much and I believe that less space would make lines easier to follow. Is there an easy way reduce that space?
0
votes
1answer
28 views

Shellscript `grep` execution not working as in the interactive shell

Having to deal with an environment where ack and so on is not available nor installable, this command try to limit only relevant files to find string through the C++ project : grep pattern --color --...
5
votes
4answers
455 views

How to treat a command output as text

I need to compare a command output with a string. This is the scenario: pvs_var=$(pvs | grep "sdb1") so pvs var is: /dev/sdb1 vg_name lvm2 a-- 100.00g 0 if [[ $($pvs_var | awk '{ print $2 }') = ...
0
votes
2answers
63 views

What does <F6>q mean in ls command output?

I used ls ~ on RHEL 7 but I got <F6>q as output! What does it mean? [user@server2 ~]$ ls /home/user/ <F6>q [user@server2 ~]$ ll total 4 -rw-r--r--. 1 root root 340 Sep 18 17:16 <F6>...
0
votes
1answer
26 views

Directly play input sound (Mint)

I recently set up a Linux Mint 18 machine, which has an electric piano plugged into it via a USB sound card. Now, the input works: we can record sounds from the piano; and the output works as we can ...
1
vote
2answers
154 views

Understanding sudo and possible exploit

I'm doing some hands on pen testing and following some guides to get an understanding of the tools of the trade. I'm following along with the guide here and I understand everything except for the last ...
2
votes
0answers
41 views

How to input from headphone mic, output to built-in speakers

My laptop (Kubuntu 18.04) has only a single sound card. I want to take input from the Mic of the headphone I connect but get the output to the built-in speaker of the laptop. I can toggle input (...
1
vote
1answer
117 views

htop - See/Filter all the instances of a binary

I have a binary that I will be running multiple times in parallel, each instance executed with different input from the command line. I wanted htop to list only these processes so that I can compare ...
3
votes
1answer
92 views

Get latest output of a running command

I have a command running for a long time, which I don't want to disturb. However, I would like to keep check on the process (most of the time remotely). I am constantly monitoring the process via ...
1
vote
3answers
87 views

Bash output two results next to each other

I have an out from xmllint and egrep that I would like to print two fields next to each other. e.g. (xmlinput) xmllint --format | egrep reference\|sourcefile <reference>ItemX</reference> &...
13
votes
2answers
911 views

What prevents stdout/stderr from interleaving?

Say I run some processes: #!/usr/bin/env bash foo & bar & baz & wait; I run the above script like so: foobarbaz | cat as far as I can tell, when any of the processes write to stdout/...
-1
votes
1answer
52 views

Why output is on the prompt line?

$ echo 'hello world' > >(wc) $ 1 2 12 █ Why output is on the prompt line and not in the separate line below? Also why expects input at the end? Since, the command below works fine ...
1
vote
0answers
23 views

hide results that echo in if conditional [duplicate]

I have the next script: host=$1 port=23 user= <user> pass="<pass>" cmd1='show int descrip | i TRUNK|BBONE' #cmd2=exit ( echo open ${host} sleep 1 echo ${user} sleep 1 echo ${pass} sleep ...
1
vote
1answer
160 views

python script output won't be directed to file

I have a python script. It has a SimpleLogger with sys.stdout as output_stream. logger = SimpleLogger(level=LogLevel.DEBUG) When I run it in console, I get the logs properly, but whenever I ...
7
votes
5answers
508 views

Bash: How to store a specific line of CLI output into a file?

Let's assume I receive the following output after executing a bash script in CLI (so this text will be displayed in terminal): POST https://mycompany.com/ COOKIE='BLABLABLABLABLA' HOST='ANYIPADDRESS' ...
4
votes
1answer
89 views

How to see from which file descriptor output is coming?

How to see from which file descriptor output is coming? $ echo hello hello $ echo hello 1>&2 hello all are going to /dev/pts/0 but there are 3 file descriptors 0,1,2
1
vote
0answers
53 views

Waiting for async console (message queue) output after invoking a command [closed]

I have to work with a command (lets call it update) which somehow prints its output asynchronously to the terminal (mq_timedsend). The output is not recognized as the commands output and therefore the ...
1
vote
1answer
48 views

Outputting context (-C) for grep produces massive files

Task: I'm using grep to search some text files, piping the results from one grep (excluding some lines) to another (matching some lines) + displaying some context using the -C parameter as shown ...
1
vote
3answers
2k views

Changing audio output from terminal

I have a Xonar DGX card, and I can change the audio output with alsamixer by going to the Analog Output option and switching between Stereo Headphones and Stereo Headphones FP. How can I do the same ...
3
votes
2answers
57 views

How can I save a scrollable terminal window (RoxTerm) into a png image?

I would like to save a Ruby program coloured terminal output into a png file, output doesn't fit into the screen height, so it is scrollable. Is it possible to save the whole or part of the scrollable ...
5
votes
2answers
457 views

Write string to a file without a shell [closed]

Suppose I have an environment where there isn't a shell running, so I can't use redirection, pipes, here-documents or other shell-isms, but I can launch a command (through execvp or some similar way). ...
1
vote
1answer
49 views

ffmpeg truncates paths on output when there are dots involved when run on bash

If I have a path with dots in the path, for instance: /home/user/Documents/hello/test.testing_23-24.123/test.testing_23-24.124 ffmpeg can locate the file if you pass the file's path as an argument ...
1
vote
1answer
342 views

How to create a list of email addresses from ldapsearch result for further processing?

For an automated mailing and to notify user, respective members of a specific group, I am looking for commands or a single command line which provides a list of email addresses and which can be used ...
1
vote
1answer
2k views

I need to ping a list of ip addresses from a file and log the status as “up” or “down”

I am needing to ping a list of host addresses (non-sequential) and log the output as "up" or "down". I've got a start but my script seems faulty. For example. when i run the following script ...
2
votes
1answer
1k views

ps: get short command name and elapsed time

I am on a Debian 8 System trying to determine the processes and their respective runtime of a certain user: $ ps -u <user> PID TTY TIME CMD 26038 ? 00:00:00 php5-fpm 26052 ? ...
0
votes
0answers
43 views

Shell script to iteratively run an executable and move resulting files to a storage directory?

I'm running some simulations and am trying to move the results to a storage folder. I've written a shell script: #!/bin/bash g++ -(some flags) -o out file.cpp for i in {1..20} do ./out $i mv ...
1
vote
0answers
25 views

Understand kernel task names [duplicate]

If I have something like this: root 27 0.0 0.0 0 0 ? S 04:06 0:00 [migration/3] root 28 0.0 0.0 0 0 ? S 04:06 0:00 [ksoftirqd/3] root ...
1
vote
2answers
66 views

Pump command output as function argument

I have this extremely simple function in my script: # Used for debug tracing. log() { : echo "log: $1" } The idea is to be able to customize/turn off logging at a single place. Very crude. ...
2
votes
1answer
127 views

How to listen to a daemon output?

I have a daemon that prints some information on to the terminal. I can see these informations by typing: systemctl status bot.service, this is working well, but this command doesn't listen to the new ...
0
votes
5answers
61 views

How can I split a line that contains an underline with awk?

I have this line, but I want each part of it separated and I want this separation to be done with awk. The original line is the following: 3302491505_8139829707_13970101.csv and what I want as an ...
0
votes
1answer
44 views

Need output in separate lines- Shell Script

I wrote this script for logging emails if disk-space is more than 90. Please help me get the output in separate lines. Here is my code: #!/bin/bash errortext="" EMAILS="abc@xyz.com" for line in `...
1
vote
2answers
664 views

Aligning output in Linux paste command

How can I make the second file in a paste start in the same spot regardless of the length of the line in the first file? For example: file1: small incredibly humungous file 2: A B I want paste ...
0
votes
0answers
161 views

See other process previous output with strace

Fedora installed Accessing machine through PuTTY. Somewhere I found that I can see process output by strace -p <pid> -s 9999 -e write But this way I cannot see previous output, only ongoing. ...
0
votes
2answers
483 views

how to display lsb_release info in Conky?

i'd like to display the output of lsb_release -ds in my Conky display. ftr, in my current installation that would output Linux Mint 18.3 Sylvia. i had thought of assigning the output of that command ...
3
votes
1answer
287 views

Why is shell treating a part of the output of $(<file) as a command?

I saw this line while reading a blog on IFS that is : for i in $(<test.txt) And thought that $(<test.txt) prints the file contents to STDOUT. I maybe wrong in this, but out of curiosity I ...
1
vote
1answer
382 views

How to output SSH commands that are being sent to a server

I have a script that connect to a Network device. It runs some commands and basically I want to output the SSH commands that are being executed. To make myself clearer, I connect to one device, ...