hatina
asked on
Need gzip examples in pipe
For a learning purposes I search a simple examples for using gzip in pipe
with basic linux commands
Something like
...... | gzip -c > .....
or
...... | gzip -d > .....
(not only tar nor , I need a factics output for any simple Linux commands )
Can anybody help me quick ???
Thanks
Petr
with basic linux commands
Something like
...... | gzip -c > .....
or
...... | gzip -d > .....
(not only tar nor , I need a factics output for any simple Linux commands )
Can anybody help me quick ???
Thanks
Petr
ASKER
I do not need simple gzip using,...
I need a practical examples cooperative with another Linux commands through pipe.........!!!!!!!!!!!!
I need a practical examples cooperative with another Linux commands through pipe.........!!!!!!!!!!!!
Which commands ?? The above are as good as practical exmaples ... you can complicate either side of pipe as much as you desire
cat file1 file2 | gzip > foo.gz
can be morphed to
find <some_dir> -type f -name "foo" -exec car {} \; | gzip > total_foo.gz
cat file1 file2 | gzip > foo.gz
can be morphed to
find <some_dir> -type f -name "foo" -exec car {} \; | gzip > total_foo.gz
find <some_dir> -type f -name "foo" -exec cat {} \; | gzip > total_foo.gz
^
^
There is always the simple
gzip -c (file.tgz) | tar xvf -
gzip -c (file.tgz) | tar xvf -
I hate it when fingers slip off the keys... There is a missing key in there.
gzip -cd (file.tgz) | tar x
or for those of us who like output
gzip -cd (file.tgz) | tar xv
or still
gzip -cd (file.tgz) | tar xvf -
gzip -cd (file.tgz) | tar x
or for those of us who like output
gzip -cd (file.tgz) | tar xv
or still
gzip -cd (file.tgz) | tar xvf -
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Another practical example ;-)
Say, you have to capture all packets going through your network interface for some time and you may want to store it in an archive. You may then use a command like follows:
tcpdump -s0 -X -vv | gzip > dump.gz
(You have to kill tcpdump from another terminal. If you press Ctrl+C in the same terminal, gzip cannot close the archive properly.)
Say, you have to capture all packets going through your network interface for some time and you may want to store it in an archive. You may then use a command like follows:
tcpdump -s0 -X -vv | gzip > dump.gz
(You have to kill tcpdump from another terminal. If you press Ctrl+C in the same terminal, gzip cannot close the archive properly.)
check gzip man page for more examples
cat file1 file2 | gzip > foo.gz
gzip -cd old.gz | gzip > new.gz
Sunnycoder