Questions tagged [pipe]

156 questions
63
votes
4 answers

How can I get more info on open pipes show in /proc in Linux?

In Linux if you go digging in /proc//fd often you'll see output like: lrwx------ 1 root root 64 Jul 30 15:14 0 -> /dev/null lrwx------ 1 root root 64 Jul 30 15:14 1 -> /dev/null l-wx------ 1 root root 64 Jul 30 15:14 10 ->…
Kamil Kisiel
  • 11,946
  • 7
  • 46
  • 68
50
votes
1 answer

Capturing STDERR and STDOUT to file using tee

I'm unclear what the best order is to capture both STDERR and STDOUT to the same file using tee. I know that if I want to pipe to a file I have to map the filehandle after the redirect, i.e. find . >/tmp/output.txt 2>&1 This instructs the shell to…
PP.
  • 3,246
  • 6
  • 26
  • 31
49
votes
12 answers

Unzipping files that are flying in through a pipe

Can I make unzip or any similar programs work on the standard output? The situation is I'm downloading a zip file, which is supposed to be unzipped on the fly. Related issue: How do I pipe a downloaded file to standard output in bash?
Alex
  • 2,287
  • 5
  • 32
  • 41
36
votes
6 answers

How do I pipe a downloaded file to standard output in bash?

How is it possible to pipe out wget's downloaded file? If not what alternatives should I use?
Alex
  • 2,287
  • 5
  • 32
  • 41
32
votes
3 answers

How can I handle spaces in file names when using xargs on find results?

One of my common practices is to perform greps on all files of a certain type, e.g., find all the HTML files that have the word "rumpus" in them. To do it, I use find /path/to -name "*.html" | xargs grep -l "rumpus" Occasionally, find will return a…
abeger
  • 461
  • 1
  • 4
  • 6
28
votes
5 answers

Pass a pipe to a command that expects a filename

Say I have a command foo which takes a filename argument: foo myfile.txt. Annoyingly, foo doesn't read from standard input. Instead of an actual file, I'd like to pass it the result of another command (in reality, pv, which will cat the file and…
Steve Bennett
  • 5,539
  • 12
  • 45
  • 57
26
votes
4 answers

How to pipe stderr without piping stdout

How do I pipe the standard error stream without piping the standard out stream? I know this command works, but it also writes the standard out. Command 2>&1 | tee -a $LOG How do I get just the standard error? Note: What I want out of this is to…
C. Ross
  • 2,995
  • 8
  • 32
  • 36
21
votes
4 answers

Count number of bytes piped from one process to another

I'm running a shell script that pipes data from one process to another process_a | process_b Does anyone know a way to find out how many bytes were passed between the two programs? The only solution I can think of at the moment would be to write a…
Simon Hodgson
  • 681
  • 3
  • 8
  • 15
20
votes
1 answer

Shell command slow when using pipe, fast with intermediate file

Does anyone understand this huge difference in processing time, when using an intermediate file, or when using a pipe? I'm converting tiff to pdf using standard tools on a fresh debian squeeze server. A standard way of doing this is to convert to ps…
plang
  • 325
  • 3
  • 10
15
votes
4 answers

how to pipe data to sftp connection?

ftp supports the put "|..." "remote-file.name" command to pipe data to an ftp connection. Is there something similar available for sftp? In sftp i get the following error: sftp 'jmw@backupsrv:/uploads' sftp> put "| tar -cx /storage"…
JMW
  • 1,451
  • 4
  • 19
  • 27
14
votes
5 answers

Unzip from stdin to stdout - funzip, python

The goal is to read a zip file from stdin and uncompress to stdout. Funzip works and is the solution I am looking for, the zip contains a single file, unfortunately funzip fails when the compressed file size is around 1GB or greater: funzip error:…
chillvibes
  • 141
  • 1
  • 1
  • 4
14
votes
1 answer

How do I pipe the output of uptime/df to curl?

I want to send the output of uptime and df commands to a web app using cURL. I tried: uptime | curl http://someurl.com -T - But that didn't seem to send the data. What is the proper way to send the output of a command to cURL as a POST parameter?…
Callmeed
  • 2,705
  • 4
  • 18
  • 15
14
votes
3 answers

Redirect output of mysqldump to scp

I worked with a linux pro years ago who did this nifty trick. He could do a mysqldump but redirect the output to an scp/ssh connection rather than writing to disk. We utilised this quiet a bit where i used to work but I cannot remember how to do…
xzyfer
  • 323
  • 1
  • 5
  • 12
13
votes
3 answers

On Linux, how can I see how far through a file a process is?

If I have a piped command such as cat myfile | processor_application where processor_application is something reading from standard in, in chunks, to process, is it possible to see how far through the file cat has got? Possibly using…
wodow
  • 590
  • 1
  • 5
  • 18
10
votes
1 answer

How to concatenate streams?

I know cat can concatenate files, but I need to concatenate a mix of files and streams and pipe the result to another process. To make the question more concrete, I want to concatenate cat abc.sql together with gzip -dc xyz.sql.gz and cat qvf.sql…
rustyx
  • 1,506
  • 3
  • 19
  • 28
1
2 3
10 11