Tag Info

New answers tagged


For your local network, you could use rsync over rsh instead of ssh. In fact, man rsync gives this as a specific alternative transport to ssh.


Rsync isn't the fastest thing in the world, but for long links I prefer to use it over HPN SSH. This is normal OpenSSH, but with some patches that offer a few benefits. Relevant to what you want, it allows the "none" encryption option for the transfer. I find it especially valuable at a company where we have WAN accelerators. I can't change their ...


This server fault answer claims that one of the primary benefits of using the rsync daemon mode is the lower CPU overhead.


dd to the rescue. gzip -fc testfile | dd of=testfile.gz 0+1 records in 0+1 records out 42 bytes (42 B) copied, 0.00018711 s, 224 kB/s or in your ssh example gzip -fc testfile | dd | ssh serverip "cat > file.gz" 0+1 records in 0+1 records out 42 bytes (42 B) copied, 0.00018711 s, 224 kB/s And then just parse the output of the commands using awk or ...


You can see what compressions are supported for initramfs with: zgrep CONFIG_RD_ /proc/config.gz # or grep CONFIG_RD_ /usr/src/linux/.config


Look ma, no loops! Here is another solution, that may be slightly faster, because it doesn't use loops, but still arrives at the same answer. unzip -l \*.zip|awk 'BEGIN{total=0}/ [0-9]+ files/{total=total+$1;}END{print "total bytes: "total}' The "BEGIN{total=0}" part isn't strictly required.


unzip -l lists the size of each file and prints a final line with their sum. So you can loop through the zip files and add up the output of unzip -l "$zip" | awk 'END {print $1}' or of unzip -Zt "$zip" | awk 'END {print $3}'. For a shell loop, unzip -Zt may be a little faster: total=0 for z in *.zip; do set $(unzip -Zt -- "$z") total=$((total + $3)) ...


You can do that using unzip -Zt zipname which prints a summary directly about the archive content, with total size. Here is an example on its output: unzip -Zt a.zip 1 file, 14956 bytes uncompressed, 3524 bytes compressed: 76.4% Then, using awk, you can extract the number of bytes: unzip -Zt a.zip | awk '{print $3}' 14956 Finally, put it in a for loop ...


If you type unzip -l <zipfile>, it prints a listing of files within the zip, with their uncompressed sizes, then the total uncompressed size of all of them. This is human-readable output, but you can get a machine-readable number using unzip -l <zipfile> | tail -n1 | awk '{ print $1 }'. To get a total size: total=0 for file in *.zip; do # or ...

Top 50 recent answers are included