Daily, and with enough general usability to share? I have a few. They are basic. You can probably figure out what industry I work in. df -h /; echo "----"; for fattable in $(find /var/lib/mysql/ -name *.ibd -size +1G -exec ls -lh {} \; | awk '{ print $9 }' );do echo BEFORE " " $(ls -lh $fattable| awk '{ print $5" " }'); db=$(echo $fattable| cut -d/ -f5); otable=$(echo $fattable| cut -d/ -f6| cut -d. -f1); echo mysql…
Some kinda shared hosting?
Ask HN: What are your favorite one-liner shell commands you use?
31–40 of 44 posts
Re: Ask HN: What are your favorite one-liner shell commands you use?
#32Re: Ask HN: What are your favorite one-liner shell commands you use?
#33I 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…
How does this work?
Re: Ask HN: What are your favorite one-liner shell commands you use?
#34For complex one liners, I keep them in a simple txt file with a brief description so I can find them later when I need to use them again.
Re: Ask HN: What are your favorite one-liner shell commands you use?
#35I 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…
> using pv (pipeviewer) instead of cat to get a progress bar when grepping huge files. How does this work?
https://www.geeksforgeeks.org/linux-unix/pv-command-in-linux...
Re: Ask HN: What are your favorite one-liner shell commands you use?
#36Earlier quoted context omitted.
> using pv (pipeviewer) instead of cat to get a progress bar when grepping huge files. How does this work?
This seems to be a nice introduction: https://www.geeksforgeeks.org/linux-unix/pv-command-in-linux...
Re: Ask HN: What are your favorite one-liner shell commands you use?
#37```alias hstat="curl -Lo /dev/null --silent --head --write-out '%{http_code}\n'" $1 #HTTP status code```
example:
```$ hstat google.com 200```
Re: Ask HN: What are your favorite one-liner shell commands you use?
#38I have had the alias `huh` for years, which is just `pwd; whoami` just to confirm I am where I think I am, and I am who I think I am
Re: Ask HN: What are your favorite one-liner shell commands you use?
#39I 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…
Re: Ask HN: What are your favorite one-liner shell commands you use?
#40Daily, and with enough general usability to share? I have a few. They are basic. You can probably figure out what industry I work in. df -h /; echo "----"; for fattable in $(find /var/lib/mysql/ -name *.ibd -size +1G -exec ls -lh {} \; | awk '{ print $9 }' );do echo BEFORE " " $(ls -lh $fattable| awk '{ print $5" " }'); db=$(echo $fattable| cut -d/ -f5); otable=$(echo $fattable| cut -d/ -f6| cut -d. -f1); echo mysql…