Skip to main content
broken image fixed (click 'rendered output' or 'side-by-side' to see the difference; images currently unavailable because of expired SSL certificate); for more info, see https://gist.github.com/Glorfindel83/9d954d34385d2ac2597bbe864466259f
Source Link

After hours of playing with bash, I found a way how Google is doing it. It is using one of these 2 programs:

Both of them support lossless and lossy conversion. I tried the second one, in Ubuntu as jpegoptimjpegoptim Install jpegoptim http://hostmar.co/software-smallInstall jpegoptim.

.

Than to do what I want I have to do the following:

find MyDirectory/ -type d -exec sh -c ' ls "$0"/*.jpg 2>/dev/null && jpegoptim --strip-all -t "$0"/*.jpg ' {} \; 

This is doing really close to what I want. The only problem is that I see a lot of output about each file compression and I can not get rid of it with -q because it also get rid of summary. But this is the closest I was able to get with my just learned bash "skills". I asked a follow-up question on Ask Ubuntuasked a follow-up question on Ask Ubuntu.

It is really fast. It took it < 5 sec to process few thousands of files.

After hours of playing with bash, I found a way how Google is doing it. It is using one of these 2 programs:

Both of them support lossless and lossy conversion. I tried the second one, in Ubuntu as jpegoptim Install jpegoptim http://hostmar.co/software-small.

Than to do what I want I have to do the following:

find MyDirectory/ -type d -exec sh -c ' ls "$0"/*.jpg 2>/dev/null && jpegoptim --strip-all -t "$0"/*.jpg ' {} \; 

This is doing really close to what I want. The only problem is that I see a lot of output about each file compression and I can not get rid of it with -q because it also get rid of summary. But this is the closest I was able to get with my just learned bash "skills". I asked a follow-up question on Ask Ubuntu.

It is really fast. It took it < 5 sec to process few thousands of files.

After hours of playing with bash, I found a way how Google is doing it. It is using one of these 2 programs:

Both of them support lossless and lossy conversion. I tried the second one, in Ubuntu as jpegoptim Install jpegoptim

.

Than to do what I want I have to do the following:

find MyDirectory/ -type d -exec sh -c ' ls "$0"/*.jpg 2>/dev/null && jpegoptim --strip-all -t "$0"/*.jpg ' {} \; 

This is doing really close to what I want. The only problem is that I see a lot of output about each file compression and I can not get rid of it with -q because it also get rid of summary. But this is the closest I was able to get with my just learned bash "skills". I asked a follow-up question on Ask Ubuntu.

It is really fast. It took it < 5 sec to process few thousands of files.

replaced http://askubuntu.com/ with https://askubuntu.com/
Source Link

After hours of playing with bash, I found a way how Google is doing it. It is using one of these 2 programs:

Both of them support lossless and lossy conversion. I tried the second one, in Ubuntu as jpegoptim Install jpegoptim http://hostmar.co/software-small.

Than to do what I want I have to do the following:

find MyDirectory/ -type d -exec sh -c ' ls "$0"/*.jpg 2>/dev/null && jpegoptim --strip-all -t "$0"/*.jpg ' {} \; 

This is doing really close to what I want. The only problem is that I see a lot of output about each file compression and I can not get rid of it with -q because it also get rid of summary. But this is the closest I was able to get with my just learned bash "skills". I asked a follow-up question on Ask Ubuntuasked a follow-up question on Ask Ubuntu.

It is really fast. It took it < 5 sec to process few thousands of files.

After hours of playing with bash, I found a way how Google is doing it. It is using one of these 2 programs:

Both of them support lossless and lossy conversion. I tried the second one, in Ubuntu as jpegoptim Install jpegoptim http://hostmar.co/software-small.

Than to do what I want I have to do the following:

find MyDirectory/ -type d -exec sh -c ' ls "$0"/*.jpg 2>/dev/null && jpegoptim --strip-all -t "$0"/*.jpg ' {} \; 

This is doing really close to what I want. The only problem is that I see a lot of output about each file compression and I can not get rid of it with -q because it also get rid of summary. But this is the closest I was able to get with my just learned bash "skills". I asked a follow-up question on Ask Ubuntu.

It is really fast. It took it < 5 sec to process few thousands of files.

After hours of playing with bash, I found a way how Google is doing it. It is using one of these 2 programs:

Both of them support lossless and lossy conversion. I tried the second one, in Ubuntu as jpegoptim Install jpegoptim http://hostmar.co/software-small.

Than to do what I want I have to do the following:

find MyDirectory/ -type d -exec sh -c ' ls "$0"/*.jpg 2>/dev/null && jpegoptim --strip-all -t "$0"/*.jpg ' {} \; 

This is doing really close to what I want. The only problem is that I see a lot of output about each file compression and I can not get rid of it with -q because it also get rid of summary. But this is the closest I was able to get with my just learned bash "skills". I asked a follow-up question on Ask Ubuntu.

It is really fast. It took it < 5 sec to process few thousands of files.

link ot the AU question
Source Link

After hours of playing with bash, I found a way how Google is doing it. It is using one of these 2 programs:

Both of them support lossless and lossy conversion. I tried the second one, in Ubuntu as jpegoptim Install jpegoptim http://hostmar.co/software-small.

Than to do what I want I have to do the following:

find MyDirectory/ -type d -exec sh -c ' ls "$0"/*.jpg 2>/dev/null && jpegoptim --strip-all -t "$0"/*.jpg ' {} \; 

This is doing really close to what I want. The only problem is that I see a lot of output about each file compression and I can not get rid of it with -q because it also get rid of summary. But this is the closest I was able to get with my just learned bash "skills". I asked a follow-up question on Ask Ubuntu.

It is really fast. It took it < 5 sec to process few thousands of files.

After hours of playing with bash, I found a way how Google is doing it. It is using one of these 2 programs:

Both of them support lossless and lossy conversion. I tried the second one, in Ubuntu as jpegoptim Install jpegoptim http://hostmar.co/software-small.

Than to do what I want I have to do the following:

find MyDirectory/ -type d -exec sh -c ' ls "$0"/*.jpg 2>/dev/null && jpegoptim --strip-all -t "$0"/*.jpg ' {} \; 

This is doing really close to what I want. The only problem is that I see a lot of output about each file compression and I can not get rid of it with -q because it also get rid of summary. But this is the closest I was able to get with my just learned bash "skills".

It is really fast. It took it < 5 sec to process few thousands of files.

After hours of playing with bash, I found a way how Google is doing it. It is using one of these 2 programs:

Both of them support lossless and lossy conversion. I tried the second one, in Ubuntu as jpegoptim Install jpegoptim http://hostmar.co/software-small.

Than to do what I want I have to do the following:

find MyDirectory/ -type d -exec sh -c ' ls "$0"/*.jpg 2>/dev/null && jpegoptim --strip-all -t "$0"/*.jpg ' {} \; 

This is doing really close to what I want. The only problem is that I see a lot of output about each file compression and I can not get rid of it with -q because it also get rid of summary. But this is the closest I was able to get with my just learned bash "skills". I asked a follow-up question on Ask Ubuntu.

It is really fast. It took it < 5 sec to process few thousands of files.

link to the package page rather than use a specific package management command; don't parse the output of find as it would mangle directory names containing e.g. spaces
Source Link
Loading
Source Link
Salvador Dali
  • 381
  • 1
  • 2
  • 14
Loading