Ask HN: What are your favorite one-liner shell commands you use?
8 rajkumarsekar 7 7/17/2025, 4:45:21 AM
There are plenty of lists online with fancy or obscure one-liners, but I’m curious about the ones people actually use day to day.
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)
More to the letter of the question, I use "cd -" frequently, "ps -e | grep some_process_i_would_like_the_pid_for", and while I don't use it frequently, I didn't know about "ssh-copy-id" for a long time, and would do it manually with a text editor in the past. Sorry if they are not sufficiently fancy - but for things to get used day to day for me, they will need to be short and sweet.
Great simple test for network speed on a box without speedtest-cli or other tools installed.