Pipes or named pipes are a feature of the POSIX standard that allow separate processes to communicate with each other without having been designed explicitly to work together.

learn more… | top users | synonyms

0
votes
3answers
45 views

real windows equivalent to cat

Under cmd is there a windows equivalent to the posix command cat ? cat all by itself no filenames, no switches. I just want something that copies stdin to stdout until it hits EOF. it's not a hard ...
1
vote
2answers
30 views

How to save console output still showing it

I need to troubleshoot a telnet session and send save it's results to another person. When I use redirection I save the contents of my session, but I'm not able to see it on console. How to pipe ...
3
votes
1answer
900 views

Rendering HTML from a pipe

I would like to be able to generate HTML then pipe it to a program which will render it, something like this: for i in 1 2 3 do for j in a b c do echo "<table ...
31
votes
5answers
6k views

How can I save the current contents of less to a file?

If I've piped the results of a command to less and then decided that I want to save the contents to a file, is this possible? I've tried setting a mark a at the end of the buffer, and then returning ...
0
votes
1answer
12 views

pv: Change Prefix on the Fly

To me pv is really handy some times. However, I was wondering if it was possible to change the prefix on the fly. I mean usually I have something like in.sh | pv -btrcN "Watch that work!!1!" | ...
2
votes
1answer
52 views

Passing the output of locate as an argument to an editor

What I mean is doing this in a 1-liner: ubu@ubuntu:~$ locate filename.sh /home/ubu/path/to/filename.sh ubu@ubuntu:~$ gedit /home/ubu/path/to/filename.sh I can't seem to figure out the right piping ...
3
votes
1answer
49 views

redirect a file generated by a program to another program

In linux enviroment, I have a program that creates a large file (2-3GB). I need to filter this file (e.g. I want to remove a line if it appears in the precedeing 10 lines). I want to do it while the ...
1
vote
1answer
34 views

How to split and recombine stdout pipe in bash?

I am parsing text on the command line. How can I take the output of one command and use it in two places in the next command? some_command | head -n $( awk '/search_term/ {print FNR} ...
0
votes
1answer
11 views

Is it possible to count from a given number when extracting images from a video with FFmpeg?

I am using ffmpeg to extract still images from a video. First from the beginning of the video, to a given time and then from the end of the video from a given time. So I am using two ffmpeg command ...
2
votes
1answer
27 views

Pipe standard error to file and keep it on standard error?

I have a script (fragment) for which I'm logging output and standard error: #!/bin/sh #... { date "+%Y-%m-%d %T" cd $workdir ls -ltr validfile badfile #example command that provides stdout, ...
0
votes
0answers
67 views

Pipe ffmpeg->ffmbc cut files after some length

I recently tried the following command: ffmpeg.exe -i "C:\Users\Dennis\git\cnn\CNN\watch\filea.mp4" -i "C:\Users\Dennis\git\cnn\CNN\watch\fileb.mp4" -filter_complex ...
1
vote
2answers
350 views

How to unrar the STDIN?

What I have tried: cat archive.rar | unrar x - cat archive.rar | unrar x /dev/stdin cat archive.rar | 7z x - cat archive.rar | 7z x -si cat archive.rar | 7z l -si The unrar doesn't recognise the - ...
0
votes
2answers
40 views

Win7 Command Line piping

I want to know why in the command line prompt this happens. I have a script fileX.cmd which is one single line of text: @echo dir If I do C:\Users\Dogfood>fileX.cmd | cmd This will show all ...
0
votes
2answers
49 views

Ping piped to txt does output nothing

Following script should pipe the ping output to a text file @echo off rem end with ctrl+c y ping 192.168.33.65 -t >> C:\_ScriptLog\Ping\ping.txt but nothing is piped to the txt file, it´s ...
34
votes
2answers
4k views

How to rate-limit a pipe under linux?

Is there a filter which I could use to rate-limit a pipe on linux? If this exists, let call it rate-limit, I want to be able to type in a terminal something like cat /dev/urandom | rate-limit 3 -k | ...
1
vote
2answers
17 views

How do I output a variable without changing if it has a newline or not in a shell script?

I have a shell script that takes input from another shell script. The stream gets piped in on stdin. I need to capture all the bytes of the stdin stream to a single variable in the shell script. ...
2
votes
4answers
3k views

How to redirect the output of a program to the Linux diff command

I have a program that writes to stdout. Is there a way that I can redirect the output to the Linux diff command or do I have to write the output to a file and then compare that? For example, I have a ...
15
votes
4answers
15k views

cURL: how to suppress strange output when redirecting?

I'm trying to print just the verbose sections of a cURL request (which are sent to stderr) from the bash shell. But when I redirect stdout like this: curl -v http://somehost/somepage > /dev/null ...
0
votes
0answers
10 views

Merge two outputs into one in real time without scrambling them in linux

Is it possible to merge two real time outputs into one file without scrambling the new lines? What I want to do is something like cat <(/proc/kmsg) <(while true; do echo hello; sleep 1; done) ...
1
vote
1answer
93 views

How to parse pipe with multiple commands independently?

How can I parse output of a single command by multiple commands without truncating at each step? For example ls -al|grep -i something will pass every line that has "something" in it to the next ...
1
vote
2answers
36 views

Trying to cat the result of piped commands

I have a folder of files that are named list20140801.txt list20140802.txt .... I'm trying to do this ls | sort | tail -3 | cat But it is just giving me the file names, not cat'ing them.
6
votes
5answers
3k views

How to get both PIPESTATUS and output in bash script

I'm trying to get last modification date of a file with this command TM_LOCAL=`ls -l --time-style=long-iso ~/.vimrc | awk '{ print $6" "$7 }'` TM_LOCAL has value like "2012-05-16 23:18" after ...
7
votes
1answer
303 views

Multiple unix pipes not working

This first pipeline works fine (printing "c"): echo "a" | sed 's/a/b/' | sed 's/b/c/' This one does not do what I expect (nothing gets printed when I feed an "a" into my fifo ): mkfifo fifo; cat ...
4
votes
6answers
842 views

How can I both pipe and display output in Windows' command line?

I have a process I need to run within a batch file. This process produces some output. I need to both display this output to the screen and send (pipe) it to another program. The bash method uses ...
1
vote
3answers
78 views

Pass stdin to multiple programs without closing

I want to split and GZip a large file, and this answer appeared to be what I'm looking for, and it seemed like a very useful way of doing things I never thought of, so I'd like to generalize it; the ...
0
votes
1answer
165 views

How to shuffle large text files efficiently while piping it on Linux?

I have a text file that is couple GBs. I am trying to shuffle this text file in a pipe. For example these are some sample lines of what I am using but it is not efficient and in fact the pipe does ...
1
vote
3answers
4k views

Silence curl with >/dev/null 2>&1 when it's piped

So I have a curl that is piped to a grep and a sed. Where would I apply the >/dev/null 2>&1 ? curl www.site.com | grep stuff | sed "other stuff" At the very end or after the curl?
7
votes
6answers
3k views

how to beep on tail -f event

I want my PC to make a system beep on every tail event I have the following command tail -f development.log | grep "something rare" is there an easy way like pipeing it to somthing that beeps? ...
0
votes
0answers
47 views

Multiple grep command and show after line

I have this command grep -iE -A18 "$(date +"%Y-%m-%d").*error" * | grep -v -A18 'Movig to Error Queue' but the result shows me the 18 line after 'Moving to Error Queue' but I do not want that. I ...
22
votes
6answers
3k views

What is the general consensus on “Useless use of cat”?

When I pipe multiple unix commands such as grep, sed, tr etc. I tend to specify the input file that is being processed using cat. So something like cat file | grep ... | awk ... | sed ... . But ...
3
votes
3answers
4k views

How to pipe awk output (with periodic, continuous input) to output file?

I am trying to write a command that pipes the continuous output of a free command (run every second) to an awk command that parses a specific value (available free memory) and outputs this to a file ...
1
vote
1answer
75 views

Linux - Output to Folder that Yet Exists (in one command)

Is it possible to achieve this in one command without requiring a script: echo "test" > /folder/that/does/not/exist/newFile.txt
1
vote
1answer
187 views

Use 'find' command to search for PNG files, pipe output to imagemagick for batch conversion

I've got a directory with thousands of image files, mostly JPG but some PNG. The files have no extension, they're just numbered. I need to convert all of them to JPG. Using find I can get a list of ...
3
votes
1answer
77 views

Using pv(1) to limit rsync speed

I'm trying to use pv rather than rsync's builtin --bwlimit to limit the bandwidth of an rsync transfer because --bwlimit is implemented in an eventually-consistent way, and my transfers are so short ...
52
votes
2answers
3k views

Why is piping 'dd' through gzip so much faster than a direct copy?

I wanted to backup a path from a computer in my network to another computer in the same network over a 100 Mbit/s line. For this I did dd if=/local/path ...
0
votes
2answers
49 views

Use grep to find files and pipe/open to open them

How can I pipe files from grep to open all matching files? I've tried grep -li "type" * | open, but that does not work.
5
votes
2answers
461 views

How to a open a file in vim using pipe

I get to use the locate command extremely often. So if I run the following command. locate updatedb | head -1 Then it gives me the O/p /usr/updatedb.conf I wonder if there is any such command ...
11
votes
7answers
6k views

Advantages of cat'ing file and piping to grep

Are there any additional advantages of cat'ing a file and piping it to grep, besides convenience? The convenience being that, when I retrieve commands such as those below from my history, the cursor ...
1
vote
1answer
39 views

Pipeing lines to repeat commands

If my grep operation returns a list of ID's like: 12345 84758 49549 .. can I somehow feed/pipe each line to a commandline command's parameter? Like for example with the above result from grep, I'd ...
2
votes
3answers
234 views

With regards to piping commands, what are the greater than (>) and less than (<) symbols called?

On linux at least, and I think windows/dos shell too you can use > to "pipe" output into a file. Something like: cat myfile.txt > mightAsWellCP.txt What is that piece of syntax sugar called? ...
9
votes
3answers
9k views

Passing two arguments to a command using pipes

Usually, we only need to pass one argument: echo abc | cat echo abc | cat some_file - echo abc | cat - some_file Is there a way to pass two arguments? Something like {echo abc , echo xyz} | cat ...
8
votes
5answers
3k views

What does the linux pipe symbol “|” do? [duplicate]

Here is a command that sorts files in a folder in reverse order ls | sort -r What does the | symbol in that command do? What I'm really looking for here is high level (easy to understand) ...
0
votes
1answer
56 views

Bash: multiple commands with pipe on 1 line

This command gets my ip address: who am i|cut -d "(" -f2 | cut -d ")" -f1 output: 10.22.184.126 this command sends a ZPL command to 10.22.184.126 on port 5964: printf ...
3
votes
2answers
508 views

How do I pipe output to date -d “value”?

I have a date like "2014-01-30 05:04:27 GMT", and if I run date -d "2014-01-30 05:04:27 GMT", the output is in my server's timezone ("Thu Jan 30 16:04:27 EST 2014"). With the use of grep and cut, I ...
1
vote
2answers
1k views

Preserve colors while piping to tee

ls -l --color=auto | tee output.log Without pipe/tee it's colored. How can I make it so that it stays colored while using tee (can be colored only on the screen, I don't care about colors in logs).
95
votes
5answers
20k views

Less and Grep: Getting colored results when using a pipe from grep to less

I use the --colour option of grep a lot, but I often use less as well. How can I pipe grep results to less and still preserve the coloring. (Or is that possible?) grep "search-string" -R * --colour | ...
2
votes
2answers
634 views

Real-time loopback interface packet capture on Windows with RawCap, Wireshark, and some pipe utility

After stumbling across another Super User post about loopback packet capture on Windows, I was directed to RawCap, a utility that provides pseudo-capture of loopback packets. RawCap writes to libpcap ...
0
votes
0answers
11 views

remove permission spam for find is not working tcsh enviroment

Hello this question is asked a lot like here: However, my environment on (csh or tcsh) seems to add a space but I can't figure out why. for instance, on bash: find /. -user `whoami` 2>/dev/null ...
1
vote
1answer
147 views

SoX pipe operations and data loss

When piping operations using SoX, I've noticed that files get shorter than they should: Works fine: sox -n -r 44100 silence.wav trim 0 1 sox --combine sequence silence.wav combined.wav soxi -D ...
0
votes
1answer
38 views

Sed is not Interpreting Pipes Correctly

OK, this is hard to explain, so I will give a reproducible example: I have a text file test.txt contains the line: somesetting-parameter /an/old/path I want to replace it with a path I can get via ...