Skip to content

Instantly share code, notes, and snippets.

@shenoy-anurag
Last active September 21, 2022 05:04
Show Gist options
  • Save shenoy-anurag/c531fef4831a0784a9a40ab2079a50e9 to your computer and use it in GitHub Desktop.
Save shenoy-anurag/c531fef4831a0784a9a40ab2079a50e9 to your computer and use it in GitHub Desktop.
Useful Bash commands
#!/usr/bin/env bash
alias ip="dig +short myip.opendns.com @resolver1.opendns.com" # returns public IP address.
alias localip="ipconfig getifaddr en0" # returns private/local network DHCP IP address. change to en1 if using ethernet.
service_name="mongod"
sudo service $service_name status # shows status of service_name. eg: sudo service mongod status
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment