Following on my from Useful Linux Terminal Commands here is my Useful OSX Terminal Commands. This guide is handy for setting up a development OSX installation (e.g Apache, PHP, MySQL etc). I will update this post when I find new commands.
First, read my Useful Linux Terminal Commands post.
Normally I set up Ubuntu servers in the cloud on Vultr (read my guide here) or Ubuntu Servers on Digital Ocean (read my guide here) but this is how I can quickly set up a development environment locally on OSX.
Useful OSX Commands
Prevent your Mac from falling asleep
Prevent your Mac from falling asleep (for 1 minute)
Show hidden files in Finder
Find file on OSX
Find all listening ports
Find process listening on port 80
Find a Process
Find A File (e.g httpd.conf)
Note: OSX Apache Index file location is…
To edit the default HTML file
Disable built-in OSX apache daemon
Restart built-in Apache daemon
View other startup daemons
View All Startup Daemons
Force network drives to automatically connect after each login (instead of manually connecting)
Set PHP as default Web Server delivered file in local Apache
Install PHP 7.0 on to OSX
FYI: 7.1 and 7.2 are out but I find 7.0 is more stable with WordPress (read more here).
Create a diag file in your OSX Default Apache root
Edit your default index file
Now load the file
Install MySQL on OSX
Uninstall MySQL OSX
Add MySQL to PATH
Reboot and Check the MySQL Service
Check MySQL Version
Login to MySQL from the Command Line
Set a new root password (after logging in as root)
fyi: You can obtain a good password here.
Bonus: Install MySQL (PHP) management tool (in Apache)
Download: https://www.adminer.org/#download Save the file to /Library/WebServer/Documents/adminer.php
Load Adminer in your browser and log in with your root password
Login to Adminer (via Apache/PHP)
Creating MySQL Tables in Adminer (via Apache/PHP)
Adminer allows you to fully manage your MySQL (create databases, users, run queries, alter objects etc)
Adding Records to MySQL with Adminer
Read more here: https://community.jaspersoft.com/wiki/uninstall-mysql-mac-os-x
Get your Mac Processor Name
Show All OSX System Settings
Show Live File System Usage
Show last 10 lines of the system log
Get Your Local WAN IP Address
Get your Public IPV4 Address
More to come.
Hope this helps someone.
Donate and make this blog better
Ask a question or recommend an article
[contact-form-7 id=”30″ title=”Ask a Question”]
v1.2 Find file (current version)
v1.1 Removed system info chunk (too big to format)