The tag has no usage guidance.

learn more… | top users | synonyms

1
vote
1answer
20 views

How to get file descriptor number of a output and how to redirect all of them at once

Lets take this command for example $ time ssh ec2 ls www apps real 0m0.554s user 0m0.004s sys 0m0.000s $ time ssh ec2 ls 1>/dev/null real 0m0.554s user 0m0.004s sys 0m0.000s ...
1
vote
1answer
43 views

script Multiple Commands

I have a PHP script I'm running from Cron. I want to save its output to file, but also want to save the shell output to a different file. Ideally, I'd like to have this in one line. As such, I tried ...
0
votes
1answer
33 views

How to check if process completed successfully or if there are any errors?

MYPROGRAM > output.out 2> output.err The two files will be generated: output.err and output.out. Surely after a job is completed its process ID no longer exists, but how can I check if it ...
0
votes
1answer
29 views

Don't know if fsck failed or not

I just ran fsck on my newly bought SD card for my Raspberry Pi and it shows the following output: fsck from util-linux 2.25.2 fsck.fat 3.0.27 (2014-11-12) /dev/mmcblk0p1: 75 files, 2539/7673 clusters ...
0
votes
2answers
29 views

Shell script - blanks are not always recognized as such?

I'm confused on how bash interprets blanks while executing a script. In the end, I want a script that is fed by a csv file containing software used by an organisation and it should return the CVEs for ...
2
votes
2answers
42 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 ...
1
vote
1answer
60 views

Redirect Output of Pocketsphinx_continuous to a file

I have an ugly command: pocketsphinx_continuous -samprate 48000 -nfft 2048 -hmm /usr/local/share/pocketsphinx/model/en-us/en-us -lm 9745.lm -dict 9745.dic -inmic yes Breakdown: It listens for any ...
2
votes
2answers
63 views

Is it possible to show rsync output on a single line?

I have a bash script that is rsyncing a large directory and the --progress function is great, but is it possible to show all this output on a single line? ie. as the files transfer, just spit it the ...
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 ...
0
votes
3answers
50 views

sudo iwlist wlan0 scan | grep ESSID > essid.txt (How do I export without the word ESSID in txt file)

So my goal is to answer my other question I am working on. Which is Connect to Open Wifi. Currently I am getting close, as I know there is only one Wifi connection, I would like to export the results ...
19
votes
3answers
679 views

How to prevent random console output from breaking the terminal?

There are many questions on SE that show how to recover from terminal broken by cat /dev/urandom. For those that are unfamiliar with this issue - here what it is about: You execute cat /dev/urandom ...
0
votes
4answers
31 views

Loop a program if the input is missing

I have this script that runs perfectly well, I would however like to re-run the script if the wrong input is entered, how could this be done? #! /bin/bash #! userInput - a script that reads in text ...
-3
votes
1answer
27 views

Output the result of a variable

I have an if statement and I want in one case to add one to a variable v and in the other case to a variable inv. I did the following v=$((v + 1)) and inv=$((inv + 1)) I want to outputs the results of ...
0
votes
1answer
35 views

Show only graph in htop output

Would it be possible to show only the summary section of htop output? desired look: I have looked into the manpages but couldn't find any options to do so. The closest thing i have found is ...
1
vote
3answers
49 views

How use an if statement to change the output message

When i run this command it still outputs the same message when nothing is in the waste bin directory, how could I get the command to output a different message when there are no files in the bin? ...
1
vote
1answer
39 views

Pretty print output of “kill -USR1”-ing dd

When dd is done it prints a three line summary about the number of read and written segments, the total size and average writing speed. While it does its work, dd is awfully quiet. Not too long ago ...
1
vote
2answers
12 views

Watch: Only print to screen if output has changed since last output

I'm running a process and I'm counting the number of threads with ps huH p <PID_OF_U_PROCESS> | wc -l I can run this thread with watch like this; watch -n 1 ps huH p <PID_OF_U_PROCESS> ...
2
votes
2answers
33 views

How do I write the output of Portage to a txt file?

I would like to be able to write the output of Portage commands, along with other commands, that I perform in tty (that is, the screen-wide terminals started with Ctrl+Alt+Fn where n represents an ...
1
vote
0answers
22 views

cups: connection timed out

Per title I'm showing connection timed out in the /var/log/cups/error_log. D [29/Oct/2015:17:43:32 -0400] cupsdSetBusyState: Printing jobs D [29/Oct/2015:17:44:04 -0400] [Job 11441] Connection ...
1
vote
1answer
151 views

Get the output from expect script in a variable

I have an expect script which provides the IP address: #!/bin/expect -f set nodename [lindex $argv 0] spawn virsh console $nodename expect "Escape character is" send "\n" expect "localhost login: " { ...
2
votes
1answer
26 views

combining output from different scripts into different files in a loop

First of all: I hope the question is comprehensible, otherwise please let me know and I will do my best to make it more clear. This is a follow up to Replace one entire column in one file with a ...
1
vote
2answers
575 views

Permission denied on file under /tmp

I have a bash script that reads filenames, takes a selection of data, build a table, and then adds the header. Unfortunately, at the point to add the header and give the output file, I have the ...
1
vote
1answer
87 views

Trim monitor output (because of dead pixels)

I searched a lot and finally came here to ask my question. Recently my screen got damaged and now has some rows of dead pixels. They are located at the very top of the screen and making it very ...
5
votes
1answer
182 views

Show output on terminal and output to log file, without using tee

I want to run a command, then show the output on the screen as well as output it to a log file, currently I use tee -a, but the problem is tee doesn't preserve colours, and currently I have not been ...
4
votes
1answer
92 views

Non-standard sorting of the ls output

I usually include a date in the filename so that files and directories are listed in chronological order when I use the ls command, e.g. 2015-08-29_letter_to_santa.txt. A drawback is that ...
1
vote
2answers
107 views

Can bash shells automatically recognize Gnome terminal window's width?

/bin/less is the default pager on an Ubuntu 14.04.3 LTS desktop OS (the $PAGER variable is unset) and gnome-terminal 3.6.2-ubuntu1 is used. If I try for instance: $ man man The displayed output ...
0
votes
2answers
93 views

wget, logging the output and the response

I calling an url using wget. This url gives me a response, its a Message id. I want to write the logs to a log file, with the message id as well. Also the log should be appended each time. I trying to ...
0
votes
2answers
95 views

Bash output command too large, can't read it!

I'm having some troubles on Ubuntu 14.04 initialization, it fails to mount an SSH folder and gives me the option of a manual recovery by pressing M, displaying a command-line logged at root user for ...
-1
votes
1answer
42 views

modify perl output [closed]

currently I have the following script #!/usr/bin/env perl use strict; use warnings; my %seen; my $header = <> . <>; print $header; my $last_sequence_number = 0; open( my $output, ...
1
vote
1answer
63 views

How do I prevent the Keyboard Interrupt from being sent through the Screen program

I am making a python program, whose output (not input) can be viewed via the screen program. However, the problem is that doing this allows the user to turn off the program via the Keyboard Interrupt ...
2
votes
1answer
146 views

Source .bashrc in zsh without printing any output

In the past, I've used bash consistently, because it's everywhere. But recently I started to try zsh. I don't want to give up updating my .bashrc fil which is rsync'ed to all my servers . So, in my ...
6
votes
3answers
286 views

Silent GnuPG password request with bash commands

I'm trying to hide the "output" of a gnupg command, but it seems that it is always printed. the command is: echo "thisprogramwørks" | gpg -q --status-fd 1 --no-use-agent --sign --local-user D30BDF86 ...
0
votes
1answer
81 views

Verbose output missing when executing a script as CGI

This is my shell script #!/bin/bash echo "Content-type: text/plain" echo "" sshpass -p $pass ssh -v -p $port -t -o StrictHostKeyChecking=no root@$ip "cd / && ls && exit" It can be ...
1
vote
3answers
55 views

How to grep between words in a log?

I have a txt file with lines like below. Starting With: Parameters: {"raw_message"=>"MSH....... Ending With: </HL7Message>"} I'm wanting to grep and output to a file the words between ...
0
votes
1answer
264 views

How to capture the output of the strings command? [duplicate]

How do I capture the output of the strings command into a .txt file from the command line?
0
votes
0answers
83 views

Awful sound through speakers in Elementary OS

I just recently installed Elementary OS Freya on my Alienware 14, double booting with Windows 8.1, but I've come against a new problem, the sound that comes out the speakers is just awful, just too ...
0
votes
0answers
179 views

SCP won't copy files due to output in .bashrc

I just uploaded my linux (mint to v. 17.1), and now I cannot upload files to a cluster via scp anymore. I understand that .bashrc cannot output anything during the process for it confuses scp, so when ...
4
votes
1answer
3k views

Save all the terminal output to a file

Is there some way of saving all the terminal output to a file with a command? I'm not talking about redirection command > file.txt Not the history history > file.txt, I need the full terminal ...
0
votes
0answers
100 views

output test results of smartctl into logfile

I set up a cronjob that executes the following script: #!/bin/bash smartctl -t long /dev/sda smartctl -A /dev/sda >> /smart-logs/$(date +"%Y-%m-%d-%A_SMART-report") echo "---------" >> ...
2
votes
2answers
75 views

Cron job is writing the error to error log but fails to write outputs to output log file

I have 2 python codes which i schedule using cron. My codes actually runs from 10:30am to 4:20pm everyday. from 10:30am to 11:00am my codes outputs 2-3 lines every minute and after that they start ...
3
votes
1answer
127 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 ...
0
votes
0answers
11 views

Result of find in multiple columns [duplicate]

I frequently use find and often the results scroll up the screen while a sizable portion of screen is unused. Is it possible to get the results of find in two or more columns, similar to those of ...
0
votes
1answer
39 views

append file with history line number values

Is there a way to append my_computer.sh with the command on line 330 by only referencing the line number? or with the fewest keystrokes possible? 326 pip install -U pip 327 man pip 328 cat ...
0
votes
0answers
19 views

Grep not writing output until end of input [duplicate]

I have some script that is taking a long time, and producing a lot of output. I want to send the full output to one file, and pick out some specific lines to be directed to another file. Since it ...
1
vote
2answers
106 views

How to view a daemon's output in a session on Raspbian/Debian?

Okay I'm pretty new to Linux and I have setup a Raspberry Pi 2 with Raspbian and it's running a bunch of things for tracking aircraft as well as a receiver (RTL-SDR). It's all working great and I'm ...
-2
votes
1answer
51 views

Using 'grep' to search for a specific pattern [duplicate]

I'm playing with the Linux terminal and I have to do a exercise which states that I have to find inside a file for any line that contains at least an a, b and c, it doesn't matter it the lane has 2 a, ...
2
votes
1answer
184 views

exec redirects in bash

I write a lot of non-interactive scripts where I would like all output to go to a log file and have nothing appear on-screen. To solve this, I've been using: #!/bin/bash exec &> logfile echo ...
2
votes
2answers
2k views

Using the output of `grep` as variable in second command

I currently have 2 bash command line strings I use to gather data needed for a certain task. I was trying to simplify and have only one command used to gather the data without using a script. First I ...
1
vote
1answer
57 views

output log file from some time to some time via ssh

I have a access_log which size is neally 2GB. I want to analyze it from 2015:09:55 to 2015:09:57, but during this period, there have more than 500 items. So I want to output and download the ...
0
votes
1answer
80 views

exit status and no output

I have a command such that bar > /dev/null and I want to know the exit status of bar. I read some posts su about ${PIPESTATUS[0]} but this works when one pipes the output via | and I can't make ...