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
3answers
1k 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
5answers
9k 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
3answers
73k views

How do I run terminal in sudo mode?

I was trying to install npm, and I got npm ERR! Error: EACCES, Permission denied '/usr/local/lib/node_modules' npm ERR! npm ERR! Please use 'sudo' or log in as root to run this command. npm ERR! ...
6
votes
3answers
7k 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 ...
6
votes
7answers
11k 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.
6
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 ...
6
votes
2answers
696 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
5k 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
209 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
334 views

How to prevent the application launched in Terminal from undesirably exiting?

I launch applications from the Terminal with commands like this one : /Applications/Mail.app/Contents/MacOS/Mail & The important part is the &. For Unix / Linux / Solaris : I have ...
6
votes
2answers
5k views

Run AppleScript from bash script

If I wanted to run an AppleScript from within a bash script I could call a file with the list of commands that I require to execute. #!/bin/bash {some commands} osascript file.scpt {other commands} ...
6
votes
3answers
982 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 ...
6
votes
1answer
325 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
916 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 ...
6
votes
1answer
2k 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
7answers
5k 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
2k views

What is the difference between .bash_profile and .bashrc?

To make an alias for the Terminal in OS X, you can either put the aliases in .bash_profile or .bashrc. What is the difference between the two and why would I choose to put aliases in one and not the ...
6
votes
2answers
2k 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
3answers
191 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…?
6
votes
1answer
1k 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 ...
6
votes
1answer
22k 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
3answers
215 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
3answers
16k 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 ...
6
votes
1answer
797 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
1answer
7k 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
647 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
3answers
916 views

How do I make symbolic links invisible in the Finder?

I use SetFile via the terminal to render files and folders invisible inside Finder windows. This does not appear to work on symbolic links: the symlink destination is made invisible, rather than the ...
6
votes
4answers
5k views

Open an app in fullscreen via Terminal

I wonder if it's possible to open a program in Lion fullscreen mode via the Terminal. I want to write a short script which starts a bunch of programs in fullscreen mode, so that I only have to click ...
6
votes
3answers
3k 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
2answers
302 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
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
2answers
3k views

Can I install or update Mac App Store apps through a command line using terminal?

Is there an official way provided by Apple or a workaround so that I can install or update Mac App Store apps through Terminal?
6
votes
1answer
688 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
3answers
956 views

Open Terminal.app with directory from a given URL?

With the URL <file:///Library/Fonts> (for example in a note in NV) I can open the finder with the given location. Can I do something similar for the terminal? That is, if I write for example ...
6
votes
1answer
746 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
2answers
325 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
3answers
286 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
262 views

How do I disable (and re-enable) my Thunderbolt port from the terminal?

I've been having this problem with my Matrox DualHead2Go ME and my late 2011 15" MBP (running 10.9.2). When the displays wake from sleep, the external monitor does not re-awake. I've gathered that ...
6
votes
2answers
2k 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
1answer
883 views

How to update some application to latest version with homebrew-cask?

I noticed some packages provided by homebrew-cask uses a url of the latest version and a version number of "latest" such as dropbox and chrome. Thus they will never be upgraded with brew upgrade. Is ...
6
votes
1answer
210 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
1answer
254 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
4answers
11k 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 ...
5
votes
3answers
6k 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
5answers
1k 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
549 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 ...