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

201
votes
8answers
118k 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
124
votes
6answers
60k 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 ...
95
votes
24answers
110k 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 ...
90
votes
4answers
45k views

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

On my linux machine I have autocomplete for branches with git. [Note we are talking about git branch completion, not bash completion (e.g. commands, files, etc). Thus NOT lane's answer at all] For ...
83
votes
5answers
136k 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?
83
votes
7answers
59k 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. ...
82
votes
16answers
82k 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 ...
64
votes
2answers
98k views

How can I create a symbolic link in Terminal?

What command is used to create a symbolic link/soft link?
64
votes
2answers
25k 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.
63
votes
9answers
125k 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 ...
61
votes
14answers
57k 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.
59
votes
3answers
33k 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?
52
votes
5answers
48k 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 ...
43
votes
17answers
167k 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.
42
votes
7answers
127k 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 ...
39
votes
3answers
20k 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 ...
38
votes
4answers
42k 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 ...
35
votes
3answers
25k 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 ...
34
votes
5answers
6k views

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

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 scripts, switching settings etc. The mechanism should ...
31
votes
6answers
31k views

using terminal to copy a file to clipboard

I got a file on desktop, file name is ded.html. To copy the file, I click the file and press cmd+c. Now how would I do the same thing using terminal ?
31
votes
9answers
10k 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 ...
28
votes
6answers
80k 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 ...
28
votes
12answers
52k 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 ...
27
votes
6answers
86k 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 ...
26
votes
8answers
16k 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 ...
26
votes
5answers
16k 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.
25
votes
5answers
4k views

Did `man ls > temp.txt`. Output textfile is corrupted

When I execute man ls > temp.txt the output text file is corrupted. By corrupted I mean that first and last letters in some words are overly repeated. Several first lines in temp.txt: LS(1) ...
25
votes
6answers
5k 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 ...
25
votes
2answers
18k 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 ...
25
votes
3answers
9k views

Text copied from Terminal with formatting in Mavericks and Yosemite

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.: ...
24
votes
10answers
14k 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?
24
votes
2answers
923 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 ...
23
votes
2answers
12k 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 ...
23
votes
4answers
36k 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?
23
votes
2answers
114k views

Using The Terminal Command to Shutdown, Restart and Sleep My Mac?

I'm getting more interested in using Terminal as an alternative way to address solutions on my Mac. I have seen this question entitled "Is there a better way to shutdown/restart OSX?". I would ...
23
votes
3answers
19k views

Are there any keyboard shortcuts to switch between tabs in terminal?

Are there any keyboard shortcuts to switch between tabs in terminal?
23
votes
2answers
42k views

Why Mac OS X don't source ~/.bashrc [duplicate]

I found a lot of people figuring out why instruction similar to this : Put X to your ~/.bashrc and you can do Y don't work. It always turns out that Mac OS X's bash's startup files (or Mac's ...
23
votes
4answers
13k 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 ...
23
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 ...
23
votes
8answers
16k 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 ...
21
votes
4answers
17k 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?
21
votes
8answers
28k views

How to monitor file access for an OS X application?

I am looking for the OS X corespondent of FileMon, that was later included in ProcessMon. BTW, it is essential to be able to filter by process.
21
votes
6answers
10k 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?
21
votes
2answers
79k views

How can I list my open network ports with netstat?

I would like to list my open network ports in Terminal with built in commands. As what I know, netstat is the command to use. But I'm struggling to get any useful information out of it. How can I ...
21
votes
2answers
25k views

what are the split terminal commands

I stumbled across the command-d hot key which splits the terminal into 2 panes. But I cant find documentation anywhere on how to close the new pane or even switch the focus to it so I can use it. ...
20
votes
1answer
9k 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 ...
20
votes
4answers
72k 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 ...
19
votes
6answers
108k views

How to cd to a directory with a name containing spaces in bash?

I tried cd "~/Library/Application Support/" -bash: cd: ~/Library/Application Support/: No such file or directory also cd ~/Library/Application Support/ -bash: cd: ~/Library/Application Support/: No ...
19
votes
13answers
8k 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 ...
19
votes
4answers
23k 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 ...