New answers tagged

1 vote

How to execute zsh script at logon which output will be visible in the terminal window?

To prevent zsh from reading any other startup file, except for /etc/zshenv, change the shebang in your script to- #! /bin/zsh -f The -f option is equivalent to the NO_RCS option.
fd0's user avatar
  • 10.5k
0 votes

macOS Terminal not using correct manpath

In my use case, Terminal Open man Page was not working for 3rd-party software on Apple ARM-based macOS Ventura. e.g., Homebrew, MacTeX. Also, the x-man-page:// URI Scheme for Terminal.app was not ...
marc-medley's user avatar
1 vote

Why doesn't the screen command source my .profile?

Add this line to your ~/.screenrc: shell -$SHELL As per here This ensures screen interprets your bash invocation as a login shell, and will source your ~/.bash_profile.
DryLabRebel's user avatar
4 votes

Avoid changes to /etc/pam.d/sudo across macOS updates?

macOS Sonoma adds an include for sudo_local to the top of /etc/pam.d/sudo: # sudo: auth account password session auth include sudo_local auth sufficient pam_smartcard.so auth ...
Aaron's user avatar
  • 41
1 vote
Accepted

Avoid changes to /etc/pam.d/sudo across macOS updates?

Q: "How do I prevent that from happening?" You can prevent Apple's Updates from performing a "reset to default" with the chflags command. Open a terminal, and make the following ...
Seamus's user avatar
  • 4,212
1 vote

Directories listed in /etc/synthetic.conf not accessible via the link

Below is an example of how to create the symbolic link /All fonts which points to the folder /Users/jamesoconnor/All fonts. Note: Any previous entries in the /etc/synthetic.conf file will be removed. ...
David Anderson's user avatar
0 votes

default Nano Editor in MacOS is scrambling text display, not displaying text correctly with both bash and zsh. How to debug and fix?

I have solved it similar way as @acody suggest but with GUI (mac os 11.7.9 Big Sur): open terminal -> profiles -> advanced and find declare terminal as and choose vt100
Alex's user avatar
  • 111
0 votes

How to control Bluetooth wireless radio from the command line?

Solution for macOS 13 Ventura which does not require 3rd party utility: /usr/bin/defaults write /private/var/root/Library/Preferences/com.apple.BTServer.plist defaultPoweredState off /usr/bin/killall -...
qzyphus's user avatar
  • 386
0 votes

Removing uninstalled Command Line Tools from AppStore updates

Followed suggestion by @Alex user:429648 above, and that worked perfectly for me to stop system notifications to update Xcode Command Line Tools. The one additional thing needed to do was to disable ...
Seamus Berkeley's user avatar
0 votes

Is there a way to access a Mac's geolocation from terminal?

I know this is an old question, but it’s still the top result for getting location in terminal on Mac. None of the other options here work any more (they are not able to request permissions for ...
Eric Ferreira's user avatar
2 votes

Where is "mkpasswd" for OSX?

With openssl In macOS, it's very simple, using openssl which is a native already installed package (as mentioned in the apple article shared in @Tetsujin’s answer): I'm going here to explain how to ...
Mohamed Allal's user avatar
1 vote

Is there a `lsblk` equivalent for macOS that lists all attached storage devices?

Updated steps for macos ventura: to see the UUID of attached drives (including the Apple SDXC card reader): click the apple menu () -> About this mac -> More Info in the System Settings: ...
ccpizza's user avatar
  • 2,825
1 vote

Xcode command line tools uninstall not working

It looks like somehow the Xcode related settings has not been kept up-to-date along with the changes you have made on your computer. The following command to be issued through Terminal may help: sudo ...
Alper's user avatar
  • 3,731
1 vote
Accepted

Misleading diagnostic message

The command find /Users -name "Cami*x" -print > /tmptmp redirects its output to a file named tmptmp in the root. On current versions of macOS, the root is, in fact, a read-only file ...
Marc Wilson's user avatar
  • 5,328
1 vote

MacOs list package install via curl

You could grep your history for curl entries, but as others have mentioned, this won't give you any connection with what has been installed. Also, history typically has a fairly short retention ...
da4's user avatar
  • 5,431
7 votes

MacOs list package install via curl

No. You're not "installing via curl". You're using curl to download an installer, which you then run. In your two examples, you're downloading a shell script that you're then piping into ...
Marc Wilson's user avatar
  • 5,328
-1 votes

I would like to preempt a command on my mac (specifically, Keytool)

Thanks, Mr. Wilson. It wasn't preempting yesterday, but it is today (but so aggressively that it was going into a recursive tightloop). Once I fixed that, it seems to be working quite well (knock on ...
hbquikcomjamesl's user avatar
7 votes
Accepted

Which macOS version introduced "readlink -f"?

The earliest version where readlink -f appears in man pages is macOS Monterey 12.3. The following excerpts were taken from the stat.1 file for macOS 12.2. SYNOPSIS readlink [-n] [file ...] ...
David Anderson's user avatar
3 votes
Accepted

I would like to preempt a command on my mac (specifically, Keytool)

Certainly. Put the shell script in a directory that appears in your path before the keytool binary you are trying to preempt.
Marc Wilson's user avatar
  • 5,328
2 votes

pmset: Error 0xe00002bc

It appears that if I do sudo pmset repeat cancel it does delete all the power events. This solves my issue for now. 🤷‍♂️
nachocab's user avatar
  • 573
-1 votes

Convert SVG to PDF using command line in Mac OSX

Open the .svg with Safari and "File > Export as PDF..."
Michoumichmich's user avatar
0 votes

`tput setaf` inconsistency + fail (Ventura, Sonoma)

In the end I had to build upwards from scratch. I won't try to explain this code; GP4 will do a better job! There was a ${DIM} that was somehow getting RESET on the old system but not the new system. ...
P i's user avatar
  • 1,676
0 votes

iTerm - going one word backwards and forwards

For those how are interested this issue has the solution https://gitlab.com/gnachman/iterm2/-/issues/9806
Mauricio Vanzulli's user avatar
3 votes

How to pass file expansion patterns across an ssh/rsync connection

Anything using wildcards in zsh usually benefits from having quotes round it to pass the args along unmolested, unless the intention is to use zsh in all its glory. Otherwise zsh tries to expand the ...
Andy Griffiths's user avatar

Top 50 recent answers are included