Questions tagged [command-line]

Using programs and commands that do not have a graphical user interface (GUI) but are rather controlled by typing text commands into a terminal program, or shell.

Filter by
Sorted by
Tagged with
0 votes
1 answer
295 views

Load SMB path in finder via command line

I have an SMB path that I need to browse to in the finder. I used to do this all the time with the following: open smb://path/to/directory I just updated to Big Sur and now every time I do this, I ...
0 votes
0 answers
568 views

How do I force install updates that `softwareupdate -l` doesn't show (but should)?

(16in 2019 Intel MBP, 12.3.1) So I'm trying to apply software updates that should get me from 12.3.1 to 12.5, and am well past the stage of trying to get the system Software Update tool to apply them. ...
  • 101
0 votes
2 answers
227 views

Using terminal (ie, zsh), I want to run a certain shell command, every time, any file in a given folder is saved/added [duplicate]

Hence, in a certain folder, say ~/Desktop/foo, any time a file/subfile/folder is touched (added, saved), I want to just run a certain command in the shell. Is there a way to do this, either with a zsh ...
  • 171
0 votes
1 answer
656 views

`sudo passwd` asking for old password / reset recovery key

I'm an admin on my Mac (macOS Montrey 12.5), but forgot my own password. I can login remotely from another machine (SSH key based auth), and I have sudo configured with NOPASSWD for the admin group. ...
  • 99
4 votes
1 answer
308 views

As of macOS Big Sur, how do you see generator used by Quick Look?

Before macOS Big Sur, qlmanage -p by itself or qlmanage -p -d debugLevel showed which Quick Look generator was used for a given file. Now, no such info appears. The man page for qlmanage also changed ...
  • 151
4 votes
0 answers
120 views

Unable to SSH to other servers after Monterey 12.5 upgrade [duplicate]

For some reason ssh connections from my computer to other devices do not seem to work after OSx upgrade, have already restarted it, shut down, started it back up. Do not see anything being blocked ...
  • 41
1 vote
0 answers
354 views

How to build .xcodeproj files with the Command Line Tools Package when xcodebuild doesn't work?

For the purposes of automated testing, I'm looking to build an XCode project file from the command line on a headless Mac (which I believe is running Monterey). The machine I'm hoping to build things ...
  • 231
0 votes
0 answers
55 views

How do I get rid of superfluous outdated software updates?

I have updated to macOS Monterey 12.5 and Xcode 13.4.1 and installed the CLI tools for Xcode 13.4.1. But Software Update keeps telling me to update the command line tools for 13.2 13.3 and 13.4: % ...
  • 634
2 votes
3 answers
798 views

crontab doesn't seem to recognize `~`

Has anybody noticed that crontab doesnt seem to recognize ~ to mean the home directory? I tried using a full expansion of /Users/username/filename.txt in crontab, which worked, but using ~/filename....
0 votes
3 answers
340 views

List folders with size and number of files

I'm trying to clean up my files and I'm struggling with some command line stuff. With the command du -sh * I can get a nice list of all folders where I use the command. How can I also get the number ...
0 votes
1 answer
122 views

Mu fails to install and Mu4e fails to start: /usr/local/opt/emacs not present or broken

I upgraded mu and emacs and now mu4e stopped working. I removed Emacs with: brew uninstall --force emacs brew uninstall --force homebrew/cask/emacs and mu with: brew uninstall mu Then I installed ...
4 votes
2 answers
3k views

Send email from command line (macOS Monterey 12.3)

I'm trying to send an email from the command line but it does not work: echo "Hello World" | mail -s "Test email" someone@example.com Years ago "it just worked" because ...
  • 81
0 votes
0 answers
77 views

Is there a way to detect if Universal Control is currently connected?

I have a machine that is sometimes connected to one secondary Mac using Universal Control, and sometimes another. I've been doing some automation around Lock/Screensaver events (using EventScripts), ...
1 vote
2 answers
110 views

When i press "CTRL + C" at "caffeinate -i" I get a non 0 exit status. Why?

If I press CTRL + C at caffeinate -i I have a non 0 exit status. My terminal prompt shows me with red x that the previous command had a not 0 exist status. Why is that?
  • 3,625
2 votes
0 answers
46 views

In Terminal, how do I access the hyperlink in hyperlinked text stored in the clipboard?

If I copy some text containing a hyperlink and then paste into another application that accepts it, then the text and its hyperlink is correctly copied over. How can I access this hyperlink via the ...
  • 297
0 votes
0 answers
73 views

Can macOS adjust gamma from the command line in terminal.app?

I searched and could not find any easy way to adjust gamma without going through a bunch of preference pages. I just want to be able to adjust gamma easily through terminal if possible. I know there ...
  • 11
1 vote
1 answer
83 views

Is it permissible to use the Xcode 3.0 DeRez and Rez command line tools for purposes other than localization?

I have an Apple Mac that has Mac OS X 10.5.8. On this Mac, Xcode version 3.0 is installed. From what I can tell, there are also the DeRez and Rez command line tools. The Xcode software may have been ...
0 votes
1 answer
603 views

Run Xcode Hello World from Command Line

I have installed Xcode and created the Command Line Tool project for "Hello, World!". I can run it from Xcode when I click the little play button. But how can I run this program from a ...
  • 53
1 vote
1 answer
844 views

What exactly are the Serial Ports listed and why don't they have a "normal" numbering scheme?

In Mac one can list their serial ports using ls /dev/tty.* As per: https://stackoverflow.com/questions/3815211/mac-command-line-list-available-serial-ports But something that baffles me when I do ...
1 vote
0 answers
45 views

How to see and modify the list of user-selected files and directories that a sandboxed app has access to?

I downloaded an app from the MacOS app store. Using codesign, I can see that the app has a number of entitlements including: com.apple.security.files.user-selected.read-write; and com.apple.security....
  • 709
1 vote
1 answer
470 views

xcodebuild ignoring(?) -allowProvisioningUpdates flag

I'm trying to build my iOS app from command line (macOS 12.0.1, XCode command line tools 13.4.0.0.1.1651278267). To do this, I run following command: xcodebuild -workspace Unity-iPhone.xcworkspace -...
  • 205
1 vote
1 answer
75 views

How to move/copy/process files based upon any extended attributes in Terminal/shell?

I need to move a number of files based on various extended attributes, but it's not clear how to test and take action based on these. For a basic example, what if I were to want to find and move all ...
  • 5,032
0 votes
2 answers
286 views

After upgrade to Monterey, a user-created launchd job does not run

I have a launchd job that is supposed to run a php script at 6am every day. The script runs a number of backup-related tasks. After upgrading to Monterey, the task no longer starts at its scheduled ...
4 votes
1 answer
332 views

Should I install all versions of Xcode CL tools update? [duplicate]

I got a prompt to install updates. MacOS 12.4 I don't have XCode installed just the XCode command line tools, version: 13.0.0.0.1.1627064638 All these updates seem to be different versions of the ...
1 vote
1 answer
660 views

View macOS login password without resetting it through shell

I was wondering if I could view the macOS login password through shell without resetting the password. I rebooted my Mac and did Cmd+S and went through some .plist files but couldn't find anything. ...
0 votes
0 answers
3k views

zsh: command not found: node in vscode ( MAC OS )

I have installed node LTS (16.15.1) version in my mac machine using brew and nvm. Following these steps : How To Install NVM on macOS with Homebrew I'm able see node and npm version in terminal, but ...
  • 101
0 votes
0 answers
313 views

Installing phpMyAdmin in OSX using brew

I am trying to install phpMyAdmin in OSX using brew and I get this error. How should I fix it? ~/Downloads  git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core fetch --unshallow remote: ...
0 votes
2 answers
55 views

Fetch data from Preview.app to Terminal

I want to be able to get all the pdf files currently opened by my Preview app into Terminal. The idea is, I want to be able to feed the output to a text file for future reference. My use case may be ...
  • 41
0 votes
0 answers
224 views

Can I create access control entries for macos apps in /System/Applications?

I am trying to set user-specific access to certain apps and folders on a mac, and I found this answer to be extremely helpful. (Thanks @Gordon Davisson!) However, I can't seem to run the chmod ...
  • 101
1 vote
1 answer
65 views

How to poll an app / process CPU utilization levels with fine granularity in Terminal?

I have a particularly problematic process in macOS that has a CPU utilization of 50-100% rather consistently. The process seems to have a somewhat high variability depending on several variables. ...
  • 5,032
0 votes
0 answers
54 views

Script executed when application Bluestacks is deleted from Trash

I just noticed something interesting when uninstalling Bluestacks on MacOS Monterey. I dragged the app to the trash and when I clicked empty trash, there was a prompt to allow to run a sh script. I ...
1 vote
2 answers
1k views

How to go to a specific line in nano on macOS?

nano shows the shortcut as ^/ Go To Line. It seems that ^ stands for the Ctrl on an Apple machine: the other shortcuts having it can be used with Ctrl: ^O Write Out ^W Where Is ^K Cut ...
  • 259
0 votes
0 answers
26 views

Terminal window has a weird description [duplicate]

Hello, as you can see my terminal window description is really weird. 2 days ago my terminal was still called "myname@LauentiusMacbook" or something. Do you guys know how to fix this or/ and ...
0 votes
1 answer
415 views

What is the terminal command to set menu bar items and screenshot location in Monterey?

these commands dont work anymore in mac os 12.x defaults write com.apple.screencapture location -string "$HOME/Pictures/Screenshots" defaults write com.apple.systemuiserver ...
7 votes
3 answers
717 views

How to restore an individual file from Time Machine using CLI (MacOS)

How can I restore a single file from an old Time Machine backup using only the Command Line Interface? I took a snapshot of my MacOS system using Time Machine some time ago, and I'd like to restore ...
2 votes
1 answer
180 views

Using Terminal commands, how can I find the application associated with a given file?

Basically, what is the equivalent to what_is_associated call_diagram.dot.svg which would return some "pointer" back to the Vivaldi app on my system. See below for what does the job ...
  • 931
1 vote
2 answers
322 views

list of characters that have to be escaped in passwords for "mount -t smbfs //username:password@..."

I am trying to mount a share with the macOS CLI using zsh as my shell. mount -t smbfs //user:password@host/share /share Mounting the share without specifying the password works. But then I have to ...
  • 21
1 vote
1 answer
848 views

how can I copy paths in the $PATH environment from bash to zsh?

How can I copy all the the command paths from the bash environment $PATH variable to the zsh environment? I'm on macOS 11.6.1 (and about to install 11.6.6). Many of the commands I used in bash don't ...
0 votes
0 answers
197 views

iTunes - CLI AppleMobileBackup

I'm trying to use command line to backup my device with iTunes. I found this script: https://nerd.one/how-to-automate-daily-encrypted-iphone-backups-in-itunes/ issue: that it can't do multiple devices....
  • 294
0 votes
2 answers
285 views

What does sips --man option do

sips, or “scriptable image processing system” is a command-line tool shipping by default with macOS which allows basic image manipulation (think ImageMagick but not as powerful). I found something odd ...
  • 1,543
1 vote
0 answers
150 views

How to completely deactivate the TouchID button on 2018 Intel MacBook Pro

I recently had an issue involving liquid poured over the top right corner of my keyboard, thus going under the TouchID button. Since then, at random times, my MacBook auto-locks itself and then shuts ...
  • 11
0 votes
1 answer
67 views

Setting reminder due date takes too long in AppleScript

Maybe someone can explain why is that like this and how to speed things up # this is for some reason is pretty slow and takes >=11s to execute osascript << EOF tell app "Reminders&...
0 votes
1 answer
479 views

Catalina equivalent to systemctl status?

I'm trying to wrap my head around launchctl. I need to run the MacOS equivalent of systemctl status zabbix-agent I am trying with launchctl print com.zabbix.zabbix_agentd but I get: Unrecognized ...
1 vote
1 answer
704 views

Homebrew won't install from casks

I've just wiped & reinstalled my M1 Macbook Pro (Monterey 12.4), and at some point during setup Homebrew has stopped working when installing from cask - the download completes, then nothing. It ...
  • 121
0 votes
0 answers
114 views

How to pass command line options to Google Chrome App / Shortcut?

I have created a Chrome Shortcut following this answer: https://apple.stackexchange.com/a/329655/460176 Now I want the app to open in full-screen mode every time I launch it. I know I can open the app'...
0 votes
0 answers
25 views

Change the contents of a file based on time of the day

On macOS, I have a Config file for a PDF viewer application, Sioyek that lets me change the background and text colours through a custom configuration combination. However, the app only allows one ...
2 votes
1 answer
5k views

Recommended way to install Java with brew (just to run Java apps without a development environment)

I saw today: brew install --cask ripme ==> Caveats ripme requires Java 8+. You can install the latest version with: brew install --cask temurin There are so many brew packages for Java, I don't ...
  • 3,625
3 votes
0 answers
441 views

What path is needed to run homebrew cask installed apps from the command line?

I installed Thunderbird using homebrew cask. I am using Intel Processor. /Applications/Thunderbird.app/Contents/MacOS/thunderbird -whatever How can I use the command line options of thunderbird on ...
  • 131
0 votes
0 answers
214 views

Set QoS for command-line tools

I’ve finally got hold of a new Mac Studio with an M1 Ultra SoC, which I will stress mostly with scientific software run from the command line. Some of it is compiled C/C++ (often using multitasking ...
1 vote
0 answers
387 views

using xargs with mv

So, I'm trying to move all screenshots files I found on my Desktop to a specific folder. /Users/me/Desktop/Screenshot 2022-04-30 at 19.19.56.png /Users/me/Desktop/Screenshot 2022-05-04 at 23.01.25.png ...

1 2 3
4
5
59