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
1 vote
1 answer
31 views

Remnant PATH entries in macOS Venture 13.3 update

In my personal shell tools I have the following inspection function that runs as a set of integrity checks; check_paths() { local paths="${PATH}" local dir while [[ "${...
0 votes
0 answers
49 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 ...
  • 101
0 votes
0 answers
47 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 ############# ...
  • 463
0 votes
0 answers
34 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", &...
  • 253
0 votes
0 answers
44 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 ...
1 vote
1 answer
27 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 ...
  • 207
0 votes
0 answers
15 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 ...
  • 6,441
0 votes
2 answers
70 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 ...
1 vote
0 answers
45 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/...
0 votes
0 answers
16 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/...
  • 141
1 vote
1 answer
47 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 ...
  • 111
0 votes
1 answer
91 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
92 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 ...
  • 1,529
1 vote
1 answer
50 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, ...
  • 153
1 vote
1 answer
45 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 ...
  • 141
1 vote
2 answers
115 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 ...
  • 121
2 votes
1 answer
54 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,...
4 votes
4 answers
638 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) ...
  • 143
0 votes
2 answers
54 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 ...
  • 81
0 votes
1 answer
27 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 ...
  • 1
0 votes
0 answers
52 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 ...
  • 123
1 vote
1 answer
28 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, ...
1 vote
1 answer
67 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 ...
  • 113
2 votes
0 answers
587 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 ...
  • 115
1 vote
1 answer
86 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 ...
  • 636
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 ...
3 votes
2 answers
122 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 ...
  • 232
2 votes
0 answers
122 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 ...
  • 21
1 vote
1 answer
69 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 ...
  • 13
1 vote
1 answer
54 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 ...
  • 283
0 votes
0 answers
35 views

Limiting process memory using ulimit

I have written a program that I want to benchmark on increasingly large instances of a particular problem. I want to stop my suite once the instances become too large to be handled on my computer. I ...
  • 231
1 vote
1 answer
89 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 ...
  • 297
0 votes
0 answers
47 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 ...
0 votes
0 answers
46 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, ...
0 votes
1 answer
29 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 ...
  • 1
0 votes
0 answers
62 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, ...
  • 3,742
1 vote
1 answer
96 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 ...
  • 13
0 votes
1 answer
52 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 ...
0 votes
1 answer
86 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?, ...
  • 691
0 votes
0 answers
15 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 ...
0 votes
0 answers
138 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 ...
  • 93
0 votes
0 answers
91 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 ...
0 votes
1 answer
66 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 ...
0 votes
0 answers
28 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/...
  • 1
0 votes
0 answers
22 views

How do I create a desktop icon for launching a script that doesn’t exit terminal

I created a desktop alias for a ruby script that launches the script with no arguments and when it opens it says exit saving session and leaves the terminal open not allowing me to input arguments. I ...
user avatar
0 votes
1 answer
89 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 -...
1 vote
0 answers
14 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 ...
  • 1,294
2 votes
0 answers
107 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 $...
  • 113
2 votes
1 answer
398 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 ...
  • 163
0 votes
0 answers
37 views

Application Uses Command Line Behind the Scenes

I use a gui application that can access the command line to run commands/scripts/etc. Is there a place where these commands are logged? They don't show up in .bash_history or .zsh_history and I need ...
  • 121

1
2 3 4 5
59