All Questions
5,182
questions
3482
votes
41
answers
1.5m
views
Git is not working after macOS update ("xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools")
I updated to the latest OS, and/or restarted my computer (this happens on every major update, but this time all I did was restart my computer on 2022-09-13).
This morning I navigated to my work's ...
928
votes
21
answers
468k
views
How to move the cursor word by word in the OS X Terminal
I know the combination Ctrl+A to jump to the beginning of the current command, and Ctrl+E to jump to the end.
But is there any way to jump word by word, like Alt+←/→ in Cocoa applications ...
822
votes
30
answers
624k
views
Run / Open VSCode from Mac Terminal
I'd like to run / open Visual Studio Code from the Mac OSX Terminal by running this command code .. I found instructions here:
https://code.visualstudio.com/Docs/setup
Apparently I need to include ...
751
votes
36
answers
810k
views
psql: FATAL: role "postgres" does not exist
I'm a postgres novice.
I installed the postgres.app for mac. I was playing around with the psql commands and I accidentally dropped the postgres database. I don't know what was in it.
I'm ...
682
votes
14
answers
667k
views
Open terminal here in Mac OS finder [closed]
Is there something similar to the "Open Command Window Here" Windows Powertoy for Mac OS? I've found a couple plugins through a google search but wanted to see what works best for developers out there....
575
votes
33
answers
446k
views
Open Sublime Text from Terminal in macOS
In Terminal when I use .subl
It returns -bash: .subl: command not found
Anyone know how to open Sublime Text 3 from the command line in macOS?
540
votes
7
answers
508k
views
OS X Terminal Colors [closed]
I just got a Mac after working with Ubuntu Linux for some time. Among the many things I'm trying to figure out is the absence of colors in my terminal window- like the ones that are shown (on Linux) ...
380
votes
31
answers
838k
views
After installing Homebrew I get `zsh: command not found: brew` [closed]
➜ ~ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
-e:77: warning: Insecure world writable dir /usr/local/bin in PATH, mode 040677
It appears ...
341
votes
9
answers
114k
views
Mac OS X Terminal: Map option+delete to "backward delete word"
Tried to map it from Preferences -> Settings -> Keyboard, but the "key" combo box has only "forward delete" but no "delete". My keyboard on the other hand has only "delete" and no "forward delete"!
...
307
votes
31
answers
600k
views
adb command not found
I need to run an adb forward command before I could use the ezkeyboard application which allows user to type on the phone using browser.
When I run adb forward tcp:8080 tcp:8080 command I get the ...
305
votes
25
answers
408k
views
Failed to build gem native extension (installing Compass)
When I attempt to install the latest version of compass (https://rubygems.org/gems/compass/versions/1.0.0.alpha.17), I get the following error.
ERROR: Error installing compass:
ERROR: Failed to ...
287
votes
11
answers
1.1m
views
How do I edit $PATH (.bash_profile) on OS X?
I am trying to edit an entry to PATH, as I did something wrong.
I am using Mac OS X v10.10.3 (Yosemite)
I have tried:
touch ~/.bash_profile; open ~/.bash_profile
But the file editor opens with ...
257
votes
2
answers
159k
views
How can I increase the cursor speed in terminal? [closed]
How can I increase the cursor speed in terminal?
I have Mac OS X by the way.
It would also be interesting to know it for Linux.
I don't know what I should search for in Google (or what you like).
252
votes
18
answers
174k
views
How can I set my default shell on a Mac, e.g. to Fish? [closed]
I do not like to retype fish every time I start terminal. I want Fish on by default. How can I set the Fish shell as my default shell on a Mac?
247
votes
21
answers
158k
views
(Mac) -bash: __git_ps1: command not found
I'm trying to change my command promt in terminal. I keep getting the error:
-bash: __git_ps1: command not found
I've tried it just by typing it into the terminal as is: __git_ps1. I've also tried it ...
237
votes
18
answers
515k
views
How can I fix the "zsh: command not found: python" error? (macOS Monterey 12.3, Python 3.10, Atom IDE, and atom-python-run 0.9.7)
Since I got the macOS v12.3 (Monterey) update (not sure it's related though), I have been getting this error when I try to run my Python code in the terminal:
I am using Python 3.10.3, Atom IDE, and ...
219
votes
3
answers
399k
views
How to copy files across computers using SSH and MAC OS X Terminal [closed]
I'm trying to copy my .profile, .rvm and .ssh folders/files to a new computer and keep getting a "not a regular file" response. I know how to use the cp and ssh commands but I'm not sure how to use ...
216
votes
6
answers
747k
views
Why is the apt-get function not working in the terminal on Mac OS X v10.9 (Mavericks)?
I was watching this, and, as you can see, the first command I am told to put in is:
sudo apt-get install python-setuptools
When I do this, it outputs:
sudo: apt-get: command not found
I have no ...
212
votes
5
answers
161k
views
"You have mail" message in terminal, os X [closed]
Few days ago I got this message in my terminal window:
What does that mean? I've never seen that before.
That was messages from xCode bots.
Thanks for the help.
209
votes
7
answers
356k
views
How do I make this file.sh executable via double click?
First off I'm using Mac.
Next, I need to execute this "file.sh" we will call it. Everytime I need to execute it I have to open Terminal and type:
cd /Users/Jacob/Documents/folderWithFileInIt
...
206
votes
18
answers
302k
views
How do I install command line MySQL client on mac?
I want to install the MySQL client for the command line, not a GUI. I have searched over the web but only found instructions on installing the MySQL server.
204
votes
16
answers
188k
views
OS X Terminal shortcut: Jump to beginning/end of line
I know that I can jump to the beginning and end of a line inside the OS X terminal with Ctrl+A and Ctrl + E. But I'm so used to jumping with Cmd+Right arrow and Cmd+Left arrow from my editor, that I ...
192
votes
16
answers
140k
views
Can't compile C program on a Mac after upgrade to Mojave
I have used the gcc command on the terminal to compile C programs but all of a sudden, after an update to my Mac's OS (to macOS 10.14 Mojave, and XCode 10.0), I started receiving the message:
test.c:...
188
votes
8
answers
54k
views
How do I make iTerm terminal notify me when a job/process is complete?
A notification center notification would be ideal but growl, bounce dock, sound, etc would be fine, too (or if this can only be done in Terminal.app I'd be willing to switch back). Is there an option ...
187
votes
16
answers
212k
views
Read-only file system when attempting mkdir /data/db on Mac [closed]
I am trying to create a new folder in the root directory.
I tried all kinds of examples.
sudo mkdir /data/db
sudo mkdir -p /data/db
I keep getting:
mkdir: /data: Read-only file system
183
votes
4
answers
62k
views
Is there a way to make a link clickable in the OSX Terminal?
I am planning on developing an Mxmlc to Textmate formatter, one that formats mxmlc errors as clickable links, so you can open them up quickly in Textmate as Textmate has a url scheme e.g.: txmt://...
182
votes
3
answers
107k
views
How to fix Terminal not loading ~/.bashrc on OS X Lion [closed]
Whenever I open a new tab in Terminal using Cmd + T, it opens bash in the same directory, as the previous tab. This works fine when I'm in the ~ directory, but if I'm anywhere else, I get an error ...
178
votes
19
answers
647k
views
How can I compile and run C/C++ code in a Unix console or Mac terminal?
How can I compile/run C or C++ code in a Unix console or a Mac terminal?
174
votes
3
answers
43k
views
How do I capture bash output to the Mac OS X clipboard?
Is it possible to capture bash output to the OS X clipboard?
171
votes
15
answers
220k
views
OSX - How to auto Close Terminal window after the "exit" command executed.
When I'm done with Terminal, I want to exit it. Right now, I have three options:
killall Terminal. It will end the process, but rather abruptly. I don't think this is the best idea.
Call exit. I've ...
171
votes
6
answers
155k
views
In OS X Lion, LANG is not set to UTF-8, how to fix it?
I try to setup postgress in OS X Lion, and find that is not correctly setup the LOCALE environment var.
This is what is set:
LANG=
LC_COLLATE="C"
LC_CTYPE="C"
LC_MESSAGES="C"
LC_MONETARY="C"
...
165
votes
4
answers
146k
views
Is there a way to give a specific file name when saving a file via cURL?
I am pulling files using curl in the mac OS X terminal and want to give them different names. Is there a way to specify a name, such as a "save as" function when using curl?
161
votes
6
answers
441k
views
How to move up a directory with Terminal in OS X
When I launch a new Terminal window, it starts me in 'Macintosh HD/Users/MyName'. How can I back out of my user directory, back up to the top level?
159
votes
18
answers
265k
views
How can I display the current branch and folder path in terminal?
I've been watching some of the Team Treehouse videos and they have a very nice looking terminal when working with Git.
For example they have (something similar):
mike@treehouseMac: [/Work/test - ...
159
votes
15
answers
147k
views
Open new Terminal Tab from command line (Mac OS X)
Is it possible to open a new tab in Mac OS X's terminal from the command line in a currently opened tab?
I know that the keyboard shortcut to open a new tab in Terminal is "CMD+t" but I am looking ...
155
votes
9
answers
160k
views
How to Batch Rename Files in a macOS Terminal?
I have a folder with a series of files named:
prefix_1234_567.png
prefix_abcd_efg.png
I'd like to batch remove one underscore and the middle content so the output would be:
prefix_567.png
...
146
votes
8
answers
167k
views
Change the default editor for files opened in the terminal? (e.g. set it to TextEdit/Coda/Textmate)
Is there a way to make files opened for editing in the terminal open in Textedit instead?
For example, where a command might open a file for editing (like git commit), instead of opening that file ...
144
votes
8
answers
69k
views
iTerm2: delete line?
I'm trying to map ⌘+Delete (backspace) to delete to the beginning of the line (like it works in browsers and text editors) in iTerm2 and I'm unable to find a working escape code for it. I tried 1K (^[...
135
votes
8
answers
146k
views
How do I make a Mac Terminal pop-up/alert? Applescript?
I want to be able to have my program display an alert, notice, whatever that displays my custom text. How is this done? Also, is it possible to make one with several buttons that sets a variable?
...
134
votes
8
answers
448k
views
Run script on mac prompt "Permission denied"
I'm new to mac with not familiar on terminal command, i put the dvtcolorconvert.rb file on root directory of my volume, this ruby script can converting xcode 3 themes into xcode 4 themes format, which ...
133
votes
10
answers
342k
views
Terminal error: zsh: permission denied: ./startup.sh
I am running a command
./startup.sh nginx:start
and I am getting this error message
zsh: permission denied: ./startup.sh
why could this be happening?
129
votes
7
answers
73k
views
How to resize images using terminal on Mac OSX?
I need a simple and free way to resize images and do batch jobs, if necessary. Free image manipulation software has been trickier to use than it should be.
125
votes
8
answers
95k
views
How to resolve "You need to have Ruby and Sass installed and in your PATH for this task to work" Warning?
I am in the process of setting up a new Mac for work. I have installed Grunt & Grunt CLI globally. Then I did a npm install inside a project folder to install all dependencies.
No problems so ...
118
votes
6
answers
161k
views
Make python3 as my default python on Mac
What I'm trying to do here is to make python3 as my default python. Except the python 2.7 which automatically installed on mac, I installed python3 with homebrew. This is the website that I'm ...
113
votes
5
answers
94k
views
See what process is accessing a file in Mac OS X
Note: This quesiton is NOT show me which files are in use. The file is not currently in use. The file will be in use at some unknown point in the future. At that point, I want to know what process ...
113
votes
10
answers
643k
views
How to run Python script on terminal?
I want to run a Python script in Terminal, but I don't know how? I already have a saved file called gameover.py in the directory "/User/luca/Documents/python".
111
votes
10
answers
195k
views
How to remove entry from $PATH on mac
I was trying to install Sencha Touch SDK tools 2.0.0 but could not run it properly. It created an entry in the $PATH variable.
Later I deleted the sencha sdk tools folder but didn't realize that the ...
111
votes
1
answer
44k
views
I want to disable beep sound in Terminal - Mac OSX [closed]
I want to disable beep sound in terminal. Im not able to find an option to disable the beep sound in preferences. Could you please help me out?
-cherryhitech
110
votes
1
answer
92k
views
curl json post request via terminal to a rails app
I'm trying to create a user on my rails app with a curl command from os x terminal. No matter how I format the data, the app returns a responses that non of my validations have passed.
curl http://...
108
votes
8
answers
105k
views
PostgreSQL server won't stop
Having a bit of an issue with PostgreSQL on Mac OS X 10.8.4. I accidentally did brew rm postgresql --force while the postgres server was running. When I installed using brew install postgresql and ran ...