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

6
votes
1answer
798 views

how do I get Terminal's Search with Google to open in the default browser?

Scenario: working away in Terminal, get an error message. Want to google it so I select text and use right-click and "Search with Google". Opens Safari every time. Google Chrome is my default browser. ...
6
votes
4answers
3k views

sourcing bash profile for root users

Apologies in advance if this question is going to annoy the hell out of everyone as I appreciate, it's been asked in various ways many times before. Please be assured, I have read the archives and ...
6
votes
2answers
2k views

Make ls command sort by file type (e.g. directories and file extension)

How do I make ls sort by file type (e.g. directories first and then by file extension)? The answers suggested in (Super User) Make ls sort by file type result in unknown option errors from ls.
6
votes
1answer
14k views

How to save and exit “nano .bash_profile” in Terminal?

I need to add some line to nano .bash_profile in Terminal. Then: 1) I enter with this command line: nano .bash_profile 2) Add the line I need 3) now I don't know how to Save and Exit I thought it ...
6
votes
2answers
3k views

How do I reset the scrollback in the terminal via a shell command?

When using Terminal.app, you can clear the screen by using the shell builtin clear or by pressing ^+L (Control-L). However, all this does is push the current screen content back one screen height ...
6
votes
3answers
210 views

Moving folder to Trash in Finder is not synchronized with Terminal

I tried to delete a folder which I access via terminal.app. Though the Finder moved the folder to the Trash, I was still able to see the contents and edit the file from terminal. created a textfile ...
6
votes
1answer
618 views

Terminal: Application Not Responding

A few days ago, Terminal.app suddenly stopped working. Whenever I open it, the little light below the icon in the dock turns on (and stays on), but no window appears. When I right-click the icon, I'm ...
6
votes
2answers
561 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
1answer
5k views

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

Are there any keyboard shortcuts to switch between tabs in terminal?
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 ...
6
votes
2answers
241 views

Can I configure terminal to show stderr output in different colour

Is it possible to configure the terminal in OS X to show stderr output automatically in a different colour than stdout output from a process? Or is this only possible if the process is outputting ...
6
votes
3answers
2k views

Script to raise a single window to the front

In a script I'm trying to find the Terminal.app window containing a specific tty device and raise that window to the top. Here's what I have in Applescript so far: tell application "System Events" ...
6
votes
2answers
2k views

Changing Terminal colors when ssh-ing into remote machine and back

Looking for a way automatically change terminal colors when ssh-ing into remote machine and revert back to the default colors, when exiting the ssh session. Simply, want have another colors when i'm ...
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 ...
6
votes
1answer
289 views

How to remove .DS_Store from command-line auto-completion using cd?

I understand that .DS_store files serve a purpose. That said, they are a nuisance when auto-completing with the cd command. When I type cd in Terminal and press tab twice it lists all directories in ...
6
votes
1answer
527 views

How to share history between terminal tabs?

I generally find myself using two or three tabs in my Terminal on OS X. A minor inconvenience is often that the tabs don't share a command history. So things like history | grep thingIamlooking for ...
6
votes
1answer
682 views

Adding movie-style sound effects to the Terminal

I want to have movie style sound effects in the terminal. You know, when every keystroke and line emits a cool little beep. (Something like this.) I've used KeyClick, but that's only for keyboard ...
6
votes
3answers
253 views

Can I adjust the time delay for when the dock re-appears?

I like to hide the dock unless I need it. There is a slight delay before it will reappear. Is there a Terminal setting I can change so that the dock will instantly appear when I move my mouse to the ...
6
votes
2answers
1k views

What terminal command or program can list an SSD's Power On Hours?

I'm looking to script using the unix shell the retrieval of SSD (and HDD) data that disk utility shows in the information window. I'm immediately interested in the Power On Hours and Power Cycle, ...
6
votes
3answers
6k views

How do I find my IP Address from the command line?

I know you can do ifconfig | grep inet, but that shows you several IP addresses. How do I get the specific one for SSHing et al?
6
votes
1answer
209 views

How to keep the text selection in Terminal.app when typing

In Terminal.app, when I select some text and start typing again, the text selection is gone. I personally find this very annoying. Is there a way to make Terminal.app keep the selection when I type?
6
votes
3answers
354 views

Can I make the mouse hairpin in the terminal more visible?

It often takes me a while to find the mouse crosshair when working with Terminal.app. Is there a way to make it more visible?
6
votes
2answers
506 views

I-beam cursor color in Mavericks's terminal

After upgrading to Mavericks the I-beam cursor in the terminal became less visible (see screenshot, I am using the Pro profile with a dark background) Is there a way to change the cursor's color or ...
6
votes
3answers
789 views

How to add folder to Spotlight “do not index”?

Is there any way to programmatically add a folder to Spotlight's "Privacy" tab? Either through Terminal or Applescript? Often I want to click on an item in Spotlight results in Finder, and have that ...
6
votes
1answer
243 views

Incorrect Terminal.app output for long lines with tabs

When I run the following command in Terminal.app: echo -e "a\tb\tc\td\te\tf\tg\tyo" I should get the following output (using a 40-column window so that lines don't wrap here, and replacing tabs ...
5
votes
6answers
2k views

Why use the terminal in daily non-programming life

Disclaimer: I'm a Windows boy awaiting his first mac. I never bothered learning/using command-line interfaces. I've been looking at the Terminal Tips and Tricks topic and I don't see how any of those ...
5
votes
2answers
925 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?
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
5answers
763 views

OSX Bash for loop - issues with spaces in folder names?

I'm getting a bit confused on how to handle spaces in path names when returned in a for loop. Rationale: I'm cleaning up the permissions on folders and files that I copy over from Windows. Most of ...
5
votes
3answers
5k views

Use MacVim as standard Terminal?

I used to love the terminal.app for many reasons. I especially liked the way I could navigate to a file and edit using vim it all in one app, without having to leave the keyboard. But, since the ...
5
votes
6answers
2k views

OS X Terminal equivalent of Ctrl+Left / Ctrl+Right

In Windows and Linux I could always hit ctrl+← or ctrl+→ to skip a word to the left or right in the terminal. In text editors it seems that ⌥+←/→ works, but no dice ...
5
votes
4answers
762 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 ...
5
votes
3answers
389 views

After typing sudo I can no longer autocomplete commands by pressing Tab

In a Terminal, if I type beginning of any command by pressing tab I can see the rest of that command. However this feature does not work with any words I type after sudo. How can I complete command ...
5
votes
3answers
916 views

Can the contents of a partition be recovered after partition table is overwritten?

I ran a command to make my external hdd bootable knowing that it was risky considering the command itself did not allow me to specify a partition to which to write. (In hindsight, I would now call ...
5
votes
1answer
2k views

Is there a way to force Mac OS X to close all the applications when restarting?

I sometimes shut down my Mac, and I cannot wait it shuts down because I am urgently requested to do something in another office that would require some hours. In some cases, an application that opens ...
5
votes
2answers
408 views

Is there a UNIX-style triple click to select path in Terminal.app?

In Red Hat, if there is a path somewhere on my terminal window and I triple click it, the whole path is selected. I can then easily copy it using middle-click or a regular copy-paste. This doesn't ...
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 ...
5
votes
1answer
2k views

Move to Start of Line in Terminal.app

Is there a quick key combo that will allow me after typing some stuff in the OSX terminal to move back to the beginning of that line? I have tried different things, and was wondering if there is a ...
5
votes
3answers
6k views

Where are bash profile startup files?

I know that you can have a .profile or .bash file in your home folder to customise Mac OS X 10.6.4 Terminal bash startup. Every time I start up Terminal, there is a line that tells me "You've got ...
5
votes
1answer
118 views

How to launch TextMate (and probably other software) from the command line?

I am very new to Mac, coming from Linux. I am using TextMate, and I suddenly discovered I do not know how to launch TextMate from command line. Using completion, nothing looks like TextMate. Where ...
5
votes
4answers
176 views

Completion for git commands

I recently switched from using an Ubuntu box for the last 7 years to a Mac. I have read other posts like Switching from Ubuntu to OS X and I'm lost and What is the difference between iTerm2 and ...
5
votes
1answer
2k views

How do I get Wi-Fi info from within Terminal?

Is there a way to get BSSID and the list of available Wi-Fi networks from within Terminal? I.e. I'm looking for something similar to ifconfig run0 scan on OpenBSD, which lists all access points, ...
5
votes
3answers
4k views

Merging Multiple CSV Files without merging the header

I need to merge multiple .CSV files (using the cat command) but without copying the header for each file. What's the best way to accomplish this task?
5
votes
2answers
332 views

How can I have my shell always start in a certain directory that is not my home directory

I've tried putting cd /Users/my_name/my_directory/structure in both .bashrc and .bash_login but neither works, i.e. when I open a new terminal window I am in my home (/Users/my_name/) directory. ...
5
votes
1answer
373 views

Parental Controls not restrict Terminal Commands?

I have a Parental Controls limit on my child so I have to type in my password when they open a new application. I have recently discovered a problem though. They have tried programming in terminal. ...
5
votes
4answers
2k views

iTerm2/Terminal full screen

Why is it not possible to have iTerm2 or Terminal app take up the full available space on the screen. Let me show an example: It's hard to see but if you look on the right and bottom edge, there is ...
5
votes
2answers
3k views

How can I install themes for Terminal?

I am rather new to Mac, but I am trying to get familiar with Terminal and I want to change its theme. I am a bit confused on how to go about installing Solarized themes I am seeing so much of around ...
5
votes
3answers
3k views

How can I manipulate several security settings from terminal?

I want to change these behaviors from terminal: Auto-login Showing password after screensaver and sleep mode Go to sleep mode after x minutes Enable screensaver after x minutes
5
votes
1answer
837 views

Completely clear all output from a Terminal window

I would like to clear all output from a Terminal window (including all historical output) to get it back to a clean state as if you had just opened a new Terminal window, or a new Terminal tab. I can ...
5
votes
1answer
348 views

What does Force Quit do in OS X?

How does the GUI interface for force quitting applications (⌘+⌥+esc) work? e.g. Does it work like killall Finder which would send a TERM signal by default?