All Questions
Tagged with command-linepipe
113 questions
0votes
0answers
147views
mc command hangs with --version parameter when writing to stdout but works when piping to cat?
I observed odd behaviour of a utility binary (it's actually the minio client mc in a recent-ish version) when running it from the command line. If I just run it like ./mc --version, the command hangs ...
0votes
1answer
492views
What is a general way to trick programs into thinking they're not being piped?
Many CLI programs produce different output when they print to the console as opposed to being piped to another program. For example, exa will print a list of files with color highlighting. But exa | ...
3votes
1answer
883views
Pipe output to command line editor for next command
I have been using sudo find / -iname '*foo*' 2>/dev/null | vim to get a list of directories/files containing foo, and then I inspect this list, edit it, and write a bunch of new commands inside of ...
3votes
3answers
4kviews
How do I pipe to a command only if another command fails (keeping the original input)?
I hope this isn't a duplicate, but I did some due diligence trying to find and answer. I want to pipe the original output to a second command, only if the first command fails. e.g. cat file.txt | ...
0votes
2answers
2kviews
Delay in piping arecord output and into aplay
There is a noticeable delay in the sound coming from the speakers when doing, arecord | aplay I want to reduce the latency because I want to write a low-latecy sound server with a bash script. ...
2votes
2answers
1kviews
Performantly skip the first N bytes of a stream
I know to use tail -c +N, but it is extremely slow, and pins a CPU core: leijurvs-MacBook-Pro:Downloads leijurv$ time cat /dev/zero | head -c 100000000 | shasum -a 256 ...
-5votes
2answers
1kviews
Is it possible to pipe only on error? [closed]
If there is any error then 2>&1 and pipe (|) to another program, otherwise do not 2>&1 and do not pipe
1vote
1answer
101views
tee pipeline and pnmtools - truncated file
This sequence of commands works OK: pngtopnm file.png 2> /dev/null > dump1 pnmfile < dump1 stdin: PPM raw, 1920 by 1080 maxval 255 ls -l dump1 -rw-r----- 1 cmb 6220817 Sep 15 14:26 dump1 ...
0votes
1answer
1kviews
How to print intermediate result of commands in a pipeline?
I have a series of commands running through a pipeline like this: cmd1 | cmd2 | cmd3 | cmd4 How can I print the intermediate result of cmd1, cmd2 and cmd3? I know I can use the tee command to print ...
1vote
1answer
377views
Pipe a Man Page to Kate Without Writing to Hard Drive
What command will pipe a man page to Kate text-editor without writing anything to the hard drive? I've seen examples that create a temp file (on the file system) and then open that tmp file with a ...
1vote
1answer
157views
mysqldump into file with any error firing off a cURL request with error information
I'm attempting to setup a backup that I want to execute from the command line where, in the case of an error, it curls the error to an API endpoint. Something like: mysqldump -u whatever -pwhatever ...
1vote
4answers
3kviews
pdsh input from file possible?
I can pipe data from one command to another, example: $ echo test | cat test Unsure of what to call the operation I can get a similar effect using: $ cat < <(echo test) test Where <(echo ...
1vote
2answers
298views
output mixed alphanumeric input with grep,pipe and cat
I have a mixed wordlist as an input: azert12345 a1z2e3r4t5 a1z2e3r455 The command line I have tried to execute: cat file.txt | grep -E "[[:digit:]]{5}" --color What do I want to accomplish: Print ...
7votes
3answers
2kviews
How to save command as well as output of that command to a file [duplicate]
Hi I want to save both output of a command and the command that has been run to create the output into the same single file. I understand either of *some_command* > file.txt *some_command* | ...
0votes
2answers
81views
Piped greps for looking inside files
(self-migrated from ask-ubuntu because it's linux-related, not ubuntu, and my os isn't ubuntu) I'm trying to make a grep that looks like this: grep -r 2019 | grep -riv FAILED | grep -rl DSL I want ...