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

Batch Resize a Group of Pictures from the Command Line with sips

Nov 25, 2012 - 7 Comments
Batch resize group of pictures with sips

Though most Mac users will likely prefer to use Preview to batch resize images because of the ease of use, advanced users often like to go with the command line for repetitive tasks. We’ve discussed sips before as a way to resize, rotate, and flip images, but if sips is combined with wildcards it can … Read More

Add a File Extension to a Group of Files from the Command Line in Mac OS X

Nov 22, 2012 - 11 Comments
Add file extension to a group of files in Mac OS X

The quickest way to add a file extension to a group of files that don’t currently have one is by using the command line in Mac OS X. In the example below, we’ll add a “.txt” extension to all files in a single directory, but subbing .txt in the command string will add a different … Read More

Compare Contents of Two Directories from the Command Line

Nov 8, 2012 - 8 Comments
Compare directory contents from command line

To compare and list the different contents of two directories without the extra output you get through commands like diff, you can use the comm command instead. To get started, launch Terminal and type the following command, adjusting the directory paths as appropriate: comm -3 <(ls -1 folder1) <(ls -1 folder2) The output listed will … Read More

Start a Time Machine Backup on a Remote Mac with SSH

Nov 5, 2012 - 3 Comments
Start a remote Time Machine backup with SSH

Time Machine backups can be triggered remotely thanks to SSH (Remote Login) and the command line. This is an excellent solution to use if you left the home or office without making an important backup, though the SSH requirement does add a potential layer of complexity that may make it more appropriate for advanced users. … Read More

How to Disable the Mac Boot Chime Completely

Nov 4, 2012 - 71 Comments
Disable the Mac boot chime

If you’re a Mac owner you know that every time the Mac reboots or starts up it makes a startup chime sound. Though you can temporarily mute the chime by holding down the Mute key on any Mac keyboard, you can also choose to disable it completely by turning to the command line. To be … Read More

List Your 15 Most Used Terminal Commands

Nov 2, 2012 - 17 Comments
Command History

The history command is a useful way to find specific commands that have been used in the past, and it can also be used to discover what your personal most used commands are with the following command string: history | awk ‘{a[$2]++}END{for(i in a){print a[i] ” ” i}}’ | sort -rn | head -15 The … Read More

Finding Files from the Command Line

Oct 29, 2012 - 3 Comments
Search for files from the command line

Searching the file system for a specific document or file is easy and very fast. Though most users are best served using Spotlight from the menubar, there are times when either Spotlight isn’t working, you need more paramaters, you’re working in the Terminal, operating with a remote machine, or perhaps just would like to use … Read More

How to Set the HostName, Computer Name, and Bonjour Name Separately in Mac OS X

Oct 24, 2012 - 7 Comments
Finder icon on the Mac

You can set unique names for how your Macs computer name appears locally, from file sharing and networking, and even Bonjour services, with the help of the scutil command. This allows you to have a custom hostname for Terminal and SSH, another friendlier name for what’s visible to others on local networks, and yet another … Read More

Kill Processes Using Wildcards with pkill in Mac OS X

Oct 18, 2012 - 2 Comments
pkill

For anyone who uses the command line regularly, a new tool called pkill makes killing processes significantly easier in modern releases of Mac OS and Mac OS X. Improving on the standard kill command, pkill easily supports wildcards, making it easy to terminate all processes belonging to a match or even a specific user.

Save a List of Files & Folder Contents Into a Text File

Oct 11, 2012 - 17 Comments
Save a list of files into a text document

Saving a complete listing of files contained with a folder is easy, and there are two quick ways to save that list as a text file. Save a List of Files from Finder The first approach may be easiest for most users and is done through the OS X Finder and TextEdit app, it’s a … Read More

10 of the Best Defaults Write Commands to Improve Mac OS X

Oct 9, 2012 - 29 Comments
Mac Terminal icon

Most Mac OS X preferences are managed through easily accessible control panels, but going behind the scenes with defaults write commands can lead to some genuinely useful tweaks that can only be made through the command line. This list represents a compilation of some of the best defaults write commands out there, and even if … Read More

5 Stupid Terminal Tricks to Keep You Entertained

Oct 5, 2012 - 26 Comments
Star Wars in Terminal

Bored? Launch Terminal and get ready for some completely stupid tricks to keep yourself entertained. You’ll be listening to Horse Ebooks blab away, watching Star Wars in ASCII, playing retro games, toasting your CPU cores with a repetitive phrase, and even talking to a virtual psychotherapist. The hidden joys of the command line are upon … Read More

Stress Test a Mac by Maxing Out CPU

Oct 2, 2012 - 25 Comments
Stress test a Mac by maxing out CPU

If you want to completely peg CPU to stress test a Mac, turn no further than the Terminal. Using the command line you can easily max out all CPU cores and induce huge load on a Mac, making it easy to determine things like what temperature the processor reaches under heavy load, if fans are … Read More

How to Update Mac OS X Without the App Store

Sep 14, 2012 - 6 Comments
Update OS X without using the App Store

Using the command line softwareupdate tool you can update Mac OS X system software without using the App Store. This is particularly useful for Mac users running later versions of Mac OS X where the software update system is primarily handled through the Mac App Store, but can occasionally either go awry or be inaccessible … Read More

How to Enable PHP in Apache for Mac OS X Yosemite & Mavericks

Sep 10, 2012 - 12 Comments
Enable PHP in Mac OS X

OS X Mavericks comes with PHP 5.4.30, and OS X Mountain Lion ships with PHP 5.3.13 preinstalled, though if you start the built-in Apache server, you will find PHP isn’t enabled by default. Changing this is easy, and if you’re a web developer and want PHP running on your local Mac with OS X 10.8 … Read More

Reboot Mac OS X from the Command Line

Sep 6, 2012 - 11 Comments
Reboot Mac OS X from the Command Line

Rebooting a Mac from the command line is fairly simple, though it should be pointed out that most Mac OS X users are best served just using the standard  Apple menu method to issue a system restart. Nonetheless, for advanced Mac users, using the terminal reboot command can be an invaluable trick for troubleshooting … Read More

Start an Apache Web Server in Mac OS X El Capitan, Mavericks, & Mountain Lion

Sep 2, 2012 - 65 Comments
Apache web server running in Mac OS X Mountain Lion

The Sharing preference panel options were changed a bit in OS X Mountain Lion and again in Mavericks, and while things like Internet Sharing remain, the Web Sharing preference panel was removed. The Apache web server remains bundled with Mac OS X though, but you’ll need to turn to the command line to enable the … Read More

How to Disable “Go To Folder” in Mac OS X

Aug 31, 2012 - 9 Comments
Disable Go To Folder in Mac OS X

The Go To Folder command is one of the most useful features in the OS X Finder, letting you quickly navigate deep into directory structures without having to click around. But it can also be used to access folders you may not want users to get to, be it /System/ directories or the Library folders. … 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