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

4
votes
2answers
220 views

Pipe file content into PowerShell command without loading the entire file to memory

I've recently started using PowerShell, hoping to never miss Bash again. I want to restore an instance of a PostgreSQL database. In Bash, or in the old command prompt, I would type: psql ...
1
vote
1answer
16 views

Grep result of command, redirection vs pipe

Can someone explain why the two commands below give different results? The first pipes the output of who to grep, the second takes the output of who as a redirection. ~: who |grep $(tty|cut -c 6-) ...
3
votes
1answer
28 views

file splitting and compression in pipeline

So I have a massive file something like this... 1/20/2016,somerandomdata 1/20/2016,somerandomdata 1/20/2016,somerandomdata 1/20/2016,somerandomdata 1/21/2016,somerandomdata 1/21/2016,somerandomdata ...
0
votes
2answers
34 views

How to perform batch commands in terminal for files in each folder

I have a folder which contains some folders inside. In each folder there are some bmp files. I want to go inside each directory, convert bmp images to pgm format and remove original bmp files, and ...
5
votes
2answers
3k views

Notepad++, Run command and open output in new tab

Is there any way to execute a command from notepad++ and have the results piped back into the program in a new tab?
0
votes
1answer
9 views

Linux redirection pipe

I was testing out a kind of backwards indirection and came across this. I'm not specifying the desired behavior as there is none - I just want to understand the results - a sym link to an (unnamed?) ...
1
vote
1answer
36 views

reading stdout in pipeline using “-” fails for “docker exec”

I want to launch a bash terminal for my Docker instance by piping the first container ID to docker exec: docker ps | head -2 | grep -v CONTAINER | cut -d' ' -f1 | docker exec -i -t - bash The final ...
0
votes
0answers
38 views

How to redirect video subtitles to pipe?

I am watching subtitled videos. I would like the subtitles to be sent to a pipe instead of being displayed on the video. The aim is to process the subtitle data with some other software, like sed, in ...
53
votes
6answers
11k 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 ...
3
votes
3answers
380 views

How do I make a bash alias that outputs file names in a format I can pipe to vim?

When rebasing with git, I'm interested to open the files that have merge conflicts. I can do this with: vi `git diff --name-status --diff-filter=U | awk '{print $2}'` but if I alias that: alias ...
0
votes
0answers
24 views

Read binary file of expected size blocking until the size is equals expected

I want to read a dowloaded file while it is being written for instance with tail -f -c +1 $filename and to redirect it to another tool (which decodes it) with a pipe |. This works fine but I am doing ...
3
votes
0answers
369 views

pipe unlimited curl stdout into chunked files

I've got an HTTP-endpoint that serves an unlimited stream of events. Now I'd like to record that stream using curl, but splitting the recorded files at the same time - preferably based on the line ...
1
vote
1answer
52 views

Why is Bash reporting “command not found” in some cases in the Terminal but not in others?

Often, but not always, when I start the Terminal on my computer and use pipe (|) in a command, pbpaste | wc as an example, bash gives -bash:  wc: command not found. (The double space is not a typo). ...
1
vote
0answers
39 views

Circular pipe in Windows command line

Given two applications A and B, is there a way to invoke them in Windows such that the standard output of A goes to the standard input of B and the standard output of B goes to the standard input of ...
1
vote
2answers
94 views

pipe and stdin redirection to cat

Why does echo "hello world" | cat works while cat < echo "hello world" does not? My (incorrect) intuition is that pipe would redirect stdout to cat as stdin.
12
votes
3answers
5k views

Comments in a multi-line bash command

This single-command BASH script file is difficult to understand, so I want to write a comment for each of the actions: grep -R "%" values* \ | sed -e "s/%/\n%/" \ | grep "%" \ | grep -v " % " \ | ...
0
votes
2answers
47 views

Why can't I redirect output from awk?

I've written this one liner to show MB read/written every 5 seconds. #!/bin/bash #iosum.sh iostat -dmz 5 |\ awk 'BEGIN{rx=wx=0}{if($0 == ""){printf"%.1f %.1f\n",rx,wx}else ...
2
votes
2answers
2k views

Setting pipefail for a single piped command

I need to execute a number of piped shell commands from a non-BASH script (namely PHP script) like these: command1 | command2 | command3 so that, if command1 fails with a non-zero exit code, each ...
0
votes
2answers
47 views

shell pipe back pressure similar to “pv”

I have shell file like this: grep 'INSERT INTO container' $file | mysql database -f Problem I have is MySQL gets too many inserts and it slow down a lot (database is mostly read-only and this is ...
0
votes
1answer
74 views

How to kill/rm pipe by inode number only?

EDIT: I originally cut and pasted a question I'd asked earlier on stackoverflow that got closed: http://stackoverflow.com/questions/32622224/how-to-kill-pipe-by-inode-number-only I've now run into ...
8
votes
7answers
4k 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
1answer
32 views

XTerm buffers output when reading from fifo

I have an xterm window that I would like to continually display the output of a named pipe. However, there seems to be some buffering occurring, and I can't find where it is happening. I open two ...
11
votes
4answers
30k views

How can I pipe output of ffmpeg to ffplay?

How can I pipe the output of ffmpeg to ffplay? At the moment I use a workaround in bash : mkfifo spam (ffplay spam 2> /dev/null &) ; capture /dev/stdout | ffmpeg -i - spam
3
votes
2answers
34 views

Pipe the xkcdpass Ouput as file to another script

I have a script that needs a file as argument : ./myscript --file filename.txt xkcdpass generates lists of passphrase as output . How can I PIPE the output of xkcdpass , as a file, to myscript ...
0
votes
0answers
64 views

Unable to trim piped video stream with FFmpeg

Trying to trim a video file that gets piped from the standard input, it only works when the start duration is greater than 2.0s for some videos (fails for ones captured from an Android phone to be ...
7
votes
3answers
1k views

Why are not all files compressed and how to improve the solution

I have a folder with about 20K files. The files are named according to the pattern xy_{\d1,5}_{\d4}\.abc, e.g xy_12345_1234.abc. I wanted to compress the first 10K of them using this command: ls | ...
0
votes
2answers
173 views

DD Bash backup issues - “unrecognized operand”

I’m using the Datto Block Driver to take snapshots of my running server every night. After the snapshot is taken, I dd the snapshot from /dev/datto0 through PipeViewer (pv) and gzip to a file on the ...
0
votes
3answers
119 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.
-1
votes
2answers
249 views

When did the windows command line get the pipe (|)? [closed]

I freely admit I have very little experience with the Windows cli but I seem to recall that DOS had no pipe (or redirect for that matter, but I may well be wrong, it's been a while). I have seen ...
0
votes
1answer
33 views

Use disk-backed buffer between pipes

I'd like to pipe a command into a slower one, with a rather big (~200GB) buffer in between. Here is an example use-case: command1 | buffer -f file.buffer | command2 Is there a command to do that? ...
0
votes
1answer
68 views

Pipe string to a command with multiple read prompts

How can I pipe a string to a command with multiple read prompts in OS X? I am running a command for a Parallels VM to enable a password which prompts for multiple values (without running a secondary ...
2
votes
2answers
2k 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
16 views

Piping back resulting stream from split remote commands

I'm trying to perform the following: (1) generating data on my local workstation (2) piping this data (huge amount!) once to my remote speedy server (3) performing two separate operations on this ...
1
vote
1answer
68 views

Run commands from a pipe in realtime

If I have a pipe like cat /dev/somedevice | grep 'test' that output commands, like for example echo 'test 17', the commands appear in realtime (everytime /dev/somedevice delivers some line). If I ...
3
votes
1answer
180 views

How to sort the output of find? [duplicate]

I'm using the find command to list files with their name containing a string: find ~/ -type f -name "*inductive*" I would like to use a pipe to sort the resulting list of files. I would like to be ...
2
votes
1answer
95 views

Pipe to less but keep the highlighting

Is it possible to pipe some output (e.g. dmesg) to a command like less (or an equivalent command) and keep the text highlighting used by the original command printing? example: on the left dmesg | ...
0
votes
1answer
47 views

How to store data from different netcat connections in separate files?

I need a server that should receive data streams, store them in files and send further. Each connection should create a file with corresponding timestamp in file name, then write to it. My solution: ...
6
votes
4answers
7k views

Can I use pipe output as a shell script argument?

Suppose I have a bash shell script called Myscript.sh that need on argument as input. But I want the content of the text file called text.txt to be that argument. I have tried this but it does not ...
8
votes
4answers
15k views

Why does this not work? “ls *.txt | xargs cat > all.txt” (all files into single txt document)

Why does this not work? ls *.txt | xargs cat > all.txt (I want to join the contents of all text files into a single 'all.txt' file.) find with -exec should also work, but I would really like to ...
0
votes
0answers
45 views

windows command line find file, untar

I want to untar a file I just downloaded in windows 7. I am in the directory, but there are too many files and the name is too long to simply type out. How would I do this in the command line? If this ...
0
votes
0answers
26 views

How can I run multiple sets of pipe-linked commands in parallel?

I want to run several sets of tasks connected by pipes in parallel like so: app1 "input_file_1" | app2 > "output_file_1" app1 "input_file_2" | app2 > "output_file_2" ... What is the cleanest ...
2
votes
3answers
1k views

How do you use PIPESTATUS, tee and /bin/sh together?

When I run curl | tee test.txt; echo ${PIPESTATUS[0]} I correctly see curl: try 'curl --help' or 'curl --manual' for more information 2 But when I try to run exactly same command using ...
0
votes
1answer
85 views

combining tail -f with less +F does not work

I am using ubuntu bash. I am trying to combine tail -f and less +F like below and nothing is coming out. tail -f long_running_log | less +F long_running_log is a log file constantly being written ...
0
votes
1answer
121 views

How would one pipe from socat to sed to bc to xargs?

I have a server outputting some numbers, I'm reading them with socat, then using sed, I turn those numbers into some math equations, I run them with bc, then I need to pipe them into xargs. socat -u ...
1
vote
4answers
133 views

How does piping/redirection in Linux work exactly?

I have these three examples of redirection stdin/stdout, only one of them is working the way it is intended to. I would love if someone can explain that to me. The goal is to sort the contents in ...
2
votes
2answers
4k views

BASH - Check if unnamed pipe is empty

My problem is, I want a script which reads content from a pipe, checks if it's empty and output it if not, as seen here: #!/bin/bash var=$(cat -) if [ -n "$var" ] then echo "$var" else echo ...
0
votes
1answer
732 views

Using -replace on pipes in powershell

I want to test out a replace before I use it, so I'm trying to write a quick online command to see what the output is. However, I'm not sure what the syntax is. What I want to do is something like ...
0
votes
1answer
446 views

Continuous streaming from an empty pipe, then adding data to the pipe on demand

Essentially, what I'd like to do is to have ffmpeg continuously stream to an RTMP server using an empty pipe, then when I want to stream something, add data to the pipe. My reasons for doing this ...
0
votes
0answers
28 views

Pipeline from <filename> to <filename> in Windows CMD?

Is there a way to do this without a temporary file? I've tried with tee but that failed. Test case: >echo "foo bar" > ex2.go >type ex2.go "foo bar" >type ex2.go > ex2.go >type ...
3
votes
3answers
400 views

Need to understand the concept of xargs and pipes

I have been struggling with this issue for a while now and would really appreciate it if someone could clarify it for me . Suppose I am trying to pipe the two commands together. readlink and cat ...