Hacker News new | ask | show | jobs
by coderobe 2817 days ago
This article covers gems like `alias c='clear'` - very handy! scnr
3 comments

On a more serious note,

> alias www='python -m SimpleHTTPServer 8000'

that'll only work on systems where python is python2

> alias speed='speedtest-cli --server 2406 --simple'

speedtest-cli automatically selects a server, invoking it without any opts at all is perfectly fine

> alias ipi='ipconfig getifaddr en0'

the interface name is not predictable, nor portable - `ip a`

Most if not all of these aliases seem rather pointless after all

> A normal ping will go on forever. We don't want that. Instead, let's limit that to just five pings.

It almost always what I want.

> alias getpass="openssl rand -base64 20"

If you really want to be handy, use "pass generate -c" instead of openssl, you got the password stored in your passstore and temporary copied to the clipboard.

On Mac ⌘ + k works well in iTerm and the stock terminal. I can't be sure if it is a standard thing or not so I'm not going to make any assumptions about it working in other places.
I prefer ctrl+L
They're not quite equivalent. `clear` clears the scroll-buffer, but ctrl+l doesn't, it just clears the screen.

ctrl+l is generally the one I want.

That's emacs, not bash. It only works when "set -o emacs"