The tag has no wiki summary.

learn more… | top users | synonyms

0
votes
1answer
58 views

LS Command output to file [closed]

I want to capture to a file the output of the ls command ls >> lsOutput.log This one works if executed in the command line. But when put inside a shell script (lsOutput.sh), returns ...
1
vote
2answers
83 views

Redirect grep error output to file

I wanted to capture to a file the errors being returned on the command line from grep. For example, grep foo.lookup No such file in directory I want to output that to a log file. This is my shell ...
4
votes
1answer
78 views

Is there a way to cat files as they are created? [duplicate]

Unlike the answer to this question (Can a bash script be hooked to a file?) I want to be able to see content of files that haven't been created yet as or after they are created. I don't know when ...
3
votes
2answers
78 views

Can zsh access the stdout of last run program?

I often use find or locate to find out about paths. (~) locate foobar.mmpz /home/progo/lmms/projects/foobar.mmpz The next step is often to open or otherwise manipulate the files. In a happy case ...
1
vote
1answer
89 views

how do i redirect output from tailf & grep to a file [duplicate]

All I wanted is to grep for specific lines in an ongoing log and re-direct it to some file.. tailf log | grep "some words" Now, I want the above command output to get re-directed to some file in ...
0
votes
1answer
36 views

Need to grep for specific lines from ongoing log and save it in some file

So, let me start with the overall outcome that i want to achieve. There is just one log, which will have info on certain devices, that i am upgrading. I use "tailf log" to monitor the log. Now, ...
-5
votes
2answers
66 views

What is the utility of piping to `/dev/null`?

Seeing that /dev/null's utility isn't immediately obvious to me, what is the use of /dev/null piping?
0
votes
1answer
43 views

Log output of GNU screen in real time?

I'm trying to get the output of a GNU Screen to a log file in real time. I've tried using tee, but that appears to not work with screen. The log function for screen will not work for this as it is not ...
0
votes
0answers
21 views

How to start command in bash without blocking console [duplicate]

There is a problem with starting some commands in bash. When this command is starting its standard output blocked of entering other commands. And till this command do not finishing no other command ...
11
votes
3answers
799 views

How to redirect the output of any command?

I'm trying to write a simple script to monitor my network status, without all of ping's output: ping -q -c 1 google.com > /dev/null && echo online || echo offline The problem is that ...
3
votes
0answers
41 views

Slow terminal print out

Just installed (netinstall) debian wheezy on a second machine newer machine however the terminal print out is noticeable slower than on the old machine although the new have faster CPU, RAM and HDD ...
3
votes
1answer
100 views

Why does grep change the length of output lines?

I often use dpkg or aptitude combined with grep when I want to list certain packages available or installed on my system, but I noticed that when I add | grep, the output lines look a little bit ...
1
vote
5answers
140 views

Pass the output of previous command to next as an argument

I've a command that outputs data to stdout (command1 -p=aaa -v=bbb -i=4). The output line can have the following value: rate (10%) - name: value - 10Kbps I want to grep that output in order to ...
2
votes
2answers
80 views

Show a sliding window of output from a program

I want to run a command (rsync -av) and only display 10 lines of output at any time. I have found a similar post, but I don't want to redirect it to a file. I want the output to be displayed ...
1
vote
1answer
59 views

Using sed output in another script or command

How can I use the output of sed in another script? For example (this doesn't work): sed -n "$COUNTER",1p /domains.csv | wget or sed -n "$COUNTER",1p /domains.csv > /myScript.sh As far as I ...
1
vote
1answer
36 views

Check standard output of a background processs in real time

Let us say I submit a process in the background and I want to see the stdout and stderr. In another post it was suggested: command > logfile 2>&1 & But when I do head logfile I do ...
2
votes
2answers
134 views

turn off buffering for `hping` in OpenBSD

It would appear that the output from hping is fully buffered when piped to perl for further line-by-line processing, so piping hping to perl doesn't work. hping --icmp-ts example.ca | perl -ne 'if ...
2
votes
2answers
42 views

How do I echo a line with linebreak at the end at window border? [duplicate]

I would like to echo a list all in one line, TAB separated (like ls does with files in one folder) for i in one two some_are_very_long_stuff b c; do echo $i; done will print one line per word: one ...
10
votes
2answers
106 views

Resource friendly way to indicate to user program is not hanging

I have a Perl script on a *nix system which, at one point, is processing 50,000 + lines of text. This takes some time. I am trying to find a resource friendly way to let the user know the program is ...
1
vote
1answer
82 views

Pipe not picking up stdout

I am running a java program from a OS X 10.8 bash terminal, and are trying to rederect the output it is producing. However, when either running this throug a pipe, or rederecting it to a file, the ...
3
votes
5answers
162 views

How to grep, then search and replace on the output?

I have some output from iconv, e.g. $ iconv -l | grep ISO | head -5 CSISO4UNITEDKINGDOM// CSISO10SWEDISH// CSISO11SWEDISHFORNAMES// CSISO14JISC6220RO// CSISO15ITALIAN// durrantm:~ How can I change ...
1
vote
2answers
209 views

What stream does perf use?

What stream does the perf command use!? I've been trying to capture it with (perf stat -x, -ecache-misses ./a.out>/dev/null) 2> results following http://stackoverflow.com/q/13232889/50305, ...
1
vote
1answer
58 views

strange behaviour of strings command [duplicate]

I am trying to capture mysql traffic and pass those traffic to strings command as follows: tcpdump -i any -s 0 -l -w - dst port 3306 | strings This is working as expected and printing all mysql ...
2
votes
4answers
655 views

Pipe the output of a command if it is successful

INPUT_FILE=`ls -rt $MY_DIR/FILE.*.xml | head -1 | xargs basename` I wanted to execute the second command (head -1) only if the first command is successful. How do I improve this command?
6
votes
3answers
953 views

Why does this 'at' command not print to the standard output?

I am a relative Linux novice. I am trying to learn how to use at so that I can schedule tasks to begin at a later time, without using sleep. I have been looking at this previous question for help. ...
4
votes
1answer
66 views

How to concat file and a line on-fly?

I would like to send to the stdout entire file + extra line. How to do this nicely? So far I did: for LINE in $(cat $INPUT_FILE) do echo $LINE done echo $EXTRA_LINE How to do this bash way (for ...
2
votes
1answer
1k views

How to disable VLC output in command-line mode?

When I play music on vlc or cvlc in terminal or console there is always this (shown below) non-stopping output that prevents me from issuing commands by pressing ENTER key. I want to disable it, I ...
7
votes
2answers
599 views

how to output text to both screen and file inside a shell script?

Currently I have a shell script which logs messages to a log file like this: log_file="/some/dir/log_file.log" echo "some text" >> $log_file do_some_command echo "more text" >> $log_file ...
1
vote
1answer
87 views

Have aptitude search print full package name

Environment: aptitude called in a script. I'm having problems with this command: aptitude search '?virtual' |grep ^v |grep -v i386|sort|uniq In particular if I do: aptitude search '?virtual' ...
10
votes
2answers
205 views

Is there a way to mirror USB outputs?

I'm currently writing a program for a project. It is for a braille reading system where I have a braille display connected via USB that is controlled by a program called brltty. One of the ...
3
votes
1answer
175 views

How can I silence ssh-agent?

I have a script like this one at my .bashrc file at the mysuer home: eval `ssh-agent` ssh-add /path/to/my/key The problem is I have this output when I log with the user mysuer (su - myuser): Agent ...
1
vote
2answers
219 views

How to decrease ps aux output to a few lines?

When my computer is slowing down, I usually run ps aux --sort -rss to find out which process consumes too much memory. There may be a lot of processes. How to see only a few ones?
1
vote
1answer
84 views

Unsure about the behaviour of my script when writing to log file

I have a very simple ksh script and at certain points I want to write to a log file. I use the following commands in two places... print "Directory listing 1:\n" > ${LogFile} ll >> ...
2
votes
2answers
107 views

Using Diff with -y to get side-by-side output

I am trying to use diff with -y to get side-by-side output, but my output gets messed up after about 18 lines. Here is an example, any clue why? (Check from *.java_pool_size=134217728) : ...
1
vote
2answers
95 views

How can I see output from a command progressively?

I have fired an ls -1 command that runs and displays a long list of values. When the command ends I can not see the output which is outside the screen vertical length. How can I see those previous ...
1
vote
3answers
218 views

How to view output for ALL processes simultaneously?

I know that you can connect to various background processes to watch their console output, but is there a way to view the output of all processes at once? Likely it would scroll quickly and be hard to ...
1
vote
2answers
2k views

How can I get vsftpd version into shell variable?

I want to get vsftpd version into shell variable. I can get it to console with ease: # vsftpd -version vsftpd: version 2.2.2 Also I can get a lot of other info into variable: # i=`bash --version ...
3
votes
2answers
339 views

Limit stdout from a continuously running process

I haven't had much luck finding an answer to my problem, but maybe I'm not asking for it correctly. I have a process I startup like the following: nohup ping 127.0.0.1 > log.txt >2>&1 & ...
2
votes
1answer
231 views

How to change output of time command?

How would you change the output of the time command from: real 0m12.304s user 0m10.187s sys 0m1.699s To: 12.30s EDIT: Using bash (OSX)
5
votes
1answer
1k views

How to send output to both screen and mail?

I use the following to send an email at the end of a script. echo "Script finished on `date`" | /usr/bin/Mail -s "Script complete" "myaccount@myserver.com". However, I want to echo the same message ...
11
votes
4answers
2k views

Converting colored output into html

There are tools providing coloured output: dwdiff -c File1 File2 # word level diff grep --color=always # we all know this guy ... The question is: How to convert their colored output of arbitrary ...
3
votes
1answer
491 views

Evaluating the return value of a command line

How do I evaluate or calculate the return value of a command line? For exemple, I count the number of lines with a grep and I want to know if that value is above X. If so, I want to print the number ...
4
votes
2answers
410 views

how to redirect terminal output to multiple log files

I've been trying redirect output to logfiles but should NOT be displayed on terminal, but following command does output both on terminal and in logs. Any ideas are appreciated. (some_cmd | tee -a ...
1
vote
1answer
1k views

For cygwin, how do I export the output in a terminal into a file?

I'd like to be able to export the output (and error messages) of my cygwin terminal in a file, especially since I have to click a lot of buttons in order to "mark" the stuff in the cygwin terminal ...
2
votes
1answer
749 views

Where does the output go from `at` and `cron` jobs

Where does standard output go given there is now screen? It's not appearing in the same directory or my home directory. How could I actually figure this out given that I don't know how to run debug ...
5
votes
2answers
4k views

tail program output to file in Linux

I know we can use below format to redirect the screen output to a file: $ your_program > /tmp/output.txt However when I used below command, it says "-bash: /home/user/errors.txt: Permission ...
3
votes
4answers
2k views

Leave remote command running storing output

Scenario; I have SSH'ed to a machine, opened a new screen session, and fired off a script. Some days later I SSH back to that machine, re-attach the screen session and look at the output that has ...