The Stack Overflow podcast is back! Listen to an interview with our new CEO.

Questions tagged [terminal]

Questions about the Terminal application or its terminal emulation should use this tag. Use **command-line** for questions about shells or command-line programs that do not specifically involve Terminal.

Filter by
Sorted by
Tagged with
16
votes
6answers
84k views

Terminal returns not found for most commands Mac OSX

I'm really new to Mac OSX and UNIX based systems. I wanted to run a few Windows games on my Mac Mini so I started installing Wine and MacPorts. Having done so, I typed in sudo port install wine and ...
307
votes
12answers
172k 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 ...
73
votes
5answers
82k views

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

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:~ russell$...
111
votes
14answers
155k 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.
21
votes
12answers
20k 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 (...
14
votes
6answers
11k views

How to show hidden files on mac without Terminal

I need an easy way to switch files visibility on Mac. I know about Terminal commands how to show hidden files and hide files. However, I need a tool to make this task faster and easier. I was trying ...
404
votes
133answers
237k views

Got any tips or tricks for Terminal in Mac OS X?

One tip or trick per answer. My favorite is open . Opens the folder you're currently browsing in Finder. You can also pass URLs, images, documents or else to open. If you specify a program name ...
351
votes
5answers
494k views

How can I create a symbolic link in Terminal?

What command is used to create a symbolic link/soft link?
58
votes
6answers
63k views

How to get BSD FTP and Telnet back in 10.13 (High Sierra)?

There are some real problems with not having ftp and telnet present in 10.13 now as per Apple's dictate. Has anyone found a solid way to bring BSD ftp and telnet back to macOS vs using inetutils?
30
votes
3answers
30k views

Creating System-Wide Keyboard Shortcut To Launch Applications [duplicate]

I recently switched from Ubuntu, and I was feeling very comfortable with using Ctrl + Alt + T to launch terminal. Can I assign Shift + Cmd + T to do the same thing in Yosemite? Specifically, I want a ...
21
votes
1answer
8k views

Can't cd into alias

I have two aliases in my home directory: devbootcamp and bookshelf. I can cd into devbootcamp but not bookshelf but I'm not sure why. I don't remember how I made the alias to devbootcamp but I ...
95
votes
2answers
152k views

Why doesn't Mac OS X 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 Bash ...
23
votes
3answers
28k 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?
120
votes
4answers
429k 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 ...
93
votes
10answers
37k 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 ...
117
votes
2answers
19k views

What functionality do 'marks' offer in the El Capitan Terminal?

Since upgrading to OS X El Capitan, I've noticed a change in the Terminal: Executed lines show an opening bracket on the left, and a closing bracket on the right, as shown in this screenshot: Similar ...
27
votes
4answers
41k views

What steps are needed to create a new user from the command line?

What commands (or script) can create a fully functional user account on Mountain Lion, running only from the command line via terminal or ssh. It looks like an existing pair of answers might work, ...
36
votes
6answers
63k views

How to set system-wide environment variables on OS X Mavericks

We used to use /etc/environment to set system-wide environment variables on Mountain Lion. However, it seems this file is no longer read. Ideally the solution should apply to all users, and we need ...
13
votes
5answers
25k views

I broke my PATH by editing my ~/.bash_profile and Bash will not recognize most commands

in .bash_profile I accidentally set the path to: PATH="~/Tools/apache-maven-3.3.3/bin" and now the default path is gone. Nothing in Terminal works anymore: Korays-MacBook-Pro:~ koraytugay$ ls -bash:...
202
votes
13answers
369k 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 Terminal>Preferences>"...
336
votes
10answers
259k 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
181
votes
5answers
125k 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?
78
votes
7answers
286k views

How can I mount an SMB share from the command line?

I would like to mount an SMB network share from the command line (terminal); how would I go about that? I am using Mac OS X 10.6.4.
61
votes
9answers
93k 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 folder ...
22
votes
4answers
141k 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 on) ...
55
votes
2answers
62k 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} ...
35
votes
5answers
4k 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 ...
24
votes
2answers
27k 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. ...
27
votes
4answers
84k views

How to SSH in one line

How would I connect to another computer through SSH in one line? If I were to do ssh host@IP, it would require me to enter the password in the second line. I was thinking that I could do something ...
2
votes
2answers
2k views

How to detect if Mac if rebooting after a power failure using terminal?

As I asked in the title, how can I check if a Mac is rebooting after experiencing a power failure. It would be preferable to check this using terminal or some other script, as I would like to test ...
148
votes
6answers
106k 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 slide-down-from-...
80
votes
6answers
52k views

Update bash to version 4.0 on OSX

Is it possible to actually update bash to version 4.0 in OSX Yosemite? echo $BASH_VERSION 3.2.57(1)-release This article and this thread refer to the same question, but they install a new shell side-...
84
votes
4answers
13k views

What are the practical differences between Bash and Zsh?

With the news that Catalina will default to Zsh instead of Bash, I'm finding lots of results telling me about the switch, and that it may cause problems with shell scripts, but I'm not familiar enough ...
71
votes
19answers
142k 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 ...
24
votes
17answers
15k 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 ...
23
votes
3answers
34k views

How do I get different colors for directories, etc. in iTerm2?

I have a new MacBookPro, and I installed the latest release of iTerm2. Even after I imported various color schemes, I notice that they just change the color of the text and background only. What I ...
15
votes
9answers
97k views

Open terminal using a keyboard shortcut

I am using Alfred and hence I don't have any use for the Cmd+Space keyboard shortcut. I want to invoke terminal using that shortcut. Just like in Ubuntu, when you press Ctrl+Alt+T, is there a way to ...
13
votes
4answers
22k 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 ...
23
votes
3answers
43k views

How can I access the keychain remotely from the command line?

I am storing various passwords (e.g. for remote email servers) in my keychain. From the command line, when logged in locally, I can retrieve these via: security unlock-keychain ~/Library/Keychains/...
36
votes
4answers
52k views

How do split panes in Terminal work?

I tried to open a split pane to run another command but instead it displays the same in both panes and I can only interact with one of them. I thought it would split the view so I could use the two ...
12
votes
4answers
58k views

csrutil: command not found

I am using a Mid 2012 MacBook and recently upgraded it to OS X 10.11 El Capitan. I was having trouble with it's new SIP feature and wanted to disable it. I tried to boot into OS X Internet Recovery ...
12
votes
5answers
56k views

How to reset $PATH?

I was trying to add something to $PATH and it went totally wrong. I now can't run any commands such as ls. I've looked at this answer and used the following lines: PATH=/usr/bin:/bin:/usr/sbin:/...
10
votes
4answers
31k views

How do I search all hidden files that are in hidden folders using Terminal?

I need to find some configs buried in some hidden folders and can't recall where they are to navigate to them directly Cmd+Shift+G. I did a sudo find -name Foo* (slow), but none of the returned files ...
7
votes
2answers
2k 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 ...
30
votes
10answers
7k views

Case-insensitive ls sorting in Mac OSX

How can I make the ls command in Max OS X Lion sort files and directories similar to how Ubuntu Linux does (case-insensitive, directories NOT on top, dot files NOT on top)? Ideally I'd like to do ...
11
votes
2answers
13k views

How to make a Mac OS X .app with a shell script?

I tried following a few tutorials, but I get this: How can I fix this? I added in a info.plist (I just copied and pasted another app's file, and changed around a few things.) Also, I used chmod +x ...
16
votes
6answers
6k views

Option + click in iTerm

In Terminal, Option + click allows me to place my cursor at any point on the current line-- great for editing really long commands. How can I do this in iTerm2? Update: According to this page, the ...
3
votes
4answers
2k views

“Use Option as Meta key” with ability to type the # symbol

I am using Terminal version 2.5, where I have two requirements: I need to be able to type the <META> key. I need to be able to type the # character. How can I satisfy both of these? By default,...
0
votes
1answer
1k views

BootCamp Partition Error!! Help. Deleted EFI Partition

During my Windows 7 installation (via BootCamp) I came to screen that looks similar to this picture. I chose to delete and format the EFI partition (~200 MB) and and the other small partition (~629 ...
352
votes
12answers
183k 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 ...