Skip to content

Instantly share code, notes, and snippets.

@fbakhda
Last active November 21, 2024 09:53
Show Gist options
  • Save fbakhda/216647f2bd20013491e209c6a5a2ebaa to your computer and use it in GitHub Desktop.
Save fbakhda/216647f2bd20013491e209c6a5a2ebaa to your computer and use it in GitHub Desktop.
Simplify doing ssh via alias "sshlist" to list all possible SSH Clients from your .ssh/config
alias ll='ls -la'
alias sshlist='awk '\''BEGIN { printf("%-30s %-30s %-10s %-s\n", "Host", "HostName", "Port", "User") } /^Host / {host=$2} /Hostname / {hostname=$2} /Port / {prt=$2} /User / {usr=$2; printf "%-30s %-30s %-10s %s\n", host, hostname, (prt ? prt : "NA"), (usr ? usr : "NA"
)}'\'' ~/.ssh/config'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment