Questions tagged [pipe]

A pipe connects the output of one program to the input of another program. This is especially used to implement the shell | operator.

A pipe connects the output of one program to the input of another program. It is one of the fundamental interprocess communication mechanisms on Linux.

In the , the | operator creates a pipe connecting the process on the left to the process on the right. For example

mycommand | less

sends the output of mycommand to the command less, which displays its input (i.e. the output of mycommand) in an interface allowing navigation and searching.

205 questions
17
votes
4 answers

How can I use the value from a pipe in the test program?

wc -l | test -eq 1 This doesn't work. I want to compare the result of wc with the value of 1. How can I do that?
tr3quart1sta
  • 339
  • 1
  • 2
  • 4
4
votes
0 answers

Can't boot Ubuntu 12.04 "Could not write bytes: broken pipe"

SYSTEM: 4GB RAM; 500GB DISK I have tried some of the solutions I have seen about this error and none have helped. Here is the history: 1. I have been running 12.04 LTE for about a year now with no problems. Last week I booted and got error "Checking…
Doug Nintzel
  • 41
  • 1
  • 4
4
votes
1 answer

When shuting down a black screen with a broken pipe message shows for half second

It is actually very fast when it shows, I had to record it to actually saw what it said and it is: could not write bytes: Broken pipe Checking battery state... cpid: exiting Checking for running unattended-upgrades I have Ubuntu 64 bits, 12.04.3,…
Alejandro_JD
  • 101
  • 4
3
votes
1 answer

How to avoid delay in output stream pipe

While i pipe nethogs it takes too much delay for the output ( About 5-200 sec instead of 1 sec depend on pipe,cmd etc). Nethogs print output in every second. For the sake of simplicity consider the following command ( it takes abt 5 sec ) sudo…
totti
  • 6,818
  • 4
  • 39
  • 48
2
votes
1 answer

How to feed standard input and dump into file at the same time?

I would like to feed a command with standard input and dump that standard input into the file at the same time. This is just failed attempt: read | tee dump.txt this command is waiting for standard input. I expect whatever I input to be fed to read…
Pablo
  • 2,537
2
votes
1 answer

Why do keystrokes in "less"/"more" sometimes require a , when i use a pipe?

I love the pipe to feed long text output into less (or more) to make it more readable. It's only on Ubuntu that i observed a uncommon behavior: Sometimes in less keystrokes are not processed immediately. It's like i have to "confirm" them with…
1
vote
1 answer

How do I save terminal output to a external file on another computer?

I'm trying to append the output of wifi signal strength and other values in the command watch -n 1 cat /proc/net/wireless to an external file in another computer.
Adam
  • 11
0
votes
0 answers

Understanding pipe (for large files)

My understanding of pipe is, all piped commands are invoked in parallel and stdout of each command is fed to next command as stdin. When processing large files, initial parts of data may be done with processing, while some parts of the data are…
Macond
  • 259
0
votes
2 answers

Piping into GraphicsMagick

I'm still learning the command line, and I'm having trouble piping a list of files into graphicsmagick for conversion to pdf: find . -type f | sort | gm convert file.pdf This gives the error: gm convert: Request did not return an image. Can I do…
user2089518
  • 401
  • 4
  • 9
0
votes
2 answers

Named pipes always open for writing

I want to make a named pipe that is always open for reading and writing. So I typed this in to the terminal: mkfifo testpipe exec 3<> testpipe All is working correct. But when I make a shell script with those commands it only makes a named pipe.…
0
votes
1 answer

Is pipe the same as expr pipe?

I search man expr and found expression 1 | expression 2 to reutnr expression 1 if it is neither an empty string nor zero; otherwise, returns evaluation of expression 2 if it is not an empty string. Isnt pipe suppose to pass expression 1 into…
0
votes
1 answer

What is the difference between command grouping and pipelining?

I couldn't understand the difference between command grouping and pipelining