6

Spotlight allows this and is my favored tool, despite how painful it is to learn how to do this from Apple's documentation alone. The man page for mdfind is almost criminally negligent for not mentioning how to search for a string, but I shall not rant too much more on that here. mdfind 'kMDItemTextContent = "this exact string"' Pay attention to the double ...


4

I know that Todd said that it wasn't smart to do this, but I went to the opensource sudoers file from apple and copied that into my sudoers file, now sudo is working just fine!


3

It might be easier to use tools dedictated for searching text within files, e.g. grep (part of macOS) or ag (brew install ag): fgrep -r "Text to match" PATH ag -F "Text to match" PATH


3

Boot to recovery mode Open Terminal (menubar > Utilities > Terminal) cd to your system data volume: cd /Volumes/Macintosh\ HD\ -\ Data/private/etc/ (In system 10.14 and lower this is /Volumes/Macintosh\ HD/private/etc/) Download a default macOS sudoers file (e.g. from an online repository) curl -LJO https://gist.githubusercontent.com/keith/9061156/raw/...


2

To share history between sessions, you need to use the SHARE_HISTORY option. Additionally, you will want to append, rather than overwrite your history file. setopt SHARE_HISTORY setopt APPEND_HISTORY Per the ZSH documentation (Chap. 16 - Options) you should also disable INC_APPEND_HISTORY. This option both imports new commands from the history file, ...


2

Just symlink to /usr/local/opt/macvim/MacVim.app instead, this path remains stable (/usr/local/opt/macvim is a symlink maintained by HomeBrew which points to the currently installed version within /usr/local/Cellar/macvim).


1

If it is meant for command line use, you should type all the required info in the command line. For more help, run these two commands in Terminal app. cd ~/Downloads/sonic-annotator-1.5-osx-amd64 ./sonic-annotator --help https://unix.stackexchange.com/questions/397524/what-does-the-mean-dot-slash-in-linux/397528#397528 https://unix.stackexchange.com/a/4432/...


1

macOS now uses the pf firewall (from OpenBSD). Since Mac OS X Lion (10.7) circa 2012, the firewall ipfw was deprecated in favor of pf The command to disable the pf firewall is: % sudo pfctl -d For full command line options for pfctl see man pfctl.


1

There’s not much documentation available, but these are the basics: agrCtlRSSI - Signal strength. The higher, the better. agrCtlNoise - Noise level. The lower the better. state - operating state (running or not) op mode - station or repeater lastTxRate - last rate of transmission speed maxRate 867 - maximum transmission rate 802.11 auth - authentication ...


1

Alas, it seems that either macOS has changed the format of .shadow files in a breaking way, or that my .shadow files are corrupted (hundreds of them) without any corruption to the DMGs themselves (hundreds of them, all with checksums that match). I'm going to guess it's the first option. Nonetheless, the usage message only shows when mounting with these ...


1

The homepage URL is a part of the output of brew info FORMULA, so you can run: brew info FORMULA | grep -E '^https?:' to extract just the link to the homepage. This also allows to run: open -a Firefox.app "$(brew info FORMULA | grep -E '^https?:')" to open the link in Firefox.app. The respective command-lines for Homebrew Cask are: brew cask info CASK |...


1

My best solution is the following (for bash shell) shopt -s dotglob for f in /* sudo gfind "$f" -path /System/Volumes/Data -prune -o -print 2>/dev/null done shopt -u dotglob where, in place of -print, one can use several other commands. The most part of files in /System/Volumes/Data are the same as in /, with few and not much interesting additions. ...


1

Okay, it's working now. /Users/myname/.zshrc is: export HOME='/Users/rcorty/Dropbox' and /Users/myname/Dropbox/.zshrc is: alias ll='ls -l'


1

One correct method seems to be: system_profiler SPAirPortDataType | awk '/PHY Mode:/ { print $3 ; exit }' The awk script (between ' ) means: on first expression 'PHY Mode:', print the third field and exit the script.


1

This only works with iTerm2, but I ended up using the following script I modified from one Stack Overflow that opens a new tab: #!/usr/bin/env bash osascript <<EOF tell application "iTerm" activate set win to create window with default profile tell current session of win select write text "vim '$1' &...


1

You just have to use single quotes. Otherwise it will run pwd when the aliases are loaded, not when you call it. https://unix.stackexchange.com/a/303675/282264 Example alias with pwd alias youtube-mp3='docker run --rm -i -t -v $PWD:/data vimagick/youtube-dl -x --audio-format mp3'


1

You can also use Hammerspoon to do this programmatically. I have this in my Hammerspoon init script: -- swap which is primary screen: external monitor or laptop hs.hotkey.bind({"cmd", "alt", "ctrl", "shift"}, "f11", function() -- allScreens seems to return the screens in order of primary, non-primary -- so with two screens, this always operates on the ...


1

You can run VLC to play a stream from the command line: /Applications/VLC.app/Contents/MacOS/VLC <address> For example this (address from here) will play BBC Radio 3: /Applications/VLC.app/Contents/MacOS/VLC http://a.files.bbci.co.uk/media/live/manifesto/audio/simulcast/hls/uk/sbr_high/ak/bbc_radio_three.m3u8 To stop playing, press or send Ctrl+C. ...


1

Git autocompletion on Catalina and newer (using Homebrew) macOs changed from bash to zsh as default shell starting with Catalina. So you will need specific autocomplete scripts for zsh. Here is how to install them with Homebrew: brew install zsh-completion Brew's zsh-completion does in fact include git-completion. To activate autocompletion you then ...


Only top voted, non community-wiki answers of a minimum length are eligible