compressing and uncompressing a file with the help of xargs

$ls stderr.txt 
stderr.txt
$ls stderr.txt | xargs ls
stderr.txt
$ls stderr.txt | xargs cat
/home/jeffrin/quark/kernel/run_kernel.sh: line 10: ./main.native: No such file or directory
$ls stderr.txt | xargs gzip
$ls stderr.txt 
ls: cannot access 'stderr.txt': No such file or directory
$ls stderr.txt.gz | xargs gunzip 
$ls stderr.txt 
stderr.txt
$

Leave a comment

Your email address will not be published. Required fields are marked *