Questions tagged [output]

The tag has no usage guidance.

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

grep of executable commands with variable

Have a file with thousands of lines like so : echo " device " ; login 'command' ip > device_command" $(date +"%Y_%m_%d_%I_%M_%p")".txt I run my script like so: ./script.sh | grep "device" ..in ...
1
vote
1answer
45 views

How to save command line screen output in Linux after running program?

I ran a program that has a good amount of command line output, and it ran on a screen in a ssh server. I referred to this post so that I can scroll through the screen and see the output, but there is ...
2
votes
0answers
24 views

Why does my touchpad stop working when I plug in my (normal, non-USB) headphones?

It's the darnedest thing. And only started happening within the last two days. Whenever I plug in my 3.5mm AKG headphones into the appropriate spot on my Acer Chromebook 15 CB3-532 running Ubuntu 18, ...
0
votes
1answer
67 views

Clean formatting of output within bash scripts

I ran across a problem formatting the output during runtime while preserving the format of the code in some scripts. The below works for me, just wanna check that it's reasonable? It seems to dirty up ...
2
votes
4answers
289 views

Next command output on the same line? Bash script

I have the following simple script: echo "-------------------------- SOA --------------------------------" echo " " echo -n " ---------> "; dig soa "$1" +short | awk '{print $3}' The output is ...
1
vote
1answer
64 views

Grep: separate output into two column and save them into txt file

In a directory, after running ls -d -- 0.*_*.txt | sort -t. -k1, I obtained output filenames such as 0.230_0.203059.txt How can I further writing each of them into two columns like 0.230 0.203059 ...
0
votes
1answer
89 views

Sybase query: save output to a file

I´ve created the following script: #!/bin/bash isql -U databasename_dba -P password -b <<EOF! select quantity, date from name_table where numer_id="1234" go quit EOF! ...
0
votes
2answers
68 views

Print lines between two patterns one by one

My sed or awk can print line between two patterns, but how can I make it display one by one? Example - It should display the first part of the output, and when I press Space it should display the 2nd ...
0
votes
1answer
65 views

How can I search terminal output?

Say I type git help to learn about the merge command. I don't want to read all the output just the lines that contain merge and their surrounding lines. I thought this would be a common question but ...
1
vote
1answer
36 views

Output fdisk bash command to multiline variable

I can't seem to figure out how I can put a fdisk command from a bash script in a multiline variable. Here is my code hdds="$(sudo fdisk -l | grep "Disk /dev/sd" | awk '{print$2}' | sed 's/://g')" ...
0
votes
2answers
30 views

Echo shell log while entering and then exit

While I type a command, this command will authenticate with a remote server and do a bunch of things. If pass, it will give me a bash shell with its environment. My goal is to save these log which ...
0
votes
0answers
28 views

GRUB 2.02 - no output in command line mode

When I am entering GRUB bash-like console mode and entering commands ls ls -lh to show available partitions there is no output. Following similar question @ Unix&Linux Stack, I already turned off ...
0
votes
1answer
116 views

awk save value as variable

I use the command varioutput=$(awk '{print $j}' OFS=, data/damper.test_temp1.csv) because I want to extract the j th value of a line of many values seperated by , . But when I want to use $...
0
votes
1answer
33 views

Find string and make it bold in output E-mail

i have below code which check status of some services on linux rhel 7 and send email (output is different service status). i want to make specific string called "up" and or "NOT up" in bold and with ...
0
votes
1answer
42 views

Formating grep output [closed]

I have website on my hard drive that I need to locate keywords within the HTML files, then output to an html file, listing each find on a new line. Currently i'm useing the line below, but the output ...
0
votes
0answers
71 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
72 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
33 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
34 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
75 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
39 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
35 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
189 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
883 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
341 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
25 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
18 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
218 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
904 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
57 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
31 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
635 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
88 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
39 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
352 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
219 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
319 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
136 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
105 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
1k 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
54 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
24 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
463 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
537 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
222 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
1answer
67 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
4k 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
79 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
613 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
97 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 ...