Open a URL in the Default Browser from the Command Line

Jul 18, 2011 - 2 Comments
Safari icon

Using the command line open tool, you can immediately launch any URL from the Terminal into the default web browser of Mac OS X. In other words, you’re launching the specified site into a GUI browser from the command line. The syntax to open any URL into the default web browser like this is remarkably … Read More

Change User Agent with curl to Get URL Source Code as Different OS & Browser

Jul 16, 2011 - 3 Comments

Using curl we can retrieve the HTML & CSS source code of any specified URL and even the http header info, but some sites serve completely different content or HTML to different OS and browser versions, this is done by detecting their user agent. Because of this, we can spoof the user agent of another … Read More

Get HTTP Header Info from Web Sites Using curl

Jul 7, 2011 - 7 Comments
Terminal in macOS

The easiest way to get HTTP header information from any website is by using the command line tool curl. The syntax to retrieve a website header goes like this:

Get DNS Server IP Addresses from the Command Line in Mac OS X

Jun 3, 2011 - 6 Comments

You can quickly retrieve active DNS server IP addresses on any Mac by using the networksetup utility. This is done from the command line, so launch the Terminal app and type one of the following command strings, dependent on the version of OS X that is running on the Mac.

Enable and Disable AirPort Wireless from the Command Line in Mac OS X

May 31, 2011 - 12 Comments
AirPort Wireless icon

Sometimes the easiest fix when troubleshooting an AirPort wireless connection problem is to just turn AirPort on and off. Instead of using the menu item or System Preferences, we can enable and disable AirPort very quickly directly from the Mac OS X Terminal.

Launch & Run Multiple Instances of Any Application in Mac OS X

May 11, 2011 - 15 Comments
Run Multiple Instances of Any Application in Mac OS X

You can run multiple instances of any application in Mac OS X with a little command line magic. Using the ‘open’ command to launch GUI apps from the Terminal, we can run a new instance of any app, even if it is already running.

Generate Random Passwords from the Command Line

May 10, 2011 - 12 Comments

Some of the most secure passwords you can use are those that are randomly generated. From the command line, you can randomize potential passwords in a multitude of ways, which can be used as secure passwords of generated characters. We’ll cover several primary methods of generating random sequences and then show you how to combine … Read More

Transfer Clipboard Text & Source Code From One Mac To Another Over SSH

May 5, 2011 - 6 Comments
Transfer Source Code and Text over SSH

Do you have some source code, text, or a command string that you want to securely transfer from one Mac to another? Combining the command line clipboard tools pbcopy and pbpaste with SSH we can do exactly that, and it doesn’t matter where the other Mac is located: be it LAN, WAN, or anywhere. Here … Read More

Show What Apps & Processes Are Using an Internet Connection via Command Line in Mac OS X

Apr 29, 2011 - 3 Comments
Mac Wi-Fi Tool

Much like you can monitor Mac OS X filesystem usage through the command line, you can also discover what apps and individual processes are currently using your Macs internet connection. This is a really handy trick if you know your bandwidth is being used by something, or if you’re just trying to track down what … Read More

Disable Wake From Sleep When Opening the Lid of a MacBook Pro

Apr 26, 2011 - 7 Comments

If you don’t want your MacBook Pro to wake from sleep when you open the lid of the machine, all you need to do is launch the Terminal and type the following command:

Change the Admin Password with Mac OS X Single User Mode

Apr 25, 2011 - 65 Comments
Change Unknown Admin Password in Mac OS X

If you’re in IT, or just fixing Grandmas Mac, it’s not too uncommon to get a machine where you don’t have the admin users password. If you find yourself in this situation, you can easily change the Admin password, or any other users, simply by booting into Mac OS X‘s command line Single User Mode. … Read More

Monitor Mac OS X Filesystem Usage & Access with opensnoop

Apr 22, 2011 - 11 Comments
Monitor Mac OS X Filesystem Use and Access

The opensnoop utility is an amazing tool for tracking down specifics like what files specific applications are accessing, but you can also use opensnoop to monitor all filesystem access in Mac OS X. To do this, run the utility with no flags attached: sudo opensnoop You’ll be asked for your root password, and then you’ll … Read More

Follow System & Kernel Logs from Command Line in Mac OS X

Apr 20, 2011 - 1 Comment
Mac OS X Console Logs from Command Line

If you’re troubleshooting some of the more difficult problems that you can have on a Mac, a good place to look are the System & Kernel Logs contained within Console app. But you can access the same OS X logs from the Terminal too.

Connect to a Wireless Network from the Command Line

Apr 12, 2011 - 16 Comments

Using the powerful ‘networksetup’ utility, we can connect to wireless networks directly from the command line of Mac OS X. The syntax you’ll want to use to accomplish joining a network is as follows: networksetup -setairportnetwork [interface] [router SSID] [password]

Use Aliases to Create SSH Shortcuts

Apr 11, 2011 - 12 Comments

More fun with SSH! We showed you how to setup SSH config files and use tab completion for SSH aliases, but setting up bash aliases is even easier if you are connecting to the same server over and over again.

Quickly Copy HTML & CSS Source to the Clipboard with curl

Apr 9, 2011 - 4 Comments

Using curl and pbcopy, we can quickly grab and copy HTML and CSS code from any URL via the command line. This should be a helpful tip for the web developers out there, but for anyone looking to check the source of a web page through this can be an invaluable little trick.

Enable Tab Completion for SSH Aliases

Apr 6, 2011 - 17 Comments

Yesterday we showed you how to setup a basic SSH Config file, and here’s how to make that even more useful: enable tab completion for those SSH aliases. Throw this into ~/.bash_profile or ~/.bashrc # Add Tab-completion for SSH host aliases complete -o default -o nospace -W "$(/usr/bin/env ruby -ne ‘puts $_.split(/[,s]+/)[1..-1].reject{|host| host.match(/*|?/)} if $_.match(/^s*Hosts+/);’ … Read More

Setup an SSH Config File

Apr 5, 2011 - 8 Comments

If you use SSH even somewhat often, it would benefit you to setup a basic SSH config file. If you’re curious why, would you rather type something like this: ssh -p 6851 user@servername.domain.com Or just type: ssh name I know what I’d rather do, so let’s get this working. I’m going to use nano editor … Read More

Subscribe to OSXDaily

Subscribe to RSS Subscribe to Twitter Feed Follow on Facebook Subscribe to eMail Updates

Tips & Tricks

News

iPhone / iPad

Mac

Troubleshooting

Shop on Amazon to help support this site