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
4 votes
1 answer
577 views

How to recover from a renamed /etc directory in Mac OS Monterey (causing inability to log in)

I unintentionally renamed the /etc directory on a Mac running macOS Monterey, with disastrous consequences: the password for sudo in Terminal is no longer recognised (because the /etc/sudoers file can ...
user avatar
  • 171
1 vote
1 answer
238 views

zsh command substitution fails when assigned to LINES

Why does this fail for zsh? bash-3.2$ FILENAME="/Users/john/Desktop/hash.txt" bash-3.2$ LINES=$(cat $FILENAME) bash-3.2$ echo $LINES ccf09b34dd38f383ce0eb37efbda0bfc546bb562 ...
user avatar
  • 737
2 votes
1 answer
544 views

Terminal equivalent command for Directory Utility View specific user OD data

I wonder if there's any equivalent terminal command that can output the same data displayed when the I search for the domain user Under Users in the OD node (/Active Directory/MYCOMP/...) the data is ...
user avatar
  • 493
0 votes
0 answers
35 views

How to `launchctl` start a daemon for testing? (without loading it, so if the device restart, it does not reload it)

For loading temporally a daemon, without it to be reloaded the next start, I was used to: $ sudo launchctl start ./myplist.plist However, this doesn't seems to work anymore (or maybe id never did, ...
user avatar
2 votes
0 answers
100 views

Command line 'open' for app not installed from App Store

So on MacOS, we can use the command line open command, to run an app, e.g., open JD-GUI.app/ However, when the application has just been downloaded from somewhere, then this gives the alert/popup ...
user avatar
4 votes
1 answer
587 views

How do mdfind and mdls derive what metadata a file has and where is it stored?

The man page of mdfind says the following: The mdfind command consults the central metadata store and returns a list of files that match the given metadata query. The query can be a string or a query ...
user avatar
  • 45
0 votes
1 answer
390 views

Installing Homebrew on Mac

I am recently trying to install homebrew as an easier way for me to update python (3.8.8) to the newest version (3.10).However every time I try to install homebrew, I get curl: (60) SSL certificate ...
user avatar
3 votes
1 answer
543 views

Removing old versions of XCode Command-Line Tools on macOS 12

I recently got a new M1 MacBook which I migrated to using Migration Assistant. As part of the migration, the old XCode command-line tools seem to have made their way over, install receipts and all; ...
user avatar
  • 802
0 votes
0 answers
76 views

Building ART raw converter on macOS and need help resolving linker errors

I downloaded ART Raw converter latest release (1.10.1) source code from its project repository on a macOS 11.6.1 mac running mac with these version of Xcode installed: Xcode: 13.1.0.0.1.1633545042 ...
user avatar
  • 101
0 votes
1 answer
80 views

Get Weather Reports from the Command Line

Just for my curiosity and knowledge, do you know if it is possible by using the Terminal Command Line to check my current weather conditions only by using the native Apple Framework? I am aware of ...
user avatar
0 votes
1 answer
69 views

Using sed steam editor to replace a specific string of regular and special characters

Using the command line utility sed stream editor, how can I replace the following string of regular and special characters ' with a single quote ' For example, I want to replace ' with ...
user avatar
0 votes
0 answers
30 views

Add E-Mail Account from Terminal

Is it possible to add a new e-mail account from the command line instead of using the System Preferences?
user avatar
  • 101
0 votes
1 answer
148 views

Apple Script can't find executables

Since moving to zsh from bash my previous AppleScript scripts can no longer find executables that are in my path, unless I use the full path to the executables. What can I do to keep using zsh and ...
user avatar
  • 737
2 votes
1 answer
150 views

How can I programmatically test if the ISRG Root X1 certificate is present and trusted in Keychain Access?

On September 30, 2021, the DST Root CA X3 expired, and left macOS 10.11 and older unable to connect to any HTTPS servers which use Let's Encrypt by default. One easy way to fix this is to manually add ...
user avatar
  • 6,548
1 vote
2 answers
8k views

npm command not found in zsh but found in bash

I installed npm with nvm and the first time it went all great, now I tried to check npm version on Mac terminal an it shows: % npm --version zsh: command not found: npm But using VSCode terminal with ...
user avatar
  • 13
0 votes
0 answers
1k views

psql command will not work in cli MAC. ERR: connection to server on socket "/tmp/.s.PGSQL.5432" failed

I have installed home-brew v14 psql & psql app v14. It will not allow me to use port 5432 (I spent a week getting this to work and it hasnt), so I have made a server on 4321 which will start. when ...
user avatar
0 votes
1 answer
100 views

How to set default nice value for a particular process that is started by launchd?

I want to set the custom priority level (i.e. nice) to a particular program as the default priority level. The tricky thing is that the process is not started by me but by background processes not ...
user avatar
1 vote
1 answer
358 views

"su - non-root" arises "su sorry"

In Ubuntu I am able to switch of user (to non-root) through the terminal executing: su - username Password: And done. I am able to do anything according the own permissions/roles of the non-root user....
user avatar
4 votes
1 answer
9k views

zsh: permission denied when Terminal has Full Disk Access

I regularly use shell files to execute tasks on my Mac quicker. I just upgraded to MacOS Monterey today, and since then, any shell files I have created, will not execute. Every time I double click on ...
user avatar
0 votes
0 answers
58 views

Where did GNU sharutils go?

I have GNU sharutils installed on my system as /usr/local/bin/shar. It's been on my filesystem since 2016, so it isn't something I added recently. However, even after grepping the Homebrew Git ...
user avatar
  • 293
3 votes
2 answers
3k views

'You should find replacements for the following formulae: ilmbase' and 'Refusing to uninstall ilmbase because it is required by vcs'

Brew doctor shows me: Warning: Some installed formulae are deprecated or disabled. You should find replacements for the following formulae: ilmbase Because I don't know the package ilmbase and didn'...
user avatar
  • 3,407
4 votes
2 answers
710 views

Modify SIP in normally booted system

I have MacBook Pro (2017) with macOS High Sierra (10.13.6). I have SIP and amfi disabled. I want to enable a part / the majority of SIP (e.g. csrutil enable --without fs) without having to reboot into ...
user avatar
  • 1,867
0 votes
1 answer
58 views

"which" command returns paths with two consecutive slashes

On my macOS machine, I noticed that sometimes the which command returns paths with two consecutive slashes. For example: bash-3.2$ which gcc /usr/local/bin//gcc bash-3.2$ which qr /Users/flyingblu/bin/...
user avatar
0 votes
1 answer
101 views

FileVault users who are unable to delete files by shell command from Terminal Recovery Mode, here's what to do [closed]

This solution applies to FileVault users who are unable to modify permissions of pesky directories (file folders) or files themselves, in order to delete them. Working with Terminal while in Recovery ...
user avatar
  • 125
1 vote
0 answers
102 views

How can I set my MS Teams online status to "green" with CLI tools?

I use MS Teams and want to have my status always "green" even if I am 20min away from my MacBook. How can I do this with command line tools (from Homebrew)? I don't want to install a special ...
user avatar
  • 3,407
1 vote
1 answer
54 views

macOS - view and read the Purpose and Description for macOS each process

Many times I am able to read the Purpose and Description for each macOS process by simply execute the man command. Example man rapportd or man WiFiAgent etc. etc. But other times, the man command ...
user avatar
20 votes
4 answers
10k views

How can I distinguish ARM binaries from x86 binaries on macOS?

Is there something I can type on the command-line to determine if an executable is an ARM/M1 or an x86 binary?
user avatar
  • 587
1 vote
0 answers
60 views

How to change keyboard brightness in windows 10 running Bootcamp through the power shell or command prompt?

There is a file called kbrightness for MacOS in which the command ./kbrightness x (where x is a number from 0.0 to 1) and it changes the Keyboard Brightness of my MacBook Pro to the specified amount (...
user avatar
0 votes
0 answers
789 views

Error when creating Kerberos ticket: "unable to reach any KDC"

Do you know why I have this message when I use kinit? kinit: krb5_get_init_creds: unable to reach any KDC in realm LOCAL, tried 0 KDCs Thanks.
user avatar
  • 1
0 votes
0 answers
191 views

Fix terminal shell to defaults

I don't know much about shells, i just now i use some functions in terminal (like xattr, and npm and so...). Recently i tried to do something and i don't remember what i did exactly but now for some ...
user avatar
  • 153
1 vote
1 answer
689 views

Usage: tmutil listlocalsnapshots <mount_point>

my Mac's system has 184GB. I believe that's for time machine's local snap shot. I tried to tmutil list localsnapshots, but Usage: tmutil listlocalsnapshots <mount_point> returned. I’m not clear ...
user avatar
0 votes
0 answers
69 views

It Terminal, when I type `ls Desktop`, I'm seeing temporary Word files randomly

I've never noticed this before, but randomly now in Terminal when I type ls Desktop I see temporary files from Microsoft Word which are prefixed with ~$ and end with: .docx I don't understand where ...
user avatar
2 votes
1 answer
112 views

Tab completion in bash for definition of bash functions?

I have several functions in my ~/.bash_profile named pg_dump_[dbname]_[envname] so I would like to enter type pg_dump [tab] (or some other command besides type) for bash to show the definitino of ...
user avatar
2 votes
0 answers
45 views

Screencapture command-line video recording with stop bar in menu bar?

Is it possible to create a command-line to start a screencapture recording that also provides the stop button in the menu bar? screencapture -v out.mov I'd like to replace pressing CTRL+SHIFT+5. =)
user avatar
  • 152
1 vote
1 answer
1k views

authorized_keys no longer working under Big Sur

I use ~/.ssh/authorized_keys to allow password-less SSH connection between computers. They worked fine under macOS Catalina, but since I upgraded to macOS Big Sur they no longer work. I can log in to ...
user avatar
1 vote
1 answer
45 views

Disconnect an iOS device remotely

I'm trying to use a remote server for building an iOS app. We have a script that discovers all connected devices and then runs the deployment command to them, if it succeeds it moves to the next step ...
user avatar
  • 123
1 vote
1 answer
77 views

New macOS install "missing commands" but commands already exist in /usr/bin

Mostly just want clarification on why macOS is doing this: On a fresh install I tried to use the strings command in Terminal and a pop up came up. I chose to "Install" and waited - it stuck....
user avatar
  • 737
1 vote
1 answer
976 views

Permanently change zsh environment variable on macOS Big Sur?

I tried to customize the ZSH terminal shell (e.g. prompt, auto-completion behavior) by editing the ZSH files, but failed. I have tried both the following, and none worked: Edit ~/.zshrc: When I tried ...
user avatar
1 vote
0 answers
142 views

Is it possible to run a Mac/Linux/Windows command-line app on a web server?

Not sure if this is achievable, but here is the deal: I have a Vendor ID from our company and that information is used to retrieve an Apple Identification number, after some assets are uploaded to ...
user avatar
3 votes
0 answers
83 views

Garbled Terminal output

The text displayed and the cursor on Terminal is very often garbled or 'noisy', and this is across releases for as long as I can remember. That said, it seems worse on Big Sur. Symptoms: Suppose I've ...
user avatar
  • 161
4 votes
2 answers
917 views

Launching a video via VLC directly from MacOS command line without any playlist interaction

I posted this originally in Super User, and it was suggested that I post this question here, instead ... I'm using VLC media player 3.0.16 Vetinari under MacOS 11.6. I want to run VLC from the command ...
user avatar
  • 254
0 votes
0 answers
27 views

How to backup Xcode Command Line Tools for offline installation?

macOS 10.15.7 and macOS 11.5.2 and have Xcode Command Line Tools already installed per command. xcode-select --install But is there any way to backup Xcode Command Line Tools or convert it to a .app ...
user avatar
0 votes
1 answer
432 views

Why does Command Line Tools include an outdated 8.5 version of Tk framework? [closed]

I recently noticed that command line tools contain a pretty much dated version of Tk framework: 8.5. You can check this by going to /Library/Developer/CommandLineTools/SDKs/MacOSX11.3.sdk/System/...
user avatar
  • 123
0 votes
0 answers
77 views

Bash hanging and generally laggy on 16" 2019 Macbook Pro?

I've just gotten a 16" 2019 Macbook Pro, and similar to my 13" 2015 MBP, bash seems to hang and generally be a lot laggier than it is on Linux distros. For example, when hitting return to ...
user avatar
  • 11
1 vote
1 answer
215 views

How to launch two terminal commands with delay thru applescript or automator?

I need to launch two terminal commands thru applescript/automator with delay between them. Absolutely don't know how to do it thru applescript, so I tried to do it thru automator and here what it ...
user avatar
  • 13
0 votes
1 answer
103 views

How to list in Terminal only files visible in Finder?

I know how to view hidden files in the Finder. Instead, what I'd like to do is list files in the shell/Terminal by the same criteria that the Finder uses for files that are hidden. (My objective is to ...
user avatar
  • 4,419
0 votes
1 answer
124 views

Is it possible to convert an apple script w/ Idle to Shell Script?

The Apple Script repeats every minute when saved as an application and the box is checked as "stay open after run handler". I used this method to convert it to Shell Script: How do I convert ...
user avatar
0 votes
1 answer
137 views

Install linux manpages on macOS

I have to regularly work with Linux machines that don't have man installed (don't ask me why). Is it possible to install Linux man pages on macOS? I'm thinking about help for commands like ip or ipset,...
user avatar
  • 379
1 vote
3 answers
238 views

A command to copy the access time of files on macOS 11.6 Big Sur

Hi I am looking for a command on macOS 11.6 to copy the access time from source file to destination file. The access time source file must not be updated.
user avatar
0 votes
1 answer
80 views

Avoid changes to /etc/pam.d/sudo across macOS updates?

I have a custom /etc/pam.d/sudo setup and I noticed that the file was always reset to default when macOS updates itself. How do I prevent that from happening?
user avatar
  • 1,128

1
3 4
5
6 7
56