Issue
I'm trying to create an alias that opens google chrome to localhost. Port 80 in this case.
I'd also really like to be able to be in any git directory and have it open that specific project in the browser, but I'm not sure if that's even possible.
- How do I open google chrome from the terminal?
- What alias could I use to open the current git project in the browser?
More Details:
- My localhost is set to port 80.
- I store my git repositories in ~/Sites/ - meaning if I wanted to view any project in the browser it would be found here:
http://localhost/FILENAME
Thank You
Solution
UPDATE:
- How do I open google chrome from the terminal?
Thank you for the quick response. open http://localhost/
opened that domain in my default browser on my Mac.
- What alias could I use to open the current git project in the browser?
I ended up writing this alias, did the trick:
# Opens git file's localhost; ${PWD##*/} is the current directory's name
alias lcl='open "http://localhost/${PWD##*/}/"'
Thank you again!
Answered By - Spencer Rohan Answer Checked By - Mary Flores (WPSolving Volunteer)