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

Change Finder Windows View Style from the Command Line in Mac OS X

Jul 4, 2012 - 7 Comments
Finder window list view options

Unless it has been disabled, any Finder window in Mac OS X has the View option buttons in the windows toolbar. From left to right you can select icon view, list, columns, and coverflow. You may have noticed the window view style doesn’t always persist across Finder windows though, even if you selected “Always Open … Read More

Set the System Time in Mac OS X from the Command Line

Jul 4, 2012 - 16 Comments
Terminal in macOS

The clock in Mac OS X sets itself automatically by default, but if you want to set the precise time or are looking for a command line solution to set system time, you can do so with a tool called ntpdate, or the standard ‘date’ command.

Access Terminal from Anywhere in Mac OS X via Keyboard Shortcut with TotalTerminal

Jun 18, 2012 - 3 Comments
Total Terminal brings Terminal access to anywhere via Hot Key in Mac OS X

TotalTerminal is an excellent tweak for those of us who frequently use the command line, it provides instant access to the Terminal from anywhere in Mac OS X with just a keyboard shortcut. Modeled after the classic Quake console, an official Terminal.app prompt drops down from the top of the screen where you can quickly … Read More

Re-Run the Last Command While Replacing Syntax or Typos

Jun 13, 2012 - 6 Comments

If you’ve ever entered a lengthy command into the terminal and upon execution discovered a syntax error, a “no such file or directory”, or “command not found” message because you made a typo, you’ll love this quick tip that lets you rerun the last executed command while replacing the erroneous syntax. You’ll need to be … Read More

Make a Quick Backup of a File from the Command Line

Jun 11, 2012 - 3 Comments
Quickly make a file backup from the command line

It’s always a good idea to backup a file if you’re going to be making some changes to it and you’re uncertain of the outcome. In the Finder this is as simple as just selecting the file and hitting Command+D to create a duplicate of the file in question, but in the command line you … Read More

Fish Shell for Mac OS X Makes the Command Line Smarter & Friendlier

Jun 7, 2012 - 6 Comments
Fish Shell for Mac OS X showing autosuggestions

Are you looking for a way to make the command line a bit more user friendly? If so, you may find Fish to be a pretty nice alternative shell whether you are completely new to the OS X Terminal or you just want some general assistance when at the command line.

How to Check SHA1 Hash of a String

Jun 6, 2012 - 3 Comments
Check SHA1 Hash of a String

Do you need to check the sha1 hash of a string? You can easily find the sha1 hash of any string from the command line, and this trick works to check sha1 hash from Mac OS or Linux. We’ll use the openssl command to

Create SSH Bookmarks in Terminal for Quick Remote Server Access in Mac OS X

Jun 3, 2012 - 5 Comments
SSH Bookmarks in Terminal

Setting up SSH bookmarks within Terminal app is an easy way to quickly connect to remote machines. If you haven’t noticed these in Terminal before it’s probably because they aren’t labeled as bookmarks, and therefore the feature gets frequently overlooked by even the most advanced Mac users. Here’s how to create bookmarks within Terminal, and … Read More

Create & Extract bz2 Archives in Mac OS X

May 29, 2012 - 10 Comments
bzip2 archive in Mac OS X

The Bzip archive format is generally more effective at compressing than zip and gzip, and while the default Archive Utility or the excellent all-purpose Unarchiver tool will handle unarchiving bzip2 files with ease, you will have to venture to the command line if you want to create a bzip archive in Mac OS X. Creating … Read More

How to Set Up a Password-less SSH Login

May 25, 2012 - 29 Comments
Set up password-less SSH logins

Setting up passwordless SSH logins is a great way to speed up connections to regularly accessed remote Macs and unix boxes. Because not all versions of Mac OS X include the ssh-copy-id command, you may have to use cat or scp to copy over your ssh key. This is how to set everything up, it … Read More

Install wget in Mac OS X Without Homebrew or MacPorts

May 22, 2012 - 89 Comments
Install wget in Mac OS X

Want to have wget on Mac without Homebrew or MacPorts for whatever reason? You can do that by building wget from source at the command line. The command line tool wget lets you retrieve a group of files from FTP and HTTP protocols, it’s a very useful utility for web developers and powerusers to have … Read More

Turn a Python, Perl, Ruby, or Shell Script Into a Self Contained Application for Mac OS X

May 22, 2012 - 3 Comments
Script turned into a self contained Mac OS X app

Platypus is an excellent utility that lets you turn virtually any script into a self-contained Mac OS X application. Free and remarkably simple to use, Platypus will support just about any shell script, Perl, Python, PHP, Ruby, Tcl, AppleScript, Expect, and even other scripting languages.

Use Growl Notifications to Alert When Command Line Tasks Have Completed

May 17, 2012 - 4 Comments
Growl Notification sent from the command line with growlnotify

A recent tip covered how to announce when a command line task finished by using OS X’s text-to-speech abilities. The obvious downside to that method is the sound makes it less useful to those who are using Macs in quiet environments like offices, schools, or libraries. An alternate solution is to use growlnotify to create … Read More

Make Mac OS X Speak (or Sing) the Output of Any Command Line Task

May 11, 2012 - 2 Comments
Speak the output of a command line task

Along the lines of vocally announcing task completion within the command line, you can also have Mac OS X speak the output of any executed command.

Announce When a Command Line Task is Completed in Mac OS X

May 8, 2012 - 15 Comments
Announce the completion of a command in Mac OS X Terminal

By appending the say command to the end of another command, Mac OS X will vocally announce when the initial task has finished running successfully. For example, to have OS X announce that a particular script has finished running the command could be: python backup.py && say “jobs done” The important part is the “&& … Read More

Empty Contents of Specified File Without Deleting via Command Line

May 7, 2012 - 3 Comments
Remove Contents from a specified file without deleting the file

If you’re working at the command line and need to quickly empty the contents of a file, you can do so by throwing a greater than symbol and a space in front of the filename in question.

Generate and Set a Random Valid MAC Address from the Command Line in OS X

May 2, 2012 - 5 Comments
Generate and set random MAC address in OS X

We’ve shown you how to generate MAC addresses randomly and then how to go about changing a MAC address in OS X Lion and OS X Mountain Lion, but why have those be two separate actions? Using the command line, you can combine the two events into a single action to generate a valid MAC … Read More

Open Terminal Faster by Specifying a Shell

Apr 30, 2012 - 2 Comments
Specify a shell within Terminal to speed up opening new Terminal windows

Whenever a new Terminal window is launched, a variety of system logs are read to provide information on the last login. One way to speed up launching a new terminal window is to delete those .asl log files, but you can achieve a substantial speed boost by simply setting Terminal to open a shell rather … 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