I rarely use the exact samme command multiple times. But here are some bash pipe segments I enjoy.
using pv (pipeviewer) instead of cat to get a progress bar when grepping huge files.
Using httpie instead of curl so I can remember the flags.
The power of find -exec to run commands on a lot of specific files. The nice part is you can run it without exec first to see if you have the right set of files.
If you do a loop you can echo -e “$somevar\r” and then each write will overwrite the previous line so you screen doesn’t fill up but you do get a feel for the progress (to make it nice you need to pad with spaces, google for echo carriage return to learn more)
Comments
I rarely use the exact samme command multiple times. But here are some bash pipe segments I enjoy.
using pv (pipeviewer) instead of cat to get a progress bar when grepping huge files.
Using httpie instead of curl so I can remember the flags.
The power of find -exec to run commands on a lot of specific files. The nice part is you can run it without exec first to see if you have the right set of files.
If you do a loop you can echo -e “$somevar\r” and then each write will overwrite the previous line so you screen doesn’t fill up but you do get a feel for the progress (to make it nice you need to pad with spaces, google for echo carriage return to learn more)
How does this work?
This seems to be a nice introduction:
https://www.geeksforgeeks.org/linux-unix/pv-command-in-linux...
I'm curious about your use of `pv` with `cat` and `grep` on large files.
Some great power tips here, especially love the pv + grep combo for big files.
Find's -exec option is great when you need to automate removing old backups