Terminal (or Terminal.app) is the program included in Mac OS X for running applications and issuing commands using the command line interface. These programs are controlled by typing lines of text, rather than using the mouse or keyboard commands in the usual graphical user interface (GUI).

learn more… | top users | synonyms

149
votes
6answers
73k views

How can I configure Mac Terminal to have color ls output?

How can I configure Mac Terminal to have color ls output? I am using MacOS 10.5
68
votes
22answers
65k views

OS X Terminal “must have” utilities

I've just read with pleasure, and learned a lot from these questions : OS X Terminal Tips and Tricks OS X Hidden features and nice tips & tricks OS X Applications you can't live without But I ...
62
votes
16answers
50k views

Is there a Mac OS X Terminal version of the “free” command in Linux systems?

On Linux, I often use the free command to see the current amount of free and used memory in the system. For example: $ free total used free shared buffers cached ...
61
votes
4answers
26k views

How can I trigger a Notification Center notification from an AppleScript or shell script?

I'd love to be able to take advantage of 10.8's Notification Center features in AppleScripts and shell scripts I write. Is there a built-in command or a third-party library I can use from either an ...
60
votes
7answers
32k views

What is the difference between iTerm2 and Terminal?

I keep hearing that iTerm2 is much better than Terminal. I downloaded iTerm2 today and played around with it, but I couldn't see what is so much better about iTerm2. iTerm2 seemed just like Terminal. ...
52
votes
5answers
81k views

Can I open files in TextEdit from the Terminal in Mac OS X?

I frequently find that a terminal command to open a file in TextEdit would be very handy. Does such a command exist on Mac OS X?
50
votes
3answers
19k views

git auto-complete for *branches* at the command line?

On my linux machine I have autocomplete for branches with git. For example I can type git checkout [TAB] and get a list of branches. Or I can type git checkout feb* [TAB] to get all branches that ...
39
votes
12answers
33k views

How can I open a Terminal window directly from my current Finder location?

I was wondering if there was any was I could right click inside any instance of a "Finder" window such that I have an option that says "Open Terminal Here". It would be really helpful.
38
votes
4answers
28k views

Are my permissions for /usr/local/ correct?

I’m using HomeBrew for my port needs (seems a bit “cleaner” than MacPorts). I can install without sudoing (which is great), but the man linking step seems to require it (/usr/local/share/man/man3 ...
37
votes
8answers
71k views

Why doesn't .bashrc run automatically?

I put some alias commands in my .bashrc file, so that they might be loaded everytime I open a new Terminal window. Yet this doesn't happen. I have to select run script: in the ...
32
votes
4answers
27k views

How can I open a text file with TextWrangler from the Terminal (command line)?

Often when I work in the Terminal (the command line) I need to edit some text files. I prefer to edit text files using TextWrangler. How can I open a text file with TextWrangler from the Terminal? I ...
31
votes
3answers
11k views

Is bash in OSX case-insensitive?

Are bash commands on OSX case insensitive? I type "which TR" and it shows /usr/bin/TR, though there is no such binary there. Same thing for other binaries, when capitalized. Or is Terminal.app maybe ...
31
votes
5answers
4k views

Is there a way to access a Mac's geolocation from terminal?

(Note the Mountain Lion update at end of question) Some GUI apps use OS X location services, but I want to retrieve a Mac's physical location from the command line. This could be useful for running ...
30
votes
3answers
15k views

How to replace Mac OS X utilities with GNU core utilities?

I found there is some differences between the utility command I used on the mac OSX and linux. I want to make my experience united. How could I replace all my mac utilities with GNU utilities?
27
votes
15answers
73k views

Is there a way to start the Terminal with a keyboard short cut?

Sort of like the Windows+R command in the windows world? That actually just lets you run a command but you get the idea.
26
votes
6answers
61k views

Is there an OS X terminal program that can access serial ports?

What programs can act as a terminal and access serial ports? This is not for terminal access on an IP connection, this is so I can access a hardware device plugged into a USB/serial converter running ...
25
votes
5answers
15k views

Can I disable Dashboard in Mountain Lion?

I'm wondering if there's a way to disable the dashboard in Mountain Lion. I never use it and I think it's consuming processor and memory powers.
24
votes
1answer
12k views

Open Finder window from current Terminal location?

If I am in a specific path in a Terminal window, how can I open that same window in a new Finder window? Note: This is the opposite of opening a Terminal from Finder.
24
votes
2answers
689 views

How did this ominous file end up in my Application Support folder?

Deleting this file will break the whole internets, for the sake of our children don't do it!. The above quotation is the content of a text file called STR8369805638PUB6932583035105 that I found ...
22
votes
3answers
9k views

iTerm as a slide-out terminal from the top of the screen

I have installed iTerm2 and was hoping I'd have something like guake (Yes I just switched from Ubuntu). I mapped the hotkey to a button of my choice and it works fine, but I miss the ...
21
votes
4answers
2k views

Is it possible to disable Terminal's automatic tweaking of colors in Lion?

While it's great that Terminal now has built-in support for changing the ANSI colors, I find it annoying that it automatically adjusts the colors to improve contrast, which means the colors that I ...
20
votes
6answers
6k views

How can I quickly navigate through man pages in the Terminal

Is there any way to quickly scroll through text-heavy output in Terminal such as man pages ? Using the up and down arrows only move the screen one line at a time; is there any way to scroll faster?
19
votes
10answers
22k views

Password dialog appears when SSH private key permissions are set to 0600

I installed my SSH private key in ~/.ssh/id_rsa and set its permissions to 0600. When I connect to an SSH server which uses my private key in Terminal.app via ssh, a dialog pops up and asks me to ...
19
votes
5answers
3k views

Disable Command-W in the terminal

Is there any way to disable Command+W in the terminal? On several occasions I have accidentally closed a terminal window containing important information when I meant to close a Safari tab and did ...
19
votes
7answers
12k views

When I open Terminal, I get an “I have no name!” prompt

Suddenly, this morning, I open a Terminal window and I get this: I have no name!@macbook:~$ whoami 502 ** I am not a number! I am a human being! ** What gives? Anyone know what I need to do to ...
18
votes
6answers
40k views

How do I start TextEditor from the command line?

I work a lot at the command line in a Terminal and would like to start a text editor on a certain file. I'm from Linux Land and normally use kwrite or gedit from a bash shell. Trying to find the Mac ...
18
votes
10answers
9k views

How can I sleep the display from Terminal?

I'd like to be able to turn my screen off from command line. I know there's the keyboard shortcut ctrl+⇧+⏏ but I want to do it from a shell script or remotely. Is there a way?
18
votes
4answers
23k views

Can I make my Mac OS X Terminal color items according to syntax, like the Ubuntu terminal?

I want it to have all the colors for syntax folders, etc... How can I do that?
18
votes
2answers
9k views

How can I prevent an SSH session from hanging in OS X Terminal?

When I close my MacBook with an active SSH session in Terminal and then wake it up, the prompt goes unresponsive. In about five minutes it says Write failed: Broken pipe and terminates. This ...
18
votes
4answers
4k views

Can a Mac's model year be determined via Terminal Command

Does anybody know a terminal command that gives me the the model of my Mac? For example - "MacBook Pro, Retina, 13-inch, Mid 2013" or "MacBook Pro, Late 2009" or "Mac Mini, Early 2010". That ...
18
votes
3answers
2k views

Is there a way to suppress badge counts and the dock icon bounce for Terminal.app in Lion?

With the new state saving features (which I want to keep), the dock notifications are more aggrivating to me in Lion. Can I suppress the bounce and/or the notification badge functions? While I like ...
17
votes
7answers
9k views

Can home and end keys be mapped when using Terminal?

The home and end keys on a MacBook Pro can be emulated with fn + left arrow or fn + right arrow. Or when certain settings are changed, with the Command (Apple) key instead of fn. None of these ...
17
votes
5answers
8k views

Can I view system stats in the Terminal?

The widget iStat Pro allows to monitor different system stats like CPU usage network bandwidth in/out memory usage ... How can I view such system stats in the Terminal?
17
votes
2answers
7k views

How do I delete all Terminal mail?

I set up a cronjob a long time ago that now doesn't exist. Whenever I open up Terminal, it now says "You have mail". I have something like 100 messages that all say the same thing. How do I mass ...
17
votes
4answers
2k views

Concisely starting Mac OS apps from the command line

I do a fair amount of work in the command line, and I find myself defining a lot of aliases of the form: alias skim='/Applications/Skim.app/Contents/MacOS/Skim' Is there a way to add magic such ...
17
votes
7answers
2k views

Case-insensitive ls sorting in Mac OSX

How can I make the ls command in Max OS X Lion sort files and directories similar to how Ubuntu Linux does (case-insensitive, directories NOT on top, dot files NOT on top)? Ideally I'd like to do ...
16
votes
12answers
5k views

What orthodox file manager for OS X could I use?

I'm looking for a graphical file manager fro OS X, for console Midnight Commander is ok. I need two panels, function keys operations and preferably FTP and SCP support. Also, it would be great to be ...
16
votes
4answers
5k views

How do I speed up new Terminal tab loading time?

How can i speed up the terminal startup in Lion? I'm not referring to the startup of the Terminal application, but to the startup terminal windows, like when i open a new tab. I don't have anything ...
16
votes
1answer
6k views

Set iTerm2 as the ssh:// URL handler

Currently, Terminal is set to handle SSH urls. For example, if I do: $ open ssh://machine.example.com Then it will spawn a new SSH session in terminal. I'd like these to be opened in iTerm2 ...
15
votes
2answers
16k views

How can I create a symbolic link in Terminal?

I know how to delete a symbolic link/soft link by using command rm in Terminal but I was wondering what command is used to create one?
15
votes
4answers
3k views

Switching from Ubuntu to OS X and I'm lost

Situation I got tired of some bugs/annoyments in Ubuntu(=some programs coming along with it). For example after using compiz for a few days I found bugs that were distracting my work flow pretty bad ...
15
votes
3answers
4k views

How can I empty the trash from the Terminal?

How can I empty the trash from the Terminal?
15
votes
2answers
10k views

Amending PATH so that /usr/local/bin is ahead of /usr/bin

I'm trying to install brew but get the following warning: Warning: /usr/bin occurs before /usr/local/bin This means that system-provided programs will be used instead of those provided by Homebrew. ...
15
votes
4answers
10k views

Is there a command line mail program for Mac?

My C++ professor has had us use Terminal for editing code. Is there an app or program that will allow me to send and receive email via Terminal, so I can stay in one window?
15
votes
7answers
6k views

Start/stop internet sharing from a script?

Is there a way to start/stop internet sharing from the command line or maybe an apple script? The thing is that I move around my laptop between home and work. At one place I get wireless internet ...
15
votes
5answers
50k views

How can I list all user accounts in the terminal?

How can I list all local user accounts (whether logged in or NOT so 'users' or 'who' is no good) in the terminal on a mac? OS X version is 10.6.8. I have seen this suggested - dscacheutil -q group ...
14
votes
2answers
6k views

How to I go from .flac to .mp3 using LAME & FLAC using the Terminal alone?

This is my first question, so please go easy on me. 'Tis a pleasure to be here. Hopefully somebody can help me out. For a long time I've been using a relative clunky technique which involves Audacity ...
14
votes
3answers
4k views

Text copied from Terminal with formatting in Mavericks

After the update to Mavericks, anything copied from Terminal is pasted in the target app with the same formatting as in Terminal, in my case, white monospaced letters on a black background, e.g.: ...
14
votes
4answers
15k views

How to get the fully resolved path of a symbolic link in Terminal?

I have a tangled mess of python installations on my laptop. I was looking at the executables in /usr/local/bin and they are all symbolic links to ../../../Library...... There's some weird behavior ...
14
votes
4answers
45k views

Why does OS X Mavericks block the purge command in Terminal?

When I try the purge command on my terminal, OS X Mavericks gives me the following message: Unable to purge disk buffers: Operation not permitted This hasn't been the default behavior until now. I ...