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
0 answers
87 views

Change the dock color via the command line?

I'm using BigSur 11.7.5. I want to be able to change the color of the dock solely by means of a command-line utility. This way, I can programmatically change the dock's color in response to certain ...
HippoMan's user avatar
  • 348
0 votes
1 answer
145 views

Via the command line, attempt to dismiss the screen saver *only* if the screen saver is active

I'm running BigSur 11.7.5. I want to run some sort of command or script from the command line which will dismiss the screen saver, but only if the screen saver is active. If the screen saver is not ...
HippoMan's user avatar
  • 348
0 votes
1 answer
248 views

zsh alias doesn't always take arguments

I have the following aliases set in my zsh config: alias artisan='[ -f vendor/bin/sail ] && sail artisan || php artisan' alias sail='[ -f sail ] && bash sail || bash vendor/bin/sail' ...
tinyoverflow's user avatar
0 votes
0 answers
308 views

How to enable/disable DNS Settings from mobileconfig using command line?

I'm using DOH from https://github.com/paulmillr/encrypted-dns. This installs a mobile config profile. I can enable and disable the DNS Settings by going into Network, then Filters (image reference ...
bentinata's user avatar
  • 101
1 vote
1 answer
1k views

How to stop brew downloading the formula each time when using services command

When I am using this command in macOS 13.2 to check the postgresql status: ➜ ~ brew services status postgresql ==> Downloading https://formulae.brew.sh/api/formula.json ############# ...
Dolphin's user avatar
  • 1,091
0 votes
0 answers
780 views

Show / hide menu bar from command line on macOS Ventura

On macOS Ventura I can control the menu bar behaviour by going into system settings --> Desktop & Doc. It gives me four options for visibility: "Always", "On Desktop Only", &...
220284's user avatar
  • 273
0 votes
0 answers
73 views

Is there a way to access the man pages on my Mac 10.13.6 in a machine-readable format like JSON?

Is there a way to access the man pages on my Mac 10.13.6 in a machine-readable format like JSON? Someone like https://qr.ae/prxY74 recommended installing and using mandoc, but unlike what he mentioned ...
forgodsakehold's user avatar
2 votes
1 answer
250 views

GRAP pre-processor doesn't seem available for groff on macOS Monterey?

The groff language is a bit of a legacy UNIX program for generating post-script documents with graphics and all kinds of other handy text formatting. If you run it with the help option on macOS 12.5 ...
Micrified's user avatar
  • 227
0 votes
0 answers
118 views

Is there a way to trace syscalls without disabling SIP?

I'm trying to optimize a local Python script and I'd like to see syscalls etc. dtruss seems like a great tool for that, but I get a series of errors when I run it that I think are related to SIP being ...
Harv's user avatar
  • 6,500
0 votes
2 answers
249 views

How to get version of `/usr/bin/time` command on macOS?

I'm struggling to find out what version of /usr/bin/time I have, on my M1 macOS 13.2. /usr/bin/time seems to have no help beyond a usage string (that has options for help nor version). This is what I ...
Cornelius Roemer's user avatar
1 vote
0 answers
49 views

Obtain list of applications that can open a file via Terminal? [duplicate]

Anyway to obtain list of Application that can open a file via Terminal? offered a JavaScript which no longer works on macOS 13.1 Ventura. Has anyone updated this script or have a different one? #!/bin/...
B. Stackhouse's user avatar
0 votes
0 answers
35 views

Cron job keeps running unexpectedly. Works fine with current jobs, but repeats at other times

Super odd issue here. I have been using cron jobs for a few years and it has never given me any issues until now. Here is my cron job entries: #Start Kipros 54 8 * * 6 /Users/mediamac22/Desktop/...
lluc's user avatar
  • 161
2 votes
1 answer
411 views

What is the difference between the -d and -i flags in the caffeinate command?

The man page for the caffeinate command has the following for the two flags: -d Create an assertion to prevent the display from sleeping. -i Create an assertion to prevent the system from ...
T Hummus's user avatar
  • 121
0 votes
1 answer
613 views

Deleting a binary from the bin folder that attempts to open at startup in Mac Ventura 13.2.1

There is a binary named 'Open' that resides in my /usr/bin folder that I cannot delete. I have tried sudo rm open and even tried sudo su and then rm open and it fails because I cannot override the ...
user avatar
1 vote
2 answers
1k views

MacOS Command Line for Track Pad Settings

In Ventura MacOS, I am trying to use a command line script for affecting the trackpad settings. Specifically, in this case, I am trying to turn on tap-to-click. But I would also like to turn on ...
zeeple's user avatar
  • 1,659
1 vote
1 answer
302 views

Query whether MacBook is plugged or on battery from shell script

I am writing a shell script that I will leave running in background for some syncing tasks. I would like this script to behave differently depending on whether my MacBook is plugged to a power source, ...
a06e's user avatar
  • 263
1 vote
1 answer
182 views

Shell script to reboot from different volume

I have two installations of OSX (both Ventura) on my machine on two separate APFS volumes. I need to often switch between the two machines. I am only aware of the option to press and hold the power ...
Rahul's user avatar
  • 141
1 vote
2 answers
743 views

Help with osascript Command to Hide Login Item on MacOS Ventura

I'm attempting to use the following command in Terminal on MacOS 13.2.1 to add WebDrive.app to my login items hidden (or even just minimized) on MacOS, since there appears to be no way to do it with ...
aliahy's user avatar
  • 121
2 votes
1 answer
729 views

Equivalent to systemd timers on OS X?

On Linux, many distros ship with systemd. Systemd supports "timers", which are a kind of systemd service for running programs on a schedule. There are of course many ways of scheduling tasks,...
Dommondke's user avatar
  • 132
4 votes
4 answers
1k views

Terminal calculator like concalc from Ubuntu

Is there a terminal calculator for the Mac that's similar to concalc from Ubuntu? concalc allows you to calculate an expression by prefixing it with the tool name (more on the concalc man page) ...
tomrozb's user avatar
  • 143
0 votes
2 answers
507 views

Get purgeable space with diskutil CLI

With something like diskutil info /dev/disk1s1 among other things I can get my free space as follows: Container Free Space: 28.3 GB (28347076608 Bytes) (exactly 55365384 512-Byte-Units) The ...
mikeskk's user avatar
  • 101
0 votes
1 answer
100 views

zip: cannot use the -FF flag and -q flag at the same time

I am having trouble quietly zipping a large zip file which needs fixing. I have a large zip file that needs fixing so I can use -FF flag: zip -FF TEST.zip --out TEST_fixed.zip If I want to suppress ...
mqjg's user avatar
  • 1
0 votes
0 answers
298 views

How can I get pip3 to find my root certificate in macOS?

I am trying to use pip3 to install matplotlib. My company's root certificate is at ~/Documents/the-certificate-name.cer. The output is: myprompt % pip3 install matplotlib ERROR: Could not install ...
Rich006's user avatar
  • 123
1 vote
1 answer
68 views

How to save input of `less` to file as explained in the man doc?

I'm trying to save the piped input to less to a file as explained in the man doc: s filename Save the input to a file. This only works if the input is a pipe, not an ordinary file. However, ...
Cornelius Roemer's user avatar
1 vote
1 answer
337 views

Run a shell script having individual icon in dock

Target Run a command line tool or script displayed with a specific icon in dock. A terminal window should not be displayed. I would like to use this to start octave with its gui. What I tried ...
Georg W.'s user avatar
  • 113
2 votes
0 answers
2k views

zsh: exec format error in Ventura when running a bin file

I still use Snapz Pro as my main screen capture app. I recently upgraded both my M1 Mac Studio and my Intel iMac to Ventura. Because Ambrosia SW is no longer in business and has no website, the only ...
matrixbud's user avatar
  • 115
1 vote
1 answer
584 views

With oh-my-zsh, ls hides the group field instead of showing colors

I'm using Zsh on macOS Big Sur (11.7.4), and in my Terminal I am trying to look at ownership (user & group) of files in the current folder. I want to know the user as well as the group of my files ...
DanRan's user avatar
  • 670
0 votes
0 answers
10 views

ZSH prompt changes when accessing company WiFi [duplicate]

When I join company's WiFi my ZSH prompt changes from name_of_the_user@AirM2 ~ % (AirM2 is the name of the computer set in settings) To name_of_the_user@iPhone-Norbert ~ % What could be a reason for ...
Paweł Brewczynski's user avatar
4 votes
2 answers
1k views

Passing Text to Shortcut via Command Line Arguments

Problem I want to run a Shortcut from the command line and include Unicode text as a part of the command. I want to do something like: shortcuts run "My Notification Shortcut" "My Text ...
DaveL17's user avatar
  • 272
2 votes
0 answers
935 views

iCloud Drive sync stuck

I ran into the exact same problem like some other people here. After clean-installing Monterey to my two machines yesterday (MacPro 6.1 and a MacBook Pro 15" Late 2015) my iCloud Drive got stuck ...
12557's user avatar
  • 21
1 vote
1 answer
104 views

Number between brackets next to interface name

What is the number between brackets next to the interface name in ifconfig output? In the following output i.e. (17) en0 (17): inet address 192.168.4.5 EDIT As requested I add more info. I was ...
Walter's user avatar
  • 13
1 vote
1 answer
308 views

Can I use an APFS snapshot to generate a list of all files changed since an earlier point?

I just clean installed macOS on a new VM and now need to set it up with various preferences and stuff to customize it. What I am curious about is where all those customizations actually get stored. I ...
natevw's user avatar
  • 283
1 vote
1 answer
311 views

Using curl to download image, and copy to the PNG to the clipboard

I'm using curl and grep to get the URL of an image, after that I'd like to download the image itself, and copy it to the clipboard directly, rather than saving it to the disk temporarily before. I'm ...
Zettt's user avatar
  • 297
0 votes
0 answers
59 views

How to use '@' or '&' in a network share literally

I'm trying to write a shell script for a Mac user that automatically adds the network share to their Finder. The problem is that they named the shares 'A@W' and 'F&E'. I already tried 'A@W' but ...
Pierre Hoste's user avatar
0 votes
0 answers
270 views

Running .pkg installer fails through Script Editor, but works in Terminal

I'm trying to use Script Editor to create a clickable app that downloads a script, runs the script (which uninstalls a piece of software that isn't working properly), downloads a new .pkg installer, ...
Mike Armatage's user avatar
0 votes
1 answer
70 views

AWS Environment Variables - IDE

I use the IntelliJ IDE for my daily tasks. I set up my AWS environment variables, by executing a script. If I wish to use a plugin built into the IDE to query AWS K8S it will fail as it expects the ...
Les's user avatar
  • 1
0 votes
0 answers
383 views

Search for keychain password via Terminal/shell?

Is there any way to do a partial (wildcard) search for a password from my iCloud keychain or Chrome via shell? E.g., given "foo" I would like to find all keychain items (of any kind, ...
d0g's user avatar
  • 3,902
1 vote
1 answer
238 views

How do I point the mkdir to the Desktop using bin/zsh? I am on macOS $HOME

How do I make this create the directory on my Mac desktop rather than the home folder alone. mkdir -p "$HOME/${digits}_${date}" Right now it goes to /Users/name/ I need it to go one more ...
Denise's user avatar
  • 13
0 votes
1 answer
132 views

where command lists gls for where ls

I was trying to list the paths of the ls executables using where ls, which should list all locations where the ls executables exist along with the alias of ls. I've also installed coreutils through ...
Karthikeyan's user avatar
  • 1,056
2 votes
1 answer
966 views

How to extract Safari .webarchive file to folder, from command line?

Safari offers the .webarchive format to download a webpage, together with embedded resources (images, etc). As described/linked in answers to How do I turn a Safari Webarchive file into a folder?, ...
PLL's user avatar
  • 925
0 votes
0 answers
17 views

How to programmatically change audio output to built in speakers ALWAYS [duplicate]

I've seen answers like these but what I'm trying to do is programmatically ALWAYS set the audio output to built-in speakers regardless of which row item the Mac is currently tuned to. In the code ...
Mansidak's user avatar
0 votes
0 answers
2k views

Is it possible to remap mouse buttons without any third-party software?

I have a (Logitech MX Master 3S) mouse that I use with my company provided Mac, but I can't install any third party software to configure its buttons, at all, per security policy. Is there a way I can ...
ASR's user avatar
  • 93
0 votes
0 answers
252 views

speedtest-cli through brew on macOS Monterey 12.5 refusing to connect

I have speedtest-cli 2.1.4b1 brew package installed on my mac. Before, it was working fine without any issues which kept me happy. However not too long ago I have noticed that every time I try to use ...
George Pine's user avatar
0 votes
1 answer
493 views

How can I run a terminal command from within any app and output the result (on Mac)?

No matter what app I am in, I would like to do a keyboard shortcut which allows me to enter a terminal command and run it, and the output will be written to wherever my cursor is, if it is in a text ...
Julius H.'s user avatar
0 votes
0 answers
35 views

MacBook Air Yosemite not loading apps

I am new to Mac but am a steady Linux and Windows user. My friend gave me an old MacBook Air 2012 to look at and as far as I know, it looks bad. Maybe somebody will have an idea. http://lneletro.us/...
Logan's user avatar
  • 1
3 votes
1 answer
405 views

Unable to delete identity in Keychain

A certificate that we use for Wi-Fi in the office has expired, and it does not renew for some reason. I tried to delete it from the Keychain Access I get the following error: I guess that's the ...
Selcuk S.'s user avatar
1 vote
1 answer
712 views

Why does open fail with LSOpenURLsWithRole() failed with error -610

Why am I getting LSOpenURLsWithRole() failed with error -610 when I try to open a .dmg on the command line? user@host Downloads % open buskill-mac-x86_64.dmg LSOpenURLsWithRole() failed with error -...
Michael Altfield's user avatar
1 vote
0 answers
33 views

How to remove duplicate phone numbers from Contacts?

For some reason I have one contact card that got messed up and now has a boatload of phone and fax numbers from all sort of other contacts. Is there a way to remove those duplicate phone numbers from ...
Alex Ixeras's user avatar
  • 1,333
2 votes
1 answer
611 views

XQuartz setting default shell for xterm under Ventura

In a clean rebuild of Ventura, my default shell is /bin/zsh. For instance, that is what shows up in a Terminal.app terminal. If I start an xterm (launched from XQuartz 2.8.4), the shell shown in $...
James6M's user avatar
  • 113
4 votes
1 answer
2k views

Change audio input and output devices from terminal

I'd like to be able to change my audio inputs / outputs from the command line so that I can script my studio setup. Is it possible to change the selected audio input / output in MacOS from the command ...
70by7's user avatar
  • 203

1
3 4
5
6 7
63