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

48
votes
4answers
20k 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 ...
35
votes
12answers
26k 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.
14
votes
6answers
5k 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 ...
19
votes
3answers
10k 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?
14
votes
12answers
4k 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 ...
14
votes
2answers
9k 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. ...
10
votes
4answers
3k views

iTunes track notifications for Mountain Lion

In OS X Lion there was the preference (via a Terminal command) to enable iTunes track notifications that were displayed as a popup in the dock. So far it seems as though Mountain Lion does not allow ...
7
votes
3answers
3k views

How can I dim the screen from Terminal?

Is it possible to dim the screen from Terminal, in a Mac with OS X Lion? Is there any command to do control brightness and volume?
6
votes
2answers
563 views

Terminal behaving differently since updating to Lion

Ever since my company updated to Lion, terminal.app has been behaving differently. When I click on the dock icon, it sometimes opens several terminal windows at once, instead of a single one, and all ...
6
votes
2answers
5k views

Reset your PATH variable

I stuffed up (basically wiped) my PATH variable. Is there any way to reset it to the default? I look at How do I reset the $PATH variable on Mac OS X?, but I find it very confusing. As far as I ...
2
votes
3answers
2k views

Change file association in terminal?

Is there a method for associating file types with applications via terminal? I thought ~/Library/Preferences/com.apple.launchservices.plist might do it, and I also have seen: Why is a command line ...
134
votes
6answers
59k 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
34
votes
8answers
58k 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 ...
19
votes
4answers
1k 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 ...
14
votes
4answers
4k 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 ...
9
votes
2answers
2k views

How do I find the windowid to pass to screencapture -l?

The command line utility screencapture claims to be able to capture a single window without requiring interaction, but I can't figure out what to pass it. -l<windowid> capture this windowsid ...
6
votes
5answers
2k views

How can I Open Multiple Customized Terminal Shells?

How can I customized Terminal so that when I open the application it opens several shell tabs? If possible I would like to also have it run a different environment script for each tab. Example: Run ...
5
votes
3answers
5k views

How to hide computer name and user name in terminal command prompt

How can I hide username and computer in terminal command prompt? In Terminal it says Last login: Mon Jan 13 00:00:14 on ttys000 Whatever:~ UserName$ Is it possible to show just the current ...
5
votes
3answers
3k views

How can I add a path to the PATH environment variable?

I want to add a path to the PATH environment variable? I have tried with export PATH=/mypath:$PATH and it works. But the next time I start the Terminal, my new path is not int the PATH environment ...
8
votes
2answers
2k 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 ...
7
votes
2answers
7k views

How do I mount ejected external USB flash storage?

Suppose that we connect our flash USB drive to a MacBook, then eject this storage from Finder sidebar. Now I want to remount this storage without unplugging and replugging it into the computer, but ...
4
votes
2answers
14k views

installation stuck in a loop due to damaged HD

Right off the bat I'll admit it was stupid to jump into trying to install a new version of OS X to the only partition without having taken adequate precautions (no backups or recovery disks), but ...
4
votes
5answers
2k views

Monitor a folder for changes, and run a command when a change is detected

Is there a simple way to automatically run a (Terminal) command every time a file is changed in a specific folder? This should be possible via the command line, or a system built-in application, no ...
1
vote
3answers
830 views

How to persistently define aliases in Terminal

I want to add aliases to my environment so that they are available in all Terminal instances. I got this answer: Yes, you can put it in your .bashrc, .bash_profile or .profile. On some systems ...
2
votes
2answers
339 views

Equivalent to alt-. in terminal

I am curious as to whether there is an equivalent to the Alt-. command on Mac. On my computer it inserts the following character: ≥, instead of showing the preceding lines final parameter.
31
votes
4answers
3k 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 ...
15
votes
4answers
2k 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 ...
17
votes
9answers
17k 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 ...
9
votes
2answers
3k views

Prettify OS X console by coloring output?

OS X terminal is not using colors for highlighting output from different commands, for example ls. When compared with other systems like Ubuntu, this is a big loss of accessibility/productivity. ...
8
votes
4answers
19k views

How can I reset a Mac's password from Single User Mode?

My sister bought a used MacBook about 6 months ago and she has lost her password. Here is the procedure I tried to use to reset the password: Boot into single user mode (press Command-S at power ...
7
votes
3answers
6k views

Change Terminal.app's Default Shell to BASH

How can I change Terminal.app's default shell to BASH? For some reason, my friend's Mac (10.6.6) defaults to using TCSH instead of BASH. The obvious remedy is to choose /bin/bash as the command to ...
11
votes
2answers
864 views

cd to a directory by typing its name?

For example if a directory 'blob' exists and I just type 'blob[return]' then the system cds into the blob directory for me. In Linux (Ubuntu) I can add shopt -s autocd to my .bashrc file, but on OS X ...
16
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 ...
13
votes
4answers
1k views

Is there a way to get Terminal on Lion to start up cleanly (without the buffered history)?

How can I prevent Terminal from showing me my old output when it starts? I would like it to always start with a clean window.
8
votes
2answers
5k views

Changing Preview.app's default View state in Lion

One thing I dislike about Preview.app in Lion is its defaulting to Continuous Scroll as the view option when a new PDF document opens. My recollection is that previous behaviour was for the last-used ...
6
votes
5answers
2k views

How to make terminals open side-by-side?

I use terminals a lot, and I frequently open and close them. The problem is that whenever I open a new terminal using ⌘+n it overlaps the current one, and I have to move it out of the way first. ...
9
votes
3answers
11k views

How to fix Terminal error DYLD_ environment variables being ignored because main executable (/usr/bin/login) is setuid or setgid?

Any time I open a new terminal window (independent of terminal app), the console stderr displays dyld: DYLD_ environment variables being ignored because main executable (/usr/bin/login) is setuid or ...
7
votes
2answers
1k views

How can I install the Command Line Tools completely from the command line?

I'd like to script the installation of the the Xcode Command Line Tools. On Mavericks, xcode-select --install will open a dialog prompting the user to install, but I'd like to trigger the install ...
7
votes
3answers
2k views

Can Finder and the “open” command treat files with .sh or other typical extensions just like .command files?

I am looking for a way to inject some more extensions into the OS X launch services database systematically so that when clicked, they execute in the terminal app just like .command files do by ...
5
votes
4answers
763 views

Is there a better way to shutdown/restart OSX?

Whenever I want to shutdown/restart OSX I click on the menu, select shutdown, and then click the box for not saving the session, and then click OK. Then there's always at least one program that ...
4
votes
3answers
4k views

How do I rename the Downloads folder (in Lion)?

For whatever perverse reasons I wish to rename the Downloads folder to Temp. I would also be happy with a way of making it appear to me, in both the GUI and the CLI, as Temp. I am aware I can do this ...
3
votes
5answers
4k views

Where is nmblookup in Lion?

I'm trying to call nmblookup in a Terminal on Lion, but it's not available. How can I lookup NMB hostnames from the Terminal now?
2
votes
2answers
2k views

How to make iPhoto library back into bundle

I recently recovered from a disk failure and while most of my files are ok, I'm having trouble with my iPhoto library. While it appears that the data fro the iPhoto library is intact in the recovered ...
1
vote
1answer
118 views

Where should shell tools be installed?

Are there Apple guidelines for where user shell tools in Mountain Lion should be installed? Some (e.g. TeX, or Apple's Git) end up in /usr, and others (e.g. X11) seem to end up in /opt (sometimes with ...
10
votes
3answers
5k views

I installed Xcode but I still don't have gcc in my terminal

I just got a Mac and I'm a complete newbie, so this may be kind of a really easy question, but I wasn't able to solve it with Google or F1. I was trying to run a C program from the Terminal that ...
3
votes
2answers
1k views

How can I use tmutil to figure out which files just got deleted?

I'm on Lion and until ten minutes ago I didn't know that the nifty new tmutil existed. But now I'm a little uncertain with all its options and sub-commands which to use to try and figure out what went ...
2
votes
4answers
603 views

List the extensions installed in Safari for Mac OS X, and state whether each one is enabled

I'd like a list, from which text can be copied. (Not a screenshot of preferences.) This information does not appear in any of the following: Safari System Profiler in Snow Leopard System ...
1
vote
1answer
198 views

Alt-. and vertical bar (pipe) on terminal

On linux consoles I always use Alt + . to get the last argument of the previous command in history. for example if I had ls /tmp/test as last command, and if I type rm Alt - this will result ...
1
vote
2answers
2k views

Terminal $PATH error

I was adding a $PATH to .bash_profile: PATH="/Applications/MAMP/bin/php/php5.3.6/bin:$PATH" So I could install PEAR on MAMP. That all worked, but now I have an this error each time I start up: ...
1
vote
2answers
5k views

Running terminal commands on startup/login

How can I run terminal commands on startup or login? On FreeBSD I believe you can do this using rc.d - is there an equivalent for the Mac? I know how to set up Login Items, but these only work for GUI ...