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

7
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 ...
7
votes
2answers
17k views

Using Terminal, how can I find which directory is my USB drive mounted in?

I am using Terminal and have looked through directories. I just can't find where my USB drive its directory is. Which directory is my USB drive mounted in?
7
votes
6answers
2k 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 ...
7
votes
3answers
1k 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 ...
7
votes
2answers
548 views

Is there anyway to have a badge icon appear on the Terminal icon when a command completes?

I currently have an Applescript app that opens Terminal windows and completes commands. I would like a badge icon to appear on the Terminal icon when a command completes. I need this because I often ...
7
votes
4answers
3k 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 ...
7
votes
2answers
3k 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.
7
votes
3answers
8k views

Why is my host name wrong at the Terminal prompt when connected to a public WiFi network?

For three days straight, I have connected to the public WiFi network at my local library. Each day, I have seen a different prompt in Terminal. Here are some of the prompts I've seen: zp-pc:~ ...
7
votes
1answer
2k views

Change Network location from terminal

I have a two locations set up on my macBook. One for normal use and another for when I use a proxy, which I start from the command line. It would be very useful for me to be able to switch network ...
7
votes
3answers
21k views

uh oh. -bash: ls: command not found

I installed the most recent mac update to OS X Lion (10.7). After I did that, my terminal won't recognize normal commands. I type 'ls' and get: -bash: ls: command not found I figured I'd try to ...
7
votes
4answers
12k views

how do you change mac terminal theme so that it doesn't go back to 'basic' every time you open it

I just can't find any way to change the theme and have it applied permanently. I really need some guidance here, all I want is to change to another darker theme other than the default 'basic' theme, ...
7
votes
4answers
307 views

Can I run top as screensaver?

My employer has recently issued me a MacBook Pro to play with. I have a lot of Linux experience, but I was struck by how nice the terminal looks on the Mac in full screen mode, especially when running ...
7
votes
1answer
1k views

Why does the folder icon in my Terminal have a question mark overlaid?

From time to time, I spot that the folder icon in the titlebar of one of my Terminal windows has a question mark overlaid on it, e.g. this one: What does this mean? It doesn't seem to have any ...
7
votes
2answers
2k views

How can I merge two similar-but-not identical folders?

I have a folder (which is filled with many many sub-folders and files) which is on a FireWire drive [source] which I am trying to move to a USB drive [destination]. I am trying to move all of the ...
7
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 ...
7
votes
3answers
742 views

copy last command in terminal

I can see last command in terminal by pressing up arrow as in following example: I typed cd /: Makss-Mac:~ maks$ cd / ... pressed enter, command cd / executed and now I can press up arrow and see ...
7
votes
1answer
5k views

Where are the Terminal settings stored on OS X?

You'd think A) I'd know this by now, and B) that it's readily available info, but apparently neither is the case. What I'm looking for is where the config files (colors, etc.) that ship with ...
7
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 ...
7
votes
2answers
429 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 ...
7
votes
2answers
569 views

How do I find the windowid of Google Chrome to pass to screencapture -l

I'd like to use screencapture -l to do automated screen captures of Google Chrome. This requires knowing the windowid of the Google Chrome process that's running. For apps that support Applescript, ...
7
votes
1answer
883 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 ...
7
votes
2answers
345 views

How can I process/read checkmarks on a paper form?

I would like to process a large number of scanned paper forms (GUI or command line). I am only interested in reading (custom) checkboxes. The form looks like this: every line has 6 circle-shaped ...
7
votes
2answers
4k views

How do I make ⌘← and ⌘→ work for home/end combo for Terminal?

Why does fn-⇧-→ (or others) do a home/end in Terminal but a ⌘-→ works everywhere else? So just to be clear the question is how to make Terminal take Command + ← and → for home and end?
7
votes
1answer
807 views

Show text in large type on the screen via terminal

I can put large text on the center of my screen with certain apps, such as Address Book (click on a phone number and choose "Show in Large Type") or using Quicksilver (type some text and choose the ...
7
votes
1answer
867 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 ...
7
votes
3answers
2k views

Why don't my arrow keys work in vim under iTerm?

They work just fine if I use Terminal and start a vim session, but under iTerm I have to resort to using H-J-K-L to do left-up-down-right movement. In both Terminal and iTerm TERM=xterm-color. My ...
7
votes
3answers
648 views

Any way to make Cmd-D “delete next word” rather than “split-pane” in Terminal

I am so used to using ⌘D to "delete-next-word" in emacs and xterm, that I automatically hit it in Terminal all the time, which rather annoyingly (to me, at least) causes the pane to split instead. ...
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 ...
7
votes
3answers
10k views

How do I mount ejected external USB flash storage? [duplicate]

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 ...
7
votes
3answers
2k 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 ...
7
votes
2answers
485 views

Multiuser GNU screen sessions

I am attempting to set up multi user screen sessions on Mac OS 10.7.3 and I run into the error Attach attempt with invalid pid(xxx)!. If set it up as follows: Initial configuration of system: Make ...
7
votes
1answer
97 views

How to “chroot” a terminal inside a DMG?

I'm doing security research and for that purpose I use an SHA-2 encrypted DMG to store the tools and files I work with (containing confidential client info), to protect them from forensic examination ...
6
votes
5answers
14k views

How can I save SSH Bookmarks in Terminal?

I've recently become infatuated with TotalTerminal and am tempted to switch from iTerm back to Terminal just so I can use it, except that I rely heavily on a half dozen SSH bookmarks in iTerm. Is ...
6
votes
2answers
978 views

Change my shell to a different bash version at /usr/local/bin/bash?

How can I set my /usr/local/bin/bash (which is the 4.2 version that allows auto-completion of 'cd to directory with directory name') to be my default bash for a new window instead of my regular ...
6
votes
1answer
7k views

What command combo at terminal will output a list of directories with human-readable sizes?

I'd like to open Terminal.app and enter a command like: my-macbook-pro:~ my-username$ ls -lh Instead of seeing the size of the folders in bytes that are in my current working directory, I'd like to ...
6
votes
3answers
813 views

Is there a way to make the terminal's font less blurry?

I have been using a MacBook Pro for about a year or so, and I can definitely say that I am really satisfied from it. But there is one little thing that annoys me about it: the fonts in many text ...
6
votes
6answers
7k views

Improved Terminal autocomplete funcionality (similar to Matlab's)

If any of you ever used Matlab, you might have noticed the command window functionality in that program. I wonder if it is possible to enable the same functionality in Mac Terminal. It works like ...
6
votes
1answer
4k 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 ...
6
votes
2answers
1k views

Are Bash, Bourne, and Korn shells compiled into one binary in OSX?

On OSX 10.8, if you compare the binaries for bash, sh, and ksh, a few different shell options, they are the same size. If you take it further and cmp the binaries, there seems to be only a ...
6
votes
1answer
345 views

Is it possible that some hacker is logged in to my computer?

When I type w at the terminal I see myself logged in two times. What are console and s000? Is it possible that one of these neos is actually somebody else?
6
votes
4answers
54k views

How do I set environment variables on OS X?

I have always difficulties setting the environment variables on Mac like JAVA_HOME, M2_HOME or PATH. How to set these on Mavericks OS X? I did some research but the answers I've found didn't really ...
6
votes
1answer
3k views

Create a termnial command to open file with Chrome

I want to create command in terminal that would allow me to use chrome index.html and have the the given file open in Google Chrome. How can I get this working?
6
votes
1answer
2k views

Transparent Background in Terminal?

On Ubuntu, I can change the terminal background to be semi-transparent. I've seen other people do this in OSX, but I don't see the setting anywhere. Is there some way to make this happen?
6
votes
3answers
7k 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 ...
6
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 ...
6
votes
7answers
6k views

Is there a beginners guide to Unix from the OS X point of view?

I'm hoping to build on my embarrassingly-limited knowledge of the command line, and I know there are a ton of great resources out there. I'm wondering if there are any books or other resources that ...
6
votes
2answers
3k views

What option should I give the sudo command to have the password asked through a graphical interface?

This problem has ben bugging me for a while now. Every now and then, I need to write a script file that should execute sudo commands. I do not necessarily know in advance that I will run as sudo so I ...
6
votes
5answers
3k 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. ...
6
votes
2answers
617 views

Change *.txt to *.csv

How can I rename all *.txt in a directory to *.csv files in the terminal (Mavericks). I tried following inside the directory: mv *.txt *.csv
6
votes
3answers
270 views

Terminal command to bring up shutdown dialog?

I know how to shutdown a Mac from Terminal, but is there a way to actually bring up the shutdown dialog you get from Apple → Shut Down…?