Launch apps for work in OSX Command line
We’re going to show how to launch any graphical Mac app from the command line of OS X, including how to open specific files from the command line with a GUI app, and how to edit and open those files with root access if it’s necessary. For example this will open all apps for your work
- PHP Storm
Step 1: Create shell file
Create a file /usr/local/bin/work with code at the bellow: sudo nano /usr/local/bin/work
echo -e "Killing Mysql Server pid."
sudo pkill mysqld
sudo /usr/local/mysql/support-files/mysql.server start
echo -e "Opening PhpStorm"
echo -e "Opening Skype"
echo -e "Opening Slack"
Step 2: Set file able to excecute
sudo chmod +x /usr/local/bin/work
now enjoy by open terminal and type this command: work