Tagged Questions
2
votes
1answer
158 views
Make stdout and stderr be buffered by the same buffer
Is it possible to force glibc to use the same buffer for stdout and stderr?
If I tee the both outputs:
./tests/tests 2>&1 | tee log
I get mixed messages (i.e. messages are ordered inside ...
14
votes
1answer
247 views
Make program first read from pipe, then from keyboard
Consider the interactive program interactive. I have to run this program fairly frequently, and each time I run it the first few commands are the same. Obviously, having to type those commands over ...
2
votes
1answer
51 views
Changing compression in memory
I have some large files that I need to change the compression type of for input to a program--I need to unrar them and then gzip (or bzip2) them. However, they're highly compressed files and I don't ...
4
votes
3answers
184 views
Use command grep and locate
How I can make the grep command locate certain words in the files specified by the routes found by the locate command?
locate my.cnf | grep user
(I want that grep command search the word "user" ...
2
votes
5answers
437 views
Where are command line arguments (e.g. 'some.text') actually passed to?
From what I know, parameters you pass to a command, goes to it's STDIN stream.
so this:
cut -d. -f2 'some.text'
should be perfectly identical to this:
echo 'some.text' | cut -d. -f2
as we send ...
5
votes
1answer
215 views
Redirect terminal output to image file
I need to programmatically run some unix commands and get the output in a image file, the format could be png or jpeg (jpg).
The commands are run in an AIX (IBM *nix) machine. I don't have ...
5
votes
5answers
358 views
resolve all ip addresses in command output using standard command line tools
I have several log files that contain a bunch of ip addresses. I would love to be able to pipe the data through a program that would match and resolve ip addresses.
I.E.
cat /var/log/somelogfile | ...
7
votes
4answers
559 views
What is the easiest way to execute text from tail at the command line?
Sometimes I'm working on a new (ubuntu) box and I type git and am alerted:
The program 'git' is currently not installed. You can install it by typing:
apt-get install git-core
If that happens I ...
10
votes
8answers
3k views
What's a good example of piping commands together?
If you were helping someone to learn the concept of pipes on the command line what example would you use? The example that actually came up was as follows:
cat whatever.txt | less
I feel like ...
18
votes
4answers
602 views
Are Linux utilities smart when running piped commands?
I was just running a few commands in a terminal and I started wondering, does Unix/Linux take shortcuts when running piped commands?
For example, let's say I have a file with one million lines, the ...
4
votes
1answer
196 views
Why did using xargs fail in this case?
I tried to understand the usage of xargs and did the following experiment.
ls | xargs | touch
I want to refresh the files dates and directoris in the curent directory.
Though it is a bit silly,for ...
1
vote
1answer
205 views
How to know if a Linux command can read from STDIN?
I noticed this problem when I became confused with pipe, one command send its executing output to the STDOUT, which is the STDIN for the other command, which can read from STDIN.
How do I know if a ...
2
votes
2answers
501 views
Passing values through pipes
I don't quite understand pipes in Linux command line.
I noticed that:
ll - R | grep *.pdf
will list files ending with .pdf
But
locate *.pdf | du -h
will not calculate the size of files ...
11
votes
3answers
1k views
How can I pipe output to another process, but retain the error state of the first process? [duplicate]
Possible Duplicate:
Get exit code of process that's piped to another
I am using the following command line (in a makefile) to pipe the verbose error messages from my compiler through a ...
4
votes
4answers
209 views
How to send stderr to stdout with a pipe to another command?
I'm trying to capture all of the output of a build operation, and send it to myprogram. I seem to only be able to capture part of it. This is what I'm trying:
make clean && make ...
3
votes
2answers
492 views
Performance difference between stdin and command line argument
For some commands, it is possible to specify certain input as either stdin or a command line argument.
Specifically, suppose command can take stdin input and a filename as command line argument, and ...
6
votes
2answers
1k views
Where do my ANSI escape codes go when I pipe to another process? Can I keep them?
I sometime want to pipe the color-coded output fror a process, eg. grep... but when I pipe it to another process, eg. sed, the color codes are lost...
Is the some way to keep thes codes intact ?
...
16
votes
4answers
6k views
What is the mknod command used for?
I just started using Ubuntu as my main OS and I wanted to learn about things I should not do, and learn by the bad things people have done in the past. I came across these email about horror stories ...
0
votes
2answers
1k views
Unix - Filter Commands
I want to know about the "filter-command" which are available in Unix.
I am confused regarding this:
What is the purpose of "Filter-Command" ?
Which are the Filter-commands available in Unix?
I ...
14
votes
4answers
4k views
Can't pipe into diff?
I wanted to be clever and compare a remote file to a local file without downloading it. I can get the contents of the remote file by
ssh user@remote-host "cat path/file.name"
However, piping that ...
