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

Easily Add Line Numbers to a Text File with the Command Line

May 20, 2010 - 7 Comments

Brian asks: “I need to add line numbers to a text file. I don’t mean line numbers in the text editor, I mean adding a number next to each item inside a text file. Is this possible to automate or do I have to manually edit the file typing 1, 2, 3 and going insane?” … Read More

Re-Run the Last Used Command Exactly With or Without Super User Privileges

May 17, 2010 - Leave a Comment
Terminal

Want to re-run the last executed command? Or what about re-running the last used command but running it as root? You can do both! Ever typed a nice fancy string command into the terminal and been frustrated to discover that you need to run it all over again? Or perhaps you discovered that the aforementioned … Read More

Discover the last used command beginning with anything without executing it

May 10, 2010 - 1 Comment

If you want to discover the last time a specific command was used without actually executing it, follow this format at the command line: !sudo:p The above example will print back the last usage of the ‘sudo’ command without actually executing it, which is very useful in some situations (like the situation below, where the … Read More

Create an Instant Web Server via Terminal Command Line and Python

May 7, 2010 - 11 Comments
python web server

Want to quickly share a file, test some code, or broadcast something? You can instantly create a web server out of the current directory by using nothing but python, yup, no apache, no nginx, no litespeed, all python, which ships with pretty much every unix variation these days. The command is remarkably simple considering how … Read More

Speed Up a Slow Terminal by Clearing Log Files

May 6, 2010 - 54 Comments

The Mac OS X Terminal can become slow to launch over time, but there’s an easy solution to speed it up again. By deleting the Apple System Logs, you can shave the lag in opening and launching new Terminal windows/tabs dramatically, in my case from about a three second delay to instantaneous! Here’s how to … Read More

How to Use ping on Mac: Pinging Websites, Domains, or IP Addresses

Apr 28, 2010 - 7 Comments
Network Utility in Mac OS

Ping is an essential utility for network administrators, but it’s also pretty handy to check if websites are online, how your internet connection is working, if you are experiencing lag or packet loss on a network connection, or to determine if a network resource is available. Mac users can access and use ping to target … Read More

Post a Twitter Update via the Command Line

Apr 20, 2010 - 11 Comments

You can quickly post a tweet from the command line using the curl command, all you’ll need is your Twitter username and password.

Disable Dock Bouncing in Mac OS X

Feb 19, 2010 - 8 Comments

The bouncing Dock icons are a nice GUI feature that let you know an app is launching on the Mac, but for some people those little bouncing icons are just really annoying. Additionally, Dock icons will bounce to notify you that an alert is active in the app, or the app needs your attention. If … Read More

TTYtter, the command line Twitter client

Feb 17, 2010 - Leave a Comment

TTYtter is a rather fun command line based Twitter client. Written in Perl, it’s got all the essential ingredients needed for basic Twitter needs without ever leaving a Terminal window. Running TTYtter is easy enough, it just needs your login information and off it goes. You can either run it through perl with: perl /path/to/ttytter.pl … Read More

How to Disable Access to System Preferences on Mac

Feb 11, 2010 - 9 Comments
System Preferences in Mac OS X

In some situations, you may wish to disable access to the System Preferences on a Mac. Often this is for lab environments or public use workstations, or perhaps for locking down a particular workstation for various reasons. While a common approach is to create a new user account that has limited access to system features … Read More

Change the Delay When Dragging Windows Within Spaces on Mac

Feb 10, 2010 - 8 Comments

Spaces is a really nice feature of Mac OS X that lets you place different windows and applications within their own workspace. Dragging a window to a new Space is just a matter of holding onto the window and pulling it towards the end of the screen. You may have noticed that there’s a delay … Read More

Go Back to the Previous Directory via Command Line

Feb 9, 2010 - 5 Comments

It’s easy to accidentally change directories to something you weren’t intending to (say, accidentally hitting cd and returning home, thus losing your place in a complicated directory structure seep in the file system somewhere), but thankfully there’s a command that will immediately take you back to the previous directory, regardless of what it was. The … Read More

Lock the Dock in Mac OS X

Feb 8, 2010 - 11 Comments

If you need to prevent the Dock icons from changing or being modified on a Mac, you can use defaults command strings to lock down the OS X Dock and prevent any adjustments or changes to how it appears on screen.

Track an Applications Usage in Mac OS X with opensnoop

Jan 27, 2010 - 4 Comments

Using the command line tool ‘opensnoop’ you can track any Mac applications (or system process) usage of the file system. This is a very handy tool for administrators and troubleshooting! The simplest way to use it is as follows:

Use your Mac as a Psychotherapist

Jan 23, 2010 - 8 Comments

Need a therapy session? Your Mac has you covered. Yes, you read that right. You can use your Mac as a psychotherapist from the Terminal, thanks to emacs the text editor. Say what? If you’re confused don’t be, it’s an easter egg that has long existed and it’s easy to access.

Change the Dock item click-and-hold behavior in Snow Leopard

Jan 13, 2010 - 6 Comments

Snow Leopard changed the way the Dock behaves when a Dock item has been clicked on and held down, since 10.6 it launches Expose for that specific application. You may recall how Leopard handled the click-and-hold though, which was to launch the contextual menu (the same one you get when you right-click in 10.6). Using … Read More

Watch Star Wars Episode IV: A New Hope in ASCII via Telnet

Dec 18, 2009 - 7 Comments

ASCII art is just one of those wonderful retro throwbacks to the earliest days of computing. So, if you’re looking for a nostalgic return to the the days of BBS, MUD, and IRC, and perhaps a little bored at school or work, why not watch the entirety of Star Wars Episode IV: A New Hope … Read More

How to Schedule Sleep and Wake Events from Terminal in Mac OS X

Dec 18, 2009 - 6 Comments
Mac Terminal icon

Like many of us, I’m often busy and out of the home, leaving my Mac on a desk. I regularly use my home machine as a local fileserver though and other people in the household are dependent on it being up and running. Now here’s the situation I’m presented with: I leave town earlier than … 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