Skip to content

Instantly share code, notes, and snippets.

@dotancohen
Created May 7, 2018 11:41
Show Gist options
  • Save dotancohen/3364affc03a805032f013356973d9ea4 to your computer and use it in GitHub Desktop.
Save dotancohen/3364affc03a805032f013356973d9ea4 to your computer and use it in GitHub Desktop.
Output URLs of the website whose DOCUMENT_ROOT is the current directory.
# Output URLs of the website whose DOCUMENT_ROOT is the current directory.
# Reads from hosts file and Apache config
alias localurl='grep "$(grep -r -C3 $(pwd) /etc/httpd/vhost.d/ | grep -ioP "servername(.*)|serveralias(.*)" | awk '\''{print $2}'\'')" /etc/hosts | awk '\''{print $2}'\'' '
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment