Command Line

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.

Search Command Line

How to Get Current Screen Resolution from Command Line in Mac OS X

Aug 31, 2014 - 6 Comments
Display resolutions in Mac

Typically Mac users will retrieve the screen resolution of connected displays through the Displays system preference panel in OS X. There’s certainly nothing wrong with that approach, it’s easy and quick, but because it uses the graphical interface of OS X it’s not necessary helpful for scripting purposes or remote management through Remote Login and … Read More

How to Add a New Path to PATH at Command Line the Right Way

Aug 14, 2014 - 6 Comments
Add a new PATH to $PATH in OS X Terminal

The user path is the series of directories that command line programs are searched in order to run. For example, if you type ‘iostat’ into the terminal, then iostat will be run from /usr/sbin because “/usr/sbin” is part of your $PATH. Accordingly, users who frequently use the command line may need to adjust or add … Read More

How to Completely Remove Apps & Software in Mac OS X by Manual Terminal Uninstall

Jul 31, 2014 - 29 Comments
Terminal

Most apps in Mac OS X can be uninstalled easily by dragging them into the Trash from the /Applications/ folder, and many others come with accompanying uninstall applications that will clean house and completely remove the apps too. Additionally, there are third party utilities for Mac OS that can make total removal of apps as … Read More

Advanced Mac OS X Diagnostics & Troubleshooting with sysdiagnose

Jul 29, 2014 - 8 Comments
sysdiagnose advanced Mac diagnostics in OS X

Mac users who are dealing with particularly complex or troublesome issues with Mac OS can turn to an advanced diagnostics tool available from the command line in Mac OS X. The tool, called sysdiagnose, offers detailed technical analysis and reports of a huge variety of components of OS X and the Mac hardware, making it … Read More

Maintain & Recall Command Line Clipboard History with iTerm 2

Jul 15, 2014 - 2 Comments
Command Line Clipboard History in iTerm2

Mac users who spend a lot of time at the command line have yet another reason to use iTerm 2 as their default terminal client; clipboard history. Added in the most recent version of iTerm, a running history of OS X clipboard activity can be natively stored, recalled, and summoned directly in iTerm2, accessible through … Read More

Get a Rainbow of Colors for Terminal Command Output with lolcat

Jul 3, 2014 - 6 Comments
lolcat rainbow terminal cat output

The Terminal defaults to being a bunch of boring black on white text, and sure you can change the appearance to other themes, add colors, background images, opacity, transparencies, and other UI customizations, but what you really want is obviously a rainbow version of the cat command for input and output, right? Right, of course … Read More

Quick Launch Command Manual Pages from the Terminal Help Menu

Jun 24, 2014 - 9 Comments
Open a man page from the Terminal Help menu

The next time you’re stuck trying to figure out a terminal command, or maybe you’re just trying to learn a new one, don’t be afraid to ask for help… from the OS X Terminal apps very own Help menu. Yes seriously, that’s because the Help menu of Terminal app can serve as a man (manual) … Read More

Copy the Current Path from Terminal to the Clipboard in Mac OS X

Jun 18, 2014 - 3 Comments
Terminal in Mac OS X

While it’s fairly easy to copy a folder path from the Mac GUI and Finder, or even to copy the path into the Terminal with a drag & drop trick, going the other direction and getting the current path from the command line and then having it accessible to the broader OS X clipboard is … Read More

Prevent System Sleep While a Process or Command is Active in Mac OS X

Jun 16, 2014 - 4 Comments
Caffeine prevents sleep while a command is running

Many Mac users use utilities to temporarily prevent their computer from sleeping, often relying on sleep corners, the third party tool called Caffeine, pmset, or more recently, the command line utility that is now bundled with OS X called caffeinate. By default, the Caffeine menubar item and the caffeinate command both will prevent sleep as … Read More

How to Quit VIM: 10 Ways to Exit VI

Jun 12, 2014 - 12 Comments
VIM

VIM is a very powerful command line text editor that is loved by experts and often hated by novices, mostly because it has a fairly steep learning curve that may seem unintuitive to those who aren’t familiar with it. Even something as simple as quitting out of VIM can seem like a challenge to those … Read More

Use ditto to Copy Files & Directories Intelligently from the Mac Terminal

Jun 11, 2014 - 11 Comments
The ditto command

Most longtime command line users rely on the cp command to copy files and directories, but Mac OS X offers another solution with the ‘ditto’ command. Ditto is slightly more advanced but can be advantageous to ‘cp’ for several reasons, as it not only preserves ownership attributes and permissions but also file resource forks and … Read More

Recursively Create a Nested Directory Structure & All Subfolders with a Single Command

May 27, 2014 - 10 Comments
Create a nested directory structure with mkdir command

Creating a series of nested directories within one another can be done instantly through the command line. This makes it very easy to immediately and recursively create a complex directory structure of folders within subfolders of subfolders, without having to navigate manually into each directory to create a new directory, then navigate again to that … Read More

Create ASCII Art Text Banners at the Command Line

May 23, 2014 - 9 Comments
Mac Terminal icon

Graphics and large stylized text blocks constructed entirely out of the ASCII keyboard characters is called ASCII art. You may have seen it with the goofy ASCII Star Wars thing, but once upon a time it was very popular to stylize messages and images on BBS’s, IRC, MUDs, message boards, and across the early days … Read More

Instantly Eject All Mounted Drives & Disks from the Command Line in Mac OS X

May 22, 2014 - 18 Comments
Eject all mounted volumes from the command line of Mac OS X

The next time you’re at the command line and need to eject every single mounted volume, hard drive, disk, disk image, and/or external drive attached to a Mac, you can instantly eject them all in one fell swoop with a handy osascript command string. This is great if you work frequently in the Terminal and … Read More

How to Check Bluetooth Keyboard Battery Levels from Command Line on Mac OS X

May 18, 2014 - 11 Comments
Get Bluetooth battery life from the command line of Mac OS X

Ever needed to remotely check the battery level of a Bluetooth keyboard connected to a Mac? Or maybe you’re just a heavy Terminal user and wanted to see the current battery life of a wireless keyboard without having to leave the command line? You can do that easily through the Terminal of either a remote … Read More

Speed Up Terminal App in Mac OS X with These 4 Performance Tricks

Apr 30, 2014 - 7 Comments
Speed up the Terminal with these tricks

Many advanced Mac users spend a lot of time at the command line of OS X, accessed through the Terminal app. While generally the Terminal is fast and efficient, sometimes it can slow down over time, or suffer from some performance degradation due to user preference settings. If you feel that Terminal app is being … Read More

How to Disable IPv6 in Mac OS X

Apr 18, 2014 - 22 Comments
IPv6 Mac

Some Mac users may wish to disable IPv6 networking support on their machines. This may be desirable to avoid certain networking conflicts, or to increase security for users in higher threat environments, since IPv6 has been found by researchers to be potentially vulnerable to man-in-the-middle and other network attacks. Though most users don’t use IPv6 … Read More

Send Data Across Networked Computers with Netcat Using the Command Line

Mar 27, 2014 - 14 Comments
Send data over a network with netcat

Netcat is a powerful command line tool that can read and write data across a network connection using TCP/IP, it’s commonly used for relays, file transfer, port scanning, amongst other things. Though netcat origins are from the unix and linux worlds, netcat is also built into Mac OS X, and we’re going to use the … 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