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
2 answers
46 views

Interpreting networkQuality JSON output

If you run networkQuality -c you get a nice JSON output suitable for later processing. The problem I have is that I can speculate but I am not sure about what every key and the unit for its value is ...
  • 61
0 votes
1 answer
90 views

What exactly are "git pack objects"? Why are they so huge in the "homebrew-core" repo? We are talking about half a GB of metadata

I am a Homebrew user and have noticed very large files. It seems to have something to do with git, I searched with Brave Search for "Git pack format" but didn't understand exactly why they ...
  • 3,603
1 vote
1 answer
47 views

How to launch iOS/iPadOS apps from shell in macOS with Apple Silicon?

Related topic: How to get an application executable path from Terminal With macOS native apps, I can launch them directly form Terminal, for example. garmin@M2 ~ % /Applications/CotEditor.app/Contents/...
3 votes
2 answers
103 views

Sticky bit on /tmp doesn't do what it's supposed to?

I frequently run a script that creates three files in /tmp and then moves them to the destination directory. I was puzzled by the error messages: mv: ./20170608-l.gpx: set owner/group (was: 503/0): ...
  • 3,943
2 votes
0 answers
130 views

Configure LDAP through command line (NOT Directory Utility) on Ventura and Monterey

I can configure Directory Utility to make Mac machines (Monterey and above) authenticate users through my OpenLDAP (Ubuntu-based) server and everything works perfectly fine. But I need to do it ...
  • 41
3 votes
1 answer
84 views

What's the methodology for dealing with MacOS updates breaking npm and brew commands?

There's a new MacOS update and that means once I upgrade all my terminal commands like npm and brew are going to break (ie "zsh: command not found: brew"). What's the optimal way of dealing ...
0 votes
0 answers
44 views

Opening file in TextEdit to a specific line using command line?

How do I open a file in TextEdit to the beginning of a specific line (specified by line number), using the command line?
  • 101
0 votes
0 answers
33 views

How to control safari in command line?

I want to use the command line to control safari so that a few links satisfying a certain xapth will be clicked to open new tabs. Then the content of the new tabs will be saved to webarchive files ...
2 votes
2 answers
212 views

Change sudo prompt in macos

I am trying to change the default sudo prompt that is used in macos to match what I am used to in linux. I want to know that I am expected to put my sudo password and not some other password. I tried ...
  • 123
1 vote
2 answers
52 views

unexpected `lsof -a` output

My lsof command output is correct while the application I am tracking with lsof -a is running. As soon as I quit that application the same lsof -a call displays results for every process that has an ...
  • 861
1 vote
1 answer
59 views

Why can't I see ~/Documents directory from command line? ( I could yesterday! )

This morning I found I could not view the ~/Documents directory, while I could yesterday, and I still can via Finder app. stewart@M-V935Q9 ~ % cd stewart@M-V935Q9 ~ % pwd /Users/stewart stewart@M-...
  • 315
0 votes
1 answer
229 views

sh: sysctl: command not found ROOT hadd

I want to do hadd of two .root files. hadd is a function of the ROOT software library, which produces .root files. When I do hadd I get the error: $ hadd -f FinalFileName.root IndividualFileNames*....
  • 113
4 votes
1 answer
112 views

How to restore a specific file from APFS Time Machine backup drive with tmutil?

I've been using an HFS+ drive for Time Machine, but I recently formatted a drive in APFS as my Time Machine backup drive on macOS Monterey. Now I find the implementation with APFS very confusing. If I ...
0 votes
0 answers
18 views

Can sips -g capture image data on Photoshop .psb files over 4.5 GB?

When using the command sips -g profile on a .psb over 4.5GB, it returns nil. The same is true for -g bitsPerSample and -g space, though -g dpiWidth is able to capture data. All these commands work as ...
  • 1
0 votes
0 answers
65 views

Alter Password Expiry Reminder Days

I would like to change the password expiry reminder days from 30 days (default by MacOS) to 12 days, I have tried to use this command in the terminal, and it worked. sudo defaults write /Library/...
2 votes
1 answer
92 views

How to undo malicious changes to key bindings?

My friend used this script (do not run this!!) to change all my keys to h. How can I undo this?
  • 23
0 votes
0 answers
122 views

Failing to change password via dscl

I am trying to change the password for an Intel Mac running Big Sur (i386) using the Directory Service command line utility dscl. I tried this command: sudo dscl . -passwd /Users/user1 <...
1 vote
1 answer
150 views

"patch" command (version 2.0-12u11-Apple) does not include "--dry-run" Parameter in macOS Ventura

A collegue of mine upgrade to macOS Ventura, since then the parameter --dry-run is not available for the patch command anymore and our tools do not work automatically anymore as the command prompts ...
  • 213
10 votes
3 answers
2k views

Unknown locale, assuming C - Error message in terminal

Note: The question is not about how to change the locale, or what is the locale. The question is about why is there a locale-based error in man in 10.3, but no error in 12.6, even though the locales ...
  • 466
3 votes
1 answer
764 views

How to run multi-line curl statement from a script in terminal?

I am attempting to run a curl statement that I copied from Chrome DevTools. The statement has a bunch of Header parameters. If I paste this into a Terminal window, it works great. If I drop this into ...
2 votes
1 answer
79 views

MacOS 12.16: dd with devices is all but useless? reading/writing to raw disk (APFS) fails with "permission denied" or "Invalid argument"

Help! When I run dd inputting from either buffered or raw device of an unmounted volume, which does show up in diskutil list, I get either "Permission denied" or "Invalid argument"....
  • 119
0 votes
2 answers
414 views

Command line tools for Monterey without XCode

I'm extremely surprised this question wasn't asked, or at least I wasn't able to find it. Is there a way to install command line tools for MacOS without installing the full XCode suite? I'm low on ...
  • 101
-1 votes
1 answer
98 views

How to merge enumerated.pdf files in order by filename?

A set of enumerated pdf are in a directory: 1001_falcon.pdf 0100_bear.pdf 0201_cat.pdf 0201_cat.txt The goal is to merge only the pdf files into output.pdf with a script. pdftk is already installed ...
  • 2,683
0 votes
0 answers
66 views

Proper quoting of `curl -H`

Using curl -H I am seeing inconsistent results when attempting to quote for the first header but not the second. My curl command is turning double quotes into single quotes for the second header ...
  • 861
0 votes
0 answers
73 views

Connect VPN from the command line

I am attempting to get some GitHub macOS runners to perform some actions on each push to a particular Github repo. This requires a VPN connection to an AWS EFS volume. I can get it running on my Mac ...
-1 votes
1 answer
58 views

MV in Terminal vs. manual dragging in Finder

Following this issue, I'd love to ask what are the differences between the result of mv files via Terminal, and moving/dragging manually via Finder. Especially I'd love to know the answer for Mac OS X ...
0 votes
1 answer
37 views

`grep` ignoring line breaks

I have been using Ventura for about two weeks. Commands that worked yesterday do not work today. My procedure: edit each .gpx file created without line breaks by a Garmin eTrex 30.  Put each tag on ...
  • 3,943
1 vote
2 answers
571 views

How to list file in Terminal showing Content Created date/time

Picture (jpg) info has 3 dates/times: Created, Modified and Content Created How can I list the files in the Terminal showing Content Created, ls with any option only shows Created. For info, I have a ...
0 votes
1 answer
104 views

How do I compress the dynamic range of audio live so that all sounds, voices, music, come out at the same volume?

Sometimes listening to podcasts some people are loud, others quiet, and I have to keep changing the volume throughout the conversation. Is it possible to via command line or other means compress and ...
  • 83
2 votes
1 answer
370 views

chmod +x not working as expected, running another tool instead

Just wrote a simple commandline tool which works fine with swift but doesn't run as executable after chmod +x ... This is happening on my system so might be configuration related but not sure how to ...
1 vote
0 answers
54 views

Backup Pictures folder using unison

I've been very successfully using unison to back up my personal data to a remote machine. The problem is that I cannot seem to be using it to back up my pictures as I always get the error Error in ...
  • 101
1 vote
1 answer
67 views

Configure Siri from Terminal

Trying to find ways to set up Siri through the terminal. The only thing I need is to uncheck "Enable Ask Siri" box. Can I make it by editing plist without whole Siri app shutdown?
0 votes
0 answers
45 views

How to use Automator to send an email when the battery below 10%

All I want is to send an email when the battery is lower than 10% on my Mac. I wonder if I can use the Automator app on my Mac to address this issue.
0 votes
0 answers
35 views

Remap keys for Home/End for ssh connections

I have a Mac Arm M1 running Monterey. I typically use my mac by ssh-ing into the mac and then using vim/grep whatever cli utils. How can I make it so that the Home/End keys work as expected like they ...
0 votes
1 answer
37 views

Any idea why I keep losing permissions on my Documents folder?

For some reason, I keep losing all access to ~/Documents folder via shell. For example: me@MyMac ~ % ls -l ~/Documents total 0 ls: /Users/me/Documents: Operation not permitted ...
1 vote
1 answer
112 views

Does the "realpath" command in /bin resolve firmlinks as well as softlinks?

Some macOS installations include the Unix realpath command and some do not. I haven't been able to discern an accurate pattern of which versions have it. I'm on an M1 Air with Monterrey 12.6 and Xcode ...
4 votes
1 answer
2k views

Is the Unix "realpath" command distributed with macOS Ventura?

I haven't upgraded from macOS 12.6 to Ventura yet. I have no realpath command in my /bin directory, or anywhere else on my M1 MacBook Air. I've never installed brew/homebrew on my Mac though I've been ...
4 votes
1 answer
573 views

Is there a commandline switch for "ls" that reveals "firmlinks"

With macOS Sierra APFS came with a new concept of "firmlinks", often described as being "between hardlinks and symlinks". Several folders are now at System/Volumes/Data but are ...
0 votes
1 answer
114 views

Why some commands do NOT require sudo when logged in GUI?

I created a user called dummy. I login using Terminal into dummy and try to put Mac to sleep using pmset sleepnow. It does NOT work: Sleep error 0xe00002c1; You must run this as root.. I log into ...
  • 101
2 votes
1 answer
585 views

Accidentally deleted file from /Library/Preferences/

I have deleted the file com.apple.HIToolbox.plist from /Library/Preferences/ by mistake. I have a copy of the file saved. I hoped the file would be reconstructed after reboot, but that didn't happen. ...
  • 466
0 votes
0 answers
16 views

How to get the link to a resource on macOS Server's Software Update service

I'm trying to get the Command Line Tools installer from the Software Update service on macOS Server so I can use it in a script. I got the product ID from the Server app, 041-91747, then it was easy ...
  • 193
1 vote
0 answers
92 views

"Expired certificates" issue solved for browsers but not for command line tools

Today a strange phenomenon has started appearing on my Mojave mac. In my browsers I started having trouble connecting to many websites, with a "expired certficate" warning. I solved that by ...
0 votes
0 answers
34 views

Inaccessible external volume from Terminal

I've hit a bit of an odd issue with my TimeMachine/external storage backup solution. Do note that I set it up while Apple was changing filesystem management systems (CoreStorage vs APFS vs OS/Data ...
  • 111
2 votes
0 answers
61 views

Get iCloud storage plan and quota via Terminal?

I am aware that the command: brctl quota Will (as long as it's run from a logged-in session) display the number of bytes remaining in the user's iCloud storage. I am looking for a way to ...
  • 2,086
0 votes
1 answer
108 views

What is the official name "Command Line Tools" or "Xcode Command Line Tools"?

What is the official name Command Line Tools or Xcode Command Line Tools? If you go to https://developer.apple.com/download/all and write Command Line Tools as search criteria then in the results ...
1 vote
1 answer
798 views

How to update Xcode to the latest acceptable version according with the current OS? It directly by command (without Homebrew)

In Linux Ubuntu for example with the commands: sudo apt update && upgrade is possible update the complete set of current software already installed. I know the same approach is possible for ...
0 votes
0 answers
37 views

How to come out of screen session on a remote server?

I am not able to recall I used to do it in past. I am connecting to a remote linux machine from my MacOS. I could create the session by running screen S sessionname but unable to come out of it ...
  • 465
3 votes
2 answers
123 views

How to select and delete entered text in the middle of a command in Terminal.app

I am using zsh shell, which has been the default shell for macOS since 2019. Suppose a command has been entered as below... filebot -rename "/Users/john/Desktop/BBC Storyville 2022 The Fire ...
  • 861
2 votes
1 answer
509 views

Does macOS change how redirection works?

Line 32 of my script is rm ~/UniGen/* 2> /dev/null The redirection is because I expect the directory to be empty sometimes and don't need the clutter of it telling me so.  But I am still getting /...
  • 3,943
0 votes
0 answers
64 views

dump man page on text file?

I'm trying to dump a man page to a text file, but for some reason I get error No manual entry for (command) For example: man strftime shows the man page ok, however, running $ man strftime | col -b &...

1
2
3 4 5
59