ls > a.txt
ls | wc -l
ls &
(echo a ; echo b) | wc -l
ls > a.txt | cat
#!/bin/bash
#!/bin/sh
$ echo hello > /etc/a.txt bash: /etc/a.txt: Permission denied $ sudo echo hello > /etc/a.txt bash: /etc/a.txt: Permission denied