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

2
votes
1answer
611 views

How do I run a command on each file within a directory that matches a pattern?

I'm trying to run a command on every file within a directory (recursively) that matches a pattern. I need the filename of each item that matches for the command however. This is how far I've got: ...
1
vote
2answers
603 views

Split an[d] archive large backup file in constant working space

I'm currently attempting to use tar and split to get DVD-sized archives of my Time Machine backup database. It's going to work this time, as I have a partition on my external drive large enough to ...
15
votes
4answers
17k 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 ...
4
votes
2answers
381 views

How to utilize vim's syntax color to replace the `highlight' utility?

I feel that the `highlight' utility doesn't support as many file types as vim does, and the project isn't very active. When the file is gzipped, highlight doesn't recognize it at all. But in ...
3
votes
1answer
1k views

Pipe grep exit code away

When I need to suppress some kind of output e.g. foo | grep -v bar But foo gives sometimes only: bar bar bar... grep will return -1. How do I transform the exit code 1 to 0?
2
votes
4answers
3k views

Rsync to stdout?

I have access to backup server via rsync protocol (only rsync, nothing else). Now, I want to fetch file from there (which is .tar.gz) and pass it directly to tar command, without saving the archive in ...
1
vote
3answers
852 views

Double pipes in Linux

Is it possible to do a command in Linux with "double pipes", like this? blah | blah | blah
2
votes
1answer
109 views

How to construct shell redirection on command line

Consider the following command in Unix: echo 0123456789 | cat >/tmp/foo &> /tmp/bar The echo is sent to /tmp/bar. However, what I really want is to redirect the stdout and stderr output ...
3
votes
2answers
2k views

gpg symmetric encryption using pipes

I'm trying to generate keys to lock my drive (using DM-Crypt with LUKS) by pulling data from /dev/random and then encrypting that using GPG. In the guide I'm using, it suggests using the following ...
1
vote
1answer
586 views

grep -v -A not working properly (actually not working at all)

I have to filter lines like the following: [javac] /Users/looris/Sviluppo/android/projects/toutry/src/net/looris/toutry/Stuff.java:23: warning: unmappable character for encoding ascii [javac] ...
4
votes
5answers
751 views

commands executing in piping in UNIX

when I write a command $ echo date then it prints "date" as it is i.e it doesn't run date program. But when I write $ echo date | wc then correct answer is produced as if date was run. How ...
34
votes
2answers
5k 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 | ...
3
votes
1answer
685 views

Unix commandline to repeat command with pipes

I want to write a script that will repeat a commandline that usually contains pipes ./myscript.sh ls -lart |grep ^d And in myscript.sh I do a bunch of stuff, and then want to execute ls -lart |grep ...
1
vote
1answer
1k views

Making nano accepting previous piped output as a file path

When I run the following command in linux: find / -iname httpd.conf I get: /usr/local/apache/conf/httpd.conf I want to use nano to edit this file, lazy to type the file path again, I used: find ...
0
votes
2answers
926 views

Grepping grep output fails

I'm trying to grep the output of ngrep. Unfortunately when I add another grep to the pipeline, I get no output at all. It can be some other command too - cat / grep / tee - everything breaks the ...
3
votes
3answers
3k views

Creating a named pipe on Windows

I want to write a large dataset from a SQL Server 2005 database using BCP (bulk copy program). Ideally I'd like to do the following: bcp MyDatabase..MyTable OUT STDOUT -c -t, |gzip -c ...
4
votes
1answer
1k views

emacs as a pager?

I am looking for a way to use emacs as my pager command in the shell (for example with man or to scroll the output of an asynchronous command with a large amount of output). I use emacsclient as my ...
3
votes
1answer
3k views

How do I pipe Java exceptions into a text file along with normal output?

When I use batchfile.bat >> logfile.txt command in the Windows commandline, it correctly outputs the normal output into the text file, but the Java exceptions get output to the console. Can I make it ...
8
votes
3answers
3k views

Does pipe have to write temporary file?

I found that if I transfer a great amount of data between two processes via pipe, some temporary file will be created by linux in /tmp directory. If the pipe operation succeeds, the corresponding ...
0
votes
1answer
1k views

piping curl's response headers

I'm getting weird results when trying to capture curl's response headers in a variable: pattern="< Content-Length: " val=$(curl --verbose \ --request POST --data "desc=hello world" \ ...
2
votes
1answer
163 views

Why doesn't “find -print0” work in Cygwin under Vista?

I'm writing a simple shell script: find datafiles/ -type f -print0 | xargs -0 md5sum > datafiles.md5 In Cygwin under Vista, it just sits there and nothing happens. It works fine on Linux. What ...
1
vote
3answers
2k views

xargs vs backtick

More silly questions from the Linux n00b. =D I'm curious about the performance ramifications of using xargs vs. backticks. For example, what's the different between: find ./ -name foo* | xargs rm ...
3
votes
2answers
1k views

Linux - Is there a way to convert .bz2 files to .tar.bz2 files using pipes?

Is there a way to convert a .bz2 file to a .tar.bz2 file without decompressing the entire thing to disk and then re-compressing? The decompressed size is larger than my drive. Since bz2 operates on ...
4
votes
4answers
9k views

I would like to pipe output of find into input list of scp, how?

I'm a novice linux user and I am trying to send a long list of files from one computer to another. The argument list is too long, so I am using find. I am having trouble setting up the expression, ...
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? ...
104
votes
5answers
22k 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 | ...