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

Finding keychain item creator codes

A number of subcommands of the command-line keychain tool security accept a four-character "creator" code. Where can these FourCCs be looked up? For a given potential creator (such as an ...
0
votes
0answers
13 views

Program notifications with the style of Volume and Brightness banner

Using Applescript it is very easy to send Notifications on Mac Clients. With other Libraries you even get more functionalities. But is there a way to program the notifications/alerts such that they ...
0
votes
0answers
9 views

Terminal / Shell / Bash: Rename font-otf accordingly to a meta tag?

I have a lot of otf-files that got accidentally renamed to unusable names. Fortunately, if I click cmd+i on Mac, they still have their original name saved as "full name" in some font-meta-...
0
votes
0answers
16 views

Curl not working on brand new install of Big Sur

I'm trying to run curl in the command line on a relatively new install of MacOS 11.2.3, and I'm getting the following error: curl: (58) could not load PEM client certificate, OpenSSL error error:...
0
votes
0answers
21 views

How can I force required dependencies to build from source in Homebrew? [closed]

I frequently use the "--build-from-source command" in Homebrew. However, frequently when invoking this command it will begin the process only to install a dependency without building it from ...
0
votes
1answer
33 views

Big Sur Add trusted certificate via command line (Safari Can't establish a secure connection)

I am trying to have Safari stop preventing me from visiting one of my dev machines with an invalid cert. I am trying to use the solution in this thread but install it using the CLI: security add-...
2
votes
1answer
32 views

Is there any difference installing command line tools with xcode-select --install or through developer.apple.com

Is there any difference installing command line tools with xcode-select --install in the terminal and installing it through the graphical program from developer.apple.com ?
5
votes
2answers
868 views

How much disk space do the “command line developer tools” take up?

When I run git --version in the Terminal, I get prompted to install the "command line developer tools": What exactly do I get from these "command line developer tools", and how ...
4
votes
2answers
594 views

Explanation /bin/bash -c “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)”

I would like to understand exactly what this command does. I know this command installs homebrew on macOS, but I would like to understand the meaning of the syntax: /bin/bash -c "$(curl -fsSL ...
0
votes
1answer
48 views

How to properly (quickly) iterate over Reminders using AppleScript/osascript?

What is the proper, efficient way to iterate over Reminders using AppleScript? The script below works as expected, but takes 18 seconds to iterate over 180 Reminders when run from the command line ...
1
vote
0answers
16 views

How to Configure a Vanilla APFS Volume for Time Machine

I'd like a way using the CLI to set the ACEs and the accompanying files so that Time Machine will recognize a vanilla APFS volume as a Time Machine volume. I need the CLI that generates the conditions ...
1
vote
1answer
28 views

13“ MacBook Air Terminal says ” (base) UNKNOWN

Usually when I open the terminal, the first part of the command line says (base) john-doe-air, but when I opened it up today, it comes up with the following. What should I do to rectify this issue? ...
0
votes
1answer
62 views

Uninstall Anaconda from macOS Big Sur

I've some question about uninstalling Anaconda from macOS Big Sur. I was wondering if someone can please help me figure it our what to do. I followed the instruction on the official website (https://...
0
votes
0answers
13 views

Nothing returned from lsof -p on Macos M1 Apple Silicon

Firstly I get: $ ps -Af|egrep "images.tz|PID"|grep -v grep UID PID PPID C STIME TTY TIME CMD 0 10638 10457 0 2:23pm ttys004 66:13.40 tar -xzf ../images.tz So I ...
2
votes
1answer
78 views

Why I do I see these lines in Terminal and how can I remove them?

Last login: Fri Mar 26 00:39:29 on console export HOMEBREW_PREFIX="/opt/homebrew"; export HOMEBREW_CELLAR="/opt/homebrew/Cellar"; export HOMEBREW_REPOSITORY="/opt/homebrew&...
0
votes
1answer
38 views

How to approve a lot of executables with unrecognized developers? [duplicate]

So I've downloaded a program by a developer that macOS doesn't recognize, and when I want to run it I get the usual "we don't know who wrote it, would you like to trash it in one click?" ...
1
vote
1answer
43 views

Open an URL in Safari with Private Browsing

I want to open an URL in a browser's private mode. --args -incognito does the job with Chromium-based browsers (e.g. open -na "Google Chrome" --args -incognito http://www.example.com). I ...
1
vote
1answer
54 views

Awk/Gawk not working after install gawk on M1

Using brew, I installed gawk on my m1. upon doing so, awk does not work. Before install gawk: ❯ awk -version awk version 20200816 ❯ which awk /usr/bin/awk Then I install gawk and add the path to the ...
0
votes
1answer
41 views

tcsh filename globbing broken?

'[3-4]' expands as if I had asked for '[0-4]'. This occurs with letters as well: ls file_0 file_1 file_2 file_3 file_a file_b file_c ls file_[2-3] file_0 file_1 file_2 file_3 ls file_[b-c] ...
1
vote
1answer
69 views

How to continue Time Machine backups from a previous computer?

I had MBP 2015 in the past and used Time Machine on it. Last September, I switched to MBP 16'' 2019 and did a fresh installation / manual copy of most of my home directory files, maintaining the ...
0
votes
1answer
43 views

How to get execution time of an AppleScript?

I have seen some more advanced AppleScript users mention efficiency of their AppleScripts in terms of execution time. Is there an AppleScript method for getting the execution time? I know there is ...
2
votes
3answers
137 views

What exactly is chflags opaque, nodump?

I've gotten to grips with the chflags man page so far, even if it's rather uncommon for man pages. Nevertheless, I find 2 parameters very peculiar. What exactly does chflags opaque and nodump do? ...
1
vote
1answer
29 views

Open a URL with parameterized query arguments (URL-encode)

I need to invoke a custom URL for a macOS GUI app from a terminal (shell) command. I also need to be able to pass arguments to the URL's query section. It might look like this: path=/Volumes/MyDisk ...
0
votes
0answers
41 views

Syntax Error in Bash script

I'm using the following command to find certain files and delete them. #!/bin/bash files=$(mdfind -literal "kMDItemFSName == '123.test'") IFS=$'\n' files=($files) for f in ${files[*]};do ...
2
votes
1answer
150 views

How to delete a file with prefix `~$`

I use the command ls in a terminal. I found this wired file with the prefix ~$. When I was trying to remove it, the terminal responded No such file or directory. I even tried renaming it, but it ...
1
vote
1answer
30 views

Can't use VSCode integrated terminal while on Team Viewer

My development team recently rented a Mac machine through MacInCloud. I've prepared my development environment in this machine, but it seems like Visual Studio Code does not register certain ...
0
votes
1answer
28 views

applescript - do shell output to variable is blank

Hi I'm trying to get the cpuValue but I get "" for the variable. set cpuValue to "" getProcessPercentCPU("Safari") on getProcessPercentCPU(someProcess) set cpuValue ...
1
vote
0answers
63 views

Help deleting a stubborn directory via Terminal in Recovery mode? (OSX 11.2.3 Big Sur)

A folder called "Applications" randomly appeared on my desktop, which has been impossible to delete. The directory's contents are two baloney files of zero bites each--but neither of which ...
1
vote
1answer
23 views

How to install Linux compatible apropos

When I try to get information about apropos, I get the following: $ which apropos /usr/bin/apropos $ apropos --version apropos from man-1.6g I tried apropos -r '^report but I get an error: $ apropos ...
0
votes
0answers
11 views

Not a directory when I use the whatis command [duplicate]

When I use whatis apropos, it displays the following: makewhatis: /usr/local/opt/grep/libexec/man: Not a directory makewhatis: /usr/local/opt/gnu-which/libexec/man: Not a directory makewhatis: /usr/...
1
vote
0answers
38 views

Repeatedly Being Asked to Install Command Line Tools

When I'm doing various development-related activities (such as initializing a git repository or installing packages in RStudio), I get repeatedly asked to install command line developer tools, even ...
0
votes
0answers
34 views

Cycle Through MacOS Terminal Profiles From the Command Line

How can I change my Terminal's profile with commands? Let's say I wanted to switch from my custom terminal profile to the "basic" terminal profile, how would I do that with commands instead ...
0
votes
0answers
15 views

Is there a way to trigger the graphical installer for Rosetta 2 from the command line?

I need a way for a pkg file to trigger the graphical installer for Rosetta 2 as part of its installation process, meaning the pkg file itself needs to declare it supports arm64 and opening it should ...
0
votes
1answer
61 views

Is it possible to detect the current power input on a MacBook?

To the best of my knowledge, MacBooks will still charge if the power supply attached provides less wattage then the laptop was designed for. Is there a way to view the current power input, preferably ...
1
vote
1answer
43 views

Zsh syntax question

I am using a script on my iMac (Automator) that I found on macmost.com that contains the following lines: #/bin/zsh for f in "$@" do filedate=$(mdls $f | grep kMDItemContentCreationDate ...
1
vote
1answer
83 views

Fixing macOS Big Sur Finder SIDEBAR width prefs from command line?

My default sidebar width in Big Sur is too small. While I can click/drag to make folders look wider, that fix only works for folders that I open. If any application calls a new window to open - say ...
1
vote
0answers
18 views

Method to determine if a mounted (physical or server) volume supports macOS extended attributes

Using xattr -w I want to write a proprietary extended attribute (XA) and an additional user tag to files. This also needs to happen on other volumes than the boot volume. On specific volumes, however, ...
1
vote
2answers
62 views

How to invoke a UEFI Shell (v2.2) on a Fusion Player virtual machine with Big Sur installed?

I am using the current free version of VMware Fusion Player (Version 12.1.0). I have created a Big Sur virtual machine to do some testing, which involves modifying NVRAM variables. This version of ...
1
vote
1answer
25 views

How can I script selective minimization of documents in text edit when several files may be open?

From the Terminal, or in a shell file, I know how to open multiple files in a particular app in text edit from the command line and have all of their windows minimized like this: open -a TextEdit.app ~...
1
vote
1answer
40 views

How can I get accurate information about disk space used/available in Big Sur via the command line?

Summary: I would like to be able to tell how much disk space I have used and how much I have available (in GB) in Big Sur in a simple format suitable for parsing in a shell script or similar. Details ...
1
vote
1answer
22 views

cl date function working differently in Intel and M1 machines

I have a shell script to calculate the number of days from a particular date: echo D$((($(date +%s)-$(date +%s --date "2018-01-01"))/(3600*24))) On my 2019 MBP (Intel), it works. On my 2020 ...
1
vote
1answer
46 views

What are the risks of adding `/usr/libexec` to `$PATH`?

I want easy access to PlistBuddy, which I wasn't even sure still shipped with macOS (Big Sur 11.3 here). I found it in /usr/libexec, a directory I don't know well, but which contains a large number of ...
2
votes
2answers
280 views

Create macOS script to run a Terminal Command

I want to ultimately create an executable file that will run a terminal command: open -a "Google Chrome" --args --profile-directory="Guest Profile" I want to know what other text ...
0
votes
1answer
41 views

I get an error sed: 1: “1~2d”: invalid command code ~ when I use sed '1~2d' sample.txt

On macOS version 11.2.2. $ which sed /usr/bin/sed sed version: 4.8 SED(1) When I run this code on Ubuntu, it works. $ sed '1~2d' sample.txt two four six But when I run this on macOS, both in zsh and ...
0
votes
1answer
45 views

Unable to install an update via the softwareupdate command line tool

I am trying to install a macOS update from the command line. Let's see what updates are available: $/usr/sbin/softwareupdate -l Software Update Tool Finding available software Software Update found ...
0
votes
2answers
52 views

launchd, how to run a command every 3 minutes, during working hours on a weekday?

I know cron and that is fairly simple */3 9-17 * * 1-5 myCommand How does one do the same in launchd?
2
votes
1answer
198 views

“Bad CPU type in executable” when running pdftk

I have installed pdftk from https://www.pdflabs.com/tools/pdftk-server/ on my mac and when I try to run it it fails. $ pdftk -version -bash: /usr/local/bin/pdftk: Bad CPU type in executable How can I ...
2
votes
1answer
46 views

Disable Xcode Command Line Tools

I changed the Command Line Tools in Xcode settings, hoping it would solve an error with arm64e, but xcodebuild ended up taking over make command which makes the compiling process slower with my Theos ...
0
votes
1answer
32 views

What does the command afplay --leaks do?

What does the command afplay --leaks do? The man page states that it performs leak analyzes. What are leak analyzes, please? When I ran this command with an audio file, no event occurred.
2
votes
0answers
32 views

What past battery usage data feeds the system preferences and activity monitor GUI?

I am currently using a Mac Book Pro running on Mac Big Sur version 11.1 I'm looking to access the data that feeds the system preferences and activity monitor displays of past energy usage. ...

1
2 3 4 5
49