Disable Wake From Sleep When Opening the Lid of a MacBook Pro
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:
The command line interface is an alternate method of interacting with macOS and Mac OS X, relying on text based command entry to execute commands and perform tasks. It is accessed on the Mac by using the Terminal application. Generally, the command line is considered advanced, and thus it’s usage tends to be more complex than many standard procedures on a Mac.
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:
You can quickly retrieve any Macs serial number via the command line by using the ioreg or system_profiler command and grep for the serial string. Getting the serial number from the command line like this can be helpful for troubleshooting, Single User Mode, remote management with SSH, or for many other reasons, though most users … Read More
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
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.
If you’re coming to Mac OS X from elsewhere in the unix & x11 world, you might be used to the focus of Terminal windows following your mouse cursor. With a little command line magic, we can enable this hidden feature in the Mac OS X Terminal.app too.
If you’ve been looking for a great SSH client for iPad or iPhone, Prompt is probably exactly what you’ve been searching for. Released by Panic software, Prompt is a great looking SSH app that includes a bunch of features to improve the SSH experience from an iOS device. Notable features are: autocompletion of frequently used … Read More
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]
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.
You can quickly launch a new styled Terminal window through the apps Mac OS X Dock icon. Just right-click (two-finger click for trackpad users) on the Terminal app, navigate to “New Window” select a preconfigured style.
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.
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
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
If you want to quickly backup an entire website through FTP, the absolute easiest way to do this is through the command line using the wget command. In fact, you can backup an entire site (or whatever else is on the entire FTP server) with a single command string.
The vast majority of Mac users won’t need to manually tweak launchd and launchctl, but there are times when you uninstall or stop using an app in Mac OS X and a service agent continues to needlessly load in launchd. This is annoying, but these rogue agents are easy to remove via the command line, … Read More
Want to change the crontab editor on the Mac? You can do that! We’ll show you how to use a different crontab editor on a selective per-edit basis, and also how to change the default crontab text editor. You can use vi, emacs, nano, or whatever else you’d like. Most hardcore command line users and … Read More
You can instantly print any Finder items full path and name into the Terminal by dragging and dropping an item from a Finder window and into a Terminal window. Once the Finder item has been dropped into the terminal, the entire path to the item is automatically typed out instantaneously, maintaining both proper capitalization as … Read More
If you’re trying to remember an exact command you executed via the Terminal but can’t quite come up with it, you can query your command line history to discover old commands that have been run or executed in the past. This trick to find and retrieve prior commands executed in the command line works on … Read More
Want to update Mac OS software from the Terminal? You can check for available updates, ignore packages, and install any or all Mac OS X Software Updates directly from the command line. To see what updates are available for a Mac, or to install a software update from the Terminal of Mac OS X, amongst … Read More