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

Split Terminal in Mac OS X with iTerm2

Jan 3, 2011 - 13 Comments

One of my complaints with the default Mac OS X Terminal app is that you can’t split the Terminal screen, instead you have to open two windows. Well, this must have annoyed some other developers too because iTerm2 aims to address this problem. iTerm2 is a fork of the original iTerm project for Mac OS … Read More

Command Line MP3 Player in Mac OS X

Dec 7, 2010 - 9 Comments

You don’t need to use iTunes to play music on your Mac, particularly if you just want to play an audio document. Mac OS X comes with an included command line audio player that you can use to play most audio files with. In this example we’re going to use an MP3 file as the … Read More

Random MAC Address Generator

Nov 10, 2010 - 21 Comments

Do you want to generate a random MAC address? That’s no problem with this neat openssl tip sent in by one of our readers, and you can run the command once or multiple times to generate a randomized MAC address instantly on each execution. This command will work to randomize MAC addresses in in Mac … Read More

Watch Disk Use, CPU, and Load Average via Command Line

Oct 31, 2010 - 2 Comments

Here’s a nice trick if you need to continuously observe your Macs system usage, including disk usage, CPU, and load average. The great thing about this iostat trick is that it updates constantly, allowing for realtime monitoring of system performance, which can be extremely helpful for performance testing and tracking down various processes or activities … Read More

How to Check the Mac Processor Speed

Oct 23, 2010 - 7 Comments

Want to know how fast a Mac is? You can check a Macs processor clock speed, chip type, and CPU architecture a few different ways, but we’ll cover two quick methods to determine the clock speed of a given Mac. First, a super easy glance at processor speed through the GUI, and second, a more … Read More

Get MP3 & M4A File Info with afinfo from Command Line of OS X

Oct 19, 2010 - 4 Comments
Terminal in macOS

The fastest way to get MP3 and m4a file info out of Mac OS X is using the Terminal and afinfo command. The command line tool you’ll want to use stands for Audio File Info, rather appropriately. You can try it out yourself with any audio file, though for the purposes here we’re looking at … Read More

Prepend Text to a File at the Command Line

Oct 7, 2010 - 3 Comments

You can easily prepend text to a file from the command line by using the following command syntax: cat file.txt | pbcopy && echo “Text to prepend” > file.txt && pbpaste >> file.txt In this case, the file to have text prepended to is ‘file.txt’, replace that with your own document. You may wish to … Read More

Monitor How and When a Process Accesses Files with opensnoop

Oct 6, 2010 - Leave a Comment

You can watch what a process is doing with your filesystem by using the opensnoop command. To try this out, launch the Terminal and then follow along to learn how to watch by applications, file usage, process ID, and more.

How to Check Bitrate of MP3, m4a, & Audio Files from Command Line of Mac OS X

Oct 4, 2010 - 10 Comments
Apple Music Icon

Mac users can quickly get the bitrate of any MP3, m4a, or other audio file from the command line of Mac OS X.

Compress All Files in a Directory by Command Line

Oct 4, 2010 - 1 Comment

This is a really great terminal command that compresses every file within a directory, turning them into a zip archive. We’ll offer two variants of it; one that removes the original source file and leaves only the compressed files, and another command that leaves the uncompressed source files intact. This has been tested and works … Read More

Command Line Cheat Sheet Wallpaper – Learn Commands with a Background Pic

Oct 1, 2010 - 15 Comments

If you’re new to using the command line and trying to learn the Terminal, setting a cheat sheet of command syntax for commonly used tricks as your background picture can be a pretty helpful way to help remember commands.

Open Any man Page in Preview and Save as PDF

Sep 27, 2010 - 6 Comments

If you’re tired of looking over a man (manual) page within the Terminal, you can use a nifty command sequence to launch any specified man page into the Preview app of Mac OS X. This is done by piping the standard man output into the open command and Preview. Launching the man Page into Preview … Read More

How to Take Screenshots of Webpages via the Command Line

Sep 26, 2010 - Leave a Comment

You already know that you can take screenshots from the command line on Mac OS X, and now using a simple tool called webkit2png you can quickly take a screenshot of any webpage from the command line too.

Start, Stop, and Restart Windows Services from Mac OS X

Sep 8, 2010 - Leave a Comment

Mac OS X includes Samba support by default, which allows for communication between OS X and Windows PC hardware. SMB is what enables simple Mac to Windows file sharing, but you can also go further and utilize the command line of OS X or Linux to remotely monitor, start, and stop services running on Windows … Read More

Change your Mac Hostname via Terminal

Sep 6, 2010 - 31 Comments

Need to change the hostname of a Mac? For most people if you want to change your Mac computer name you just do it through the Sharing system preference, it’s quick and very easy. For those of us that are more geekishly inclined, we like to do things through the Terminal. This tutorial will show … Read More

Set IP Address from the Mac Command Line

Sep 1, 2010 - 23 Comments

The quickest way to set your IP address from the command line is to use the versatile and powerful ipconfig utility, which is bundled directly with Mac OS X. We’ll show you how to set an IP address with ipconfig by retrieving one from a DHCP server, and also demonstrate how to set a specific … Read More

Check the PATH of your Mac with echo $PATH

Aug 31, 2010 - 1 Comment

Anytime that you run a command through the Terminal directly by a command name like ls or dscacheutil, your Mac is looking through a series of directories for that command to exist. This list of directories is called the PATH, and it’s a carry over from the unix underpinnings of Mac OS X. As you … Read More

Print a random tweet from the command line

Aug 27, 2010 - Leave a Comment

By pasting the following small function into your .profile, you’ll be able to print random tweets from any Twitter feed:

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