Command help

Tero Pesonen mail at tpesonen.net
Thu Aug 11 16:39:09 UTC 2011


On Thu, 2011-08-11 at 11:03 -0400, nathan nolast wrote:
> so, is it possible to redirect the output of a file? 
> 
> touch ioredirect.txt
> echo "this is a test" > ioredirect.txt
> vim.tiny ioredirect.txt   -- looks good :) 
> echo < ioredirect.txt 
> 
> ?

cat < ioderict.txt 

Note also the use of a pipe '|' for "piping" the standard output of one
command into another command's standard input. 

e.g. something I do regularly, encrypt and decrypt a collection of
files:
tar cf - directory | gpg -c > directory.tar.gpg
gpg -d directory.tar.gpg | tar xf -

Or e.g. split the tar archive into 100MB chunks.
- tells tar to write to stdout, and split to read from stdin.
gpg reads and writes to stdout here by default.
tar cf - dir | gpg -c | split -b100m -d - dir.tar.gpg.

And decrypt:
cat dir.* | gpg -d | tar xf -

And so forth.

Tero






More information about the ubuntu-users mailing list