The Blog of Someone Who Builds Things on the Internet

I google how to do things, then post the answers here cause I'll probably forget. Maybe someone else finds it useful.

Terminal Command Shortcuts

Published February 22, 2017

Typing long commands out in the terminal can be a pain, like SSHing into a server you use daily.

To make a shortcut, edit your bash_profile

nano ~/.bash_profile

Then add the shortcut by adding this line to the bottom of the file

alias someservername='ssh -p 1234 username@sshserver.com'

Then all you have to do to connect to that server in the future is

someservername

You can do this with any command, not just ssh. But if you do it with SSH, you should setup public key authentication to speed that up. I'll write about that sometime cause I always forget how to do that too.

Here are some other ones I have setup on my machines. (I got these of the internet at some point. I don't know where)

alias ll='ls -lh'
alias la='ls -lhA'
alias l='ls'
alias c='clear'
alias x='exit'
alias q='exit'

Source