domingo, 4 de março de 2012

Shell: Cat Command Examples

To create a file called "foo.txt", enter:
cat >foo.txt
Unix is the best.
<control-D>

You can combine two files and creates a new file called report.txt, enter:
cat score.txt names.txt > report.txt

To append (add data to existing) data to a file called foo.txt, enter:
cat >>foo.txt
A champion is someone who gets up, even when he can't
<control-D>

You can send files to sound devices such as /dev/dsp or /dev/audio to make sure sound output and input is working:

cat filename >/dev/dsp
cat recording.au >/dev/audio

You can simply use the following command for recording voice sample and play back with it cat command:

dd bs=8k count=4 </dev/audio >testing123.au
cat testing123.au >/dev/audio

No cat cannot print in reverse order but tac command can concatenate and print files in reverse:

tac fileName
cat fileName | tac
tac <<<"$myFileName"

Referência: Linux / Unix: Cat Command Examples

Nenhum comentário:

Postar um comentário

Drunk Penguins

Drunk Penguins
Drunk Penguins