Questions tagged [macos]
macOS (formerly known as OS X or Mac OS X) is the desktop operating system from Apple, found on Macintosh computers. Use this tag only if your question relates to using macOS APIs or macOS-specific behavior, not because you happen to run your code on macOS. Questions relating to using or troubleshooting macOS are off-topic and belong in the Ask Different community instead.
macos
117,988
questions
267
votes
10
answers
114k
views
`date` command on OS X doesn't have ISO 8601 `-I` option?
In a Bash script, I want to print the current datetime in ISO 8601 format (preferably UTC), and it seems that this should be as simple as date -I:
http://ss64.com/bash/date.html
But this doesn't ...
264
votes
27
answers
587k
views
Setting the MySQL root user password on OS X
I just installed MySQL on Mac OS X. The next step was setting the root user password, so I did this next:
Launch the terminal app to access the Unix command line.
Under the Unix prompt I executed ...
263
votes
16
answers
198k
views
Mac zip compress without __MACOSX folder?
When I compress files with the built in zip compressor in Mac OSX, it causes an extra folder titled "__MACOSX" to be created in the extracted zip.
Can I adjust my settings to keep this ...
263
votes
15
answers
549k
views
Setting PATH environment variable in OSX permanently
I have read several answers on how to set environment variables on OSX permanently.
First, I tried this, How to permanently set $PATH on Linux/Unix but I had an error message saying no such file and ...
262
votes
20
answers
162k
views
Getting the difference between two Dates (months/days/hours/minutes/seconds) in Swift
I am trying to get the difference between the current date as NSDate() and a date from a PHP time(); call for example: NSDate(timeIntervalSinceReferenceDate: 1417147270). How do I go about getting the ...
262
votes
27
answers
124k
views
lose vim colorscheme in tmux mode
I'm running iterm2 and when I'm in tmux mode the colorscheme I have set in vim does not show up. Only the color scheme I've set in iterm. If I run vim from shell the colorscheme appears correct - its ...
262
votes
27
answers
362k
views
node and Error: EMFILE, too many open files
For some days I have searched for a working solution to an error
Error: EMFILE, too many open files
It seems that many people have the same problem. The usual answer involves increasing the number ...
260
votes
22
answers
603k
views
Could not install packages due to an EnvironmentError: [Errno 13]
In my MacOS Mojave terminal I wanted to install a python package with pip. At the end it says:
You are using pip version 10.0.1, however version 18.1 is available.
You should consider upgrading via ...
258
votes
24
answers
353k
views
How do you stop MySQL on a Mac OS install?
I installed MySQL via MacPorts. What is the command I need to stop the server (I need to test how my application behave when MySQL is dead)?
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).
257
votes
26
answers
394k
views
Force DOM redraw/refresh on Chrome/Mac
Every once in a while, Chrome will render perfectly valid HTML/CSS incorrectly or not at all. Digging in through the DOM inspector is often enough to get it to realize the error of its ways and ...
254
votes
22
answers
277k
views
How can I use xargs to copy files that have spaces and quotes in their names?
I'm trying to copy a bunch of files below a directory and a number of the files have spaces and single-quotes in their names. When I try to string together find and grep with xargs, I get the ...
252
votes
11
answers
65k
views
MobileDevice.pkg untrusted, cannot open Xcode after OS X update
After an automatic update of macOS v10.15 (Catalina), I am unable to open Xcode. Xcode prompts me to install additional components but the installation fails because of MobileDevice.pkg (Applications/...
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?
251
votes
26
answers
123k
views
Broken references in Virtualenvs
I recently installed a bunch of dotfiles on my Mac along with some other applications (I changed to iTerm instead of Terminal, and Sublime as my default text editor) but ever since, all my virtual ...
248
votes
19
answers
505k
views
Why does cURL return error "(23) Failed writing body"?
It works ok as a single tool:
curl "someURL"
curl -o - "someURL"
but it doesn't work in a pipeline:
curl "someURL" | tr -d '\n'
curl -o - "someURL" | tr -d '\n'
it returns:
(23) Failed writing ...
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 ...
246
votes
14
answers
100k
views
error while build iOS app in Xcode : Sandbox: rsync.samba (13105) deny(1) file-write-create, Flutter failed to write to a file
while building iOS app on Xcode I got these 2 errors, I tried to build the iOS on visual studio code and I got the same errors. the operating system macOS 14.0 beta. processor M1 Pro
Could ...
244
votes
25
answers
110k
views
Cannot install Lxml on Mac OS X 10.9
I want to install Lxml so I can then install Scrapy.
When I updated my Mac today it wouldn't let me reinstall lxml, I get the following error:
In file included from src/lxml/lxml.etree.c:314:
/private/...
244
votes
4
answers
144k
views
What is the difference between MacVim and regular Vim? [closed]
I'm reasonably new to OS X, but I'm familiar with Vim from using it in various *nix systems. I've seen many people recommend running MacVim over Vim in the terminal. Can anyone tell me what ...
244
votes
9
answers
354k
views
Testing web application on Mac/Safari when I don't own a Mac [closed]
Having been caught out recently when a web site I launched displayed perfectly on IE, Firefox, Chrome and Safari on Windows but was corrupted when viewed using Safari on the Mac (by a potential ...
242
votes
24
answers
124k
views
Focus-follows-mouse (plus auto-raise) on Mac OS X
(I don't want to hear about how crazy I am to want that! :)
Focus-follows-mouse is also known as point-to-focus, pointer focus, and (in some implementations) sloppy focus. [Add other terms that will ...
241
votes
25
answers
109k
views
Easy way to see saved NSUserDefaults?
Is there a way to see what's been saved to NSUserDefaults directly? I'd like to see if my data saved correctly.
241
votes
5
answers
237k
views
Install / upgrade gradle on Mac OS X
How do I install/upgrade gradle for Mac?
240
votes
16
answers
629k
views
How to start MySQL server from command line on Mac OS Lion?
I installed mySQL on my Mac. Beside starting the SQL server with mySQL.prefPane tool installed in System Preferences, I want to know the instructions to start from command-line.
I do as follows:
After
...
240
votes
16
answers
361k
views
M1 docker preview and keycloak 'image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8)' Issue
I just downloaded Docker Preview v3.1 https://docs.docker.com/docker-for-mac/apple-m1/ and tried running keycloak.
Anyone else running into this issue?
docker run -p 8080:8080 -e KEYCLOAK_USER=admin -...
240
votes
16
answers
130k
views
How to send data to local clipboard from a remote SSH session
Most Unix-like systems have a command that will let you pipe/redirect output to the local clipboard/pasteboard, and retrieve from same. On OS X, these commands are
pbcopy, pbpaste
Is there a way to ...
239
votes
13
answers
138k
views
Where is /var/lib/docker on Mac/OS X
I´m looking for the folder /var/lib/docker on my Mac after installing docker for Mac.
With docker info I get
Containers: 5
...
Server Version: 1.12.0-rc4
Storage Driver: aufs
...
239
votes
5
answers
42k
views
What kind of leaks does automatic reference counting in Objective-C not prevent or minimize?
In the Mac and iOS platforms, memory leaks are often caused by unreleased pointers. Traditionally, it has always been of utmost importance to check your allocs, copies and retains to make sure each ...
238
votes
16
answers
143k
views
Finding current executable's path without /proc/self/exe
It seems to me that Linux has it easy with /proc/self/exe. But I'd like to know if there is a convenient way to find the current application's directory in C/C++ with cross-platform interfaces. I've ...
237
votes
15
answers
137k
views
"ERROR:root:code for hash md5 was not found" when using any hg mercurial commands
When trying to use any hg Mercurial commands on the console, I keep getting this error.
I installed Python using Homebrew and I am running Mac OS Catalina v. 10.15.1.
Any reference would be ...
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 ...
237
votes
34
answers
459k
views
Location of my.cnf file on macOS
I'm trying to follow along this tutorial to enable remote access to MySQL. The problem is, where should my.cnf file be located? I'm using Mac OS X Lion.
237
votes
10
answers
188k
views
How do you see the entire command history in interactive Python?
I'm working on the default python interpreter on Mac OS X, and I Cmd+K (cleared) my earlier commands. I can go through them one by one using the arrow keys. But is there an option like the --history ...
237
votes
10
answers
155k
views
What is the recommended way to install Node.js, nvm and npm on MacOS X?
I am trying to use Homebrew as much as possible. What's the recommended way to install Node.js, nvm and npm on MacOS X?
236
votes
28
answers
143k
views
How to copy a selection to the OS X clipboard
I have an area selected in Vim. How can I copy it into the OS X clipboard?
(The OS X clipboard can be written to via a pipe to /usr/bin/pbcopy)
236
votes
7
answers
79k
views
Linux equivalent of the Mac OS X "open" command [closed]
I've found the "open" command in Mac OS X very handy in the command line. From "man open":
The open command opens a file (or a directory or URL), just as if you had
double-clicked the file's ...
234
votes
7
answers
185k
views
Installing R on Mac - Warning messages: Setting LC_CTYPE failed, using "C"
I would like install R on my laptop Mac OS X version 10.7.3
I downloaded the last version and I double click on it and it was installed, when i start up I get the following error, I searched in ...
234
votes
15
answers
121k
views
How do I create a nice-looking DMG for Mac OS X using command-line tools?
I need to create a nice installer for a Mac application. I want it to be a disk image (DMG), with a predefined size, layout and background image.
I need to do this programmatically in a script, to be ...
231
votes
9
answers
245k
views
Why am I getting "Permission denied" when activating a venv?
I just started a new python project and created a venv inside the project folder by running virtualenv venv in the terminal. However, when I run venv/bin/activate I get a permission denied error.
I ...
230
votes
6
answers
215k
views
Delete .DS_STORE files in current folder and all subfolders from command line on Mac [duplicate]
I understand I can use find . -name ".DS_Store" to find all the .DS_Store files in the current folder and all subfolders. But how could I delete them from command line simultaneously? I found it's ...
230
votes
16
answers
275k
views
How do you uninstall MySQL from Mac OS X?
I accidentally installed the PowerPC version of MySQL on my Intel Mac in Snow Leopard, and it installed without a problem but of course doesn't run properly. I just didn't pay enough attention. Now ...
228
votes
23
answers
480k
views
Reset MySQL root password using ALTER USER statement after install on Mac
I recently installed MySQL and it seems I have to reset the password after install. It won't let me do anything else.
Now I already reset the password the usual way:
update user set password = ...
228
votes
5
answers
324k
views
How to easily install and uninstall docker on MacOs
My question is
How to easily install docker to have it available in terminal and how to uninstall docker on osx?
224
votes
9
answers
188k
views
Where can I find "make" program for Mac OS X Lion?
Just upgraded my computer to Mac OS X Lion and went to terminal and typed "make" but it says:
-bash: make: command not found
Where did the "make" command go?
224
votes
22
answers
204k
views
How to remove all subviews of a view in Swift?
I'm looking for a simple method to remove at once all subviews from a superview instead of removing them one by one.
//I'm trying something like this, but is not working
let theSubviews : Array = ...
224
votes
22
answers
974k
views
How to change default Python version?
I have installed Python 3.2 on my Mac. After I run /Applications/Python 3.2/Update Shell Profile.command, it's confusing that when I type python -V in Terminal, it says Python 2.6.1 which is not what ...
224
votes
14
answers
510k
views
How to uninstall Anaconda completely from macOS
How can I completely uninstall Anaconda from MacOS Sierra and revert back to the original Python? I have tried using conda-clean -yes but that doesn't work. I also remove the stuff in ~/.bash_profile ...
222
votes
16
answers
105k
views
Making iTerm to translate 'meta-key' in the same way as in other OSes
In bash shell with emacs key-binding, you can use key combination like M-f, M-b to move one word forward or backward on the shell prompt respectively. Usually, the meta key is mapped to Alt key on ...
222
votes
2
answers
44k
views
Warning the user/local/mysql/data directory is not owned by the mysql user
I can't start the mysql service in Snow Leopard, and in the panel prefs appears the message,
warning the user/local/mysql/data directory is not owned by the mysql user
How can I fix this?