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
9 views

wget - How to create local subdirectories when using ‘-P prefix’ ‘--directory-prefix=prefix’?

I have added --directory-prefix=~/Downloads in ~/.wgetrc Looking through the manual for wget I am having trouble understanding how to pass a local subdirectory on the command line that would amend the ...
user avatar
  • 737
1 vote
1 answer
34 views

How can the availability of SetFile and GetFileInfo be detected without causing user interaction? Where are Commandline Developer Tools installed?

In bash, to detect whether a command COMMAND is available, the following statement shall be executed. (Note that I configured bash to be the default shell, instead of zsh.) type COMMAND... For ...
user avatar
0 votes
0 answers
20 views

Cannot run shell script from mounted network share: unidentified developer

We have a few shared shell scripts on our file server, and would like them to run in Terminal when double-clicked in the Finder. The share is mounted, and the scripts do run when called by their full ...
user avatar
  • 865
-1 votes
0 answers
27 views

Can't find etc/hosts on my my level

So I'm troubleshooting my Mac right now to try and find out what is happening and why I can't connect. First place I go to check is my etc/hosts/ and I pull it up on Terminal and find its empty. I use ...
user avatar
0 votes
3 answers
56 views

zsh/bash string to array not working using parentheses

Do you know why the following is not converting string into array? STR="one two three" array=("$STR") echo "${array[@]}" # prints: one two three echo "len: $...
user avatar
  • 181
0 votes
1 answer
56 views

Cannot `ls` or `cd` on external drive

I have an external drive. When I cd /Volume/My Book Thunderbolt Duo and try to do ls, I get an "operation not permitted" error. The drive shows in Finder just fine.
user avatar
  • 1,292
1 vote
1 answer
47 views

How to launch docker container from CLI in MacOS (eg `docker run ...`)?

How can I launch a docker container from the command-line in MacOS? In Debian Linux, I can execute the following commands to install docker, launch a new docker container based on the latest version ...
user avatar
0 votes
1 answer
24 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 ...
user avatar
0 votes
0 answers
32 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. ...
user avatar
  • 101
0 votes
2 answers
23 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 ...
user avatar
  • 297
0 votes
1 answer
53 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. ...
user avatar
  • 99
3 votes
1 answer
75 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 ...
user avatar
  • 131
4 votes
0 answers
99 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 ...
user avatar
  • 41
0 votes
0 answers
18 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 ...
user avatar
  • 211
0 votes
0 answers
22 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: % ...
user avatar
  • 584
2 votes
3 answers
724 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....
user avatar
0 votes
3 answers
75 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 ...
user avatar
0 votes
0 answers
24 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 ...
user avatar
2 votes
2 answers
65 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 ...
user avatar
  • 51
0 votes
0 answers
13 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), ...
user avatar
0 votes
1 answer
34 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?
user avatar
  • 3,407
2 votes
0 answers
38 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 ...
user avatar
  • 267
0 votes
0 answers
28 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 ...
user avatar
  • 11
1 vote
1 answer
23 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 ...
user avatar
  • 11
0 votes
2 answers
40 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 ...
user avatar
  • 13
0 votes
1 answer
52 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 ...
user avatar
1 vote
0 answers
15 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....
user avatar
  • 659
0 votes
1 answer
29 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 -...
user avatar
  • 195
1 vote
1 answer
61 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 ...
user avatar
  • 4,722
0 votes
1 answer
41 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 ...
user avatar
4 votes
1 answer
44 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 ...
user avatar
1 vote
1 answer
295 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. ...
user avatar
0 votes
0 answers
551 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 ...
user avatar
  • 101
0 votes
0 answers
67 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: ...
user avatar
0 votes
2 answers
41 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 ...
user avatar
  • 41
0 votes
0 answers
33 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 ...
user avatar
  • 101
1 vote
1 answer
28 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. ...
user avatar
  • 4,722
0 votes
0 answers
24 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 ...
user avatar
1 vote
1 answer
70 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 key on an Apple machine: the other shortcuts having it can be used with the Ctrl key : ^O Write Out ^W Where Is ...
user avatar
  • 229
0 votes
0 answers
25 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 ...
user avatar
0 votes
1 answer
85 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 ...
user avatar
5 votes
2 answers
184 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 ...
user avatar
2 votes
1 answer
70 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 ...
user avatar
  • 840
1 vote
2 answers
71 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 ...
user avatar
  • 21
1 vote
1 answer
129 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 ...
user avatar
0 votes
0 answers
43 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....
user avatar
  • 284
0 votes
2 answers
75 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 ...
user avatar
  • 1,453
1 vote
0 answers
29 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 ...
user avatar
  • 11
0 votes
1 answer
21 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&...
user avatar
0 votes
1 answer
52 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 ...
user avatar

1
2 3 4 5
56