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
1answer
26 views

softwareupdate shows 2 updates for Command Line Tools - get rid of one entry

I am on macOS Catalina 10.15.6 (19G2021) and softwareupdate as well as graphical "Softwareupdate" in "System settings" show two updates for Command Line Tools: $ softwareupdate --...
4
votes
2answers
1k views

I downloaded a shell executable and man pages from a source I trust. Where should I put them?

I downloaded a binary file for a shell executable, and the corresponding man pages, from a source I trust. Unpacking the archive returns a binary file and some man pages. There's no installer. Which ...
0
votes
2answers
23 views

Command in shell script to minimize particular window of an open app?

How can I include in a (zsh) shell script a command that will minimize one particular window among several windows open in a specified app? I already know how to include a command that opens an app ...
1
vote
1answer
31 views

Is it possible to change the user's shell system-wide without using chsh?

Using chsh in Catalina is annoying because during a system update /etc/shells is reverted back to the default content. I use Fish as my shell and I don't want to keep an eye on that file. Is there a ...
0
votes
1answer
86 views

I placed Neovim in usr/local/bin but getting permission denied

I'm not sure where to place the Neovim folder (after extracting it). Is the location usr/local/bin correct? I get the following zsh: permission denied: nvim
1
vote
0answers
10 views

How enable iCloud-based recovery when setting up FileVault via the command-line tool fdesetup?

When enabling FileVault using the GUI (System Preferences < Security & Privacy < FileVault), it is possible to configure a linked iCloud account which can be leveraged for lost password ...
1
vote
0answers
32 views

Workarounds for “cp -p” not preserving nanoseconds on High Sierra with APFS?

I don't know if this affects MacOS versions newer than High Sierra, but it seems that cp -p won't preserve timestamps with nanoseconds resolution. Because of this, the shell can wrongly tell that a ...
1
vote
1answer
34 views

Command to list available webcam/video devices?

Is there a way to list all webcams that are available to my Mac (e.g. FaceTime camera) using Terminal? I know there's diskutil list to list all disks attached to my Mac, but is there a command that ...
-1
votes
1answer
40 views

How to change desktop wallpaper for all desktops/spaces?

I want to write a script to change all my desktops/spaces' wallpaper to one picture every 5 minutes. (In linux, I use feh script to do it.) So how to do it in MacOS Catalina(such as use shell or ...
2
votes
1answer
33 views

How to query a particular field of brew cask/ formula info?

Homebrew version on my Mac: Homebrew 2.5.0-84-g9e697bd Take github (Cask for GitHub Desktop) for example, this is the cask file located in /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask/Casks/...
10
votes
5answers
2k views

Can anyone explain to me the difference between terminal apps, CLI, CLT and Prompt?

I wish to understand at a conceptual level, the difference between a terminal app, Command Line Interface (CLI), Command Line Tools (CLT) and Prompt. I am confused as to what the difference is between ...
0
votes
1answer
63 views

How to use script to open an app if it's not the front most app, and hide it when it is the front most app in macos?

I need a script to open an app if it's not the frontmost app and hide(command+h) it when it is the frontmost app. e.g 'Kim.app' how to write this in Applescript or shell script? Here is some info I ...
0
votes
0answers
9 views

Listing all the users part of an AD group

I want to know the users part of an existing Active Directory Group. Trying to use the id utility : https://ss64.com/osx/id.html Seems like i can get the list of groups that a user is part of with the ...
0
votes
0answers
28 views

Is there a way to ask for Password for running sudo shell commands from an Automator app?

Im making a simple app for myself but an error shows up saying I need to enter passcode in a different window and also use -s command. I tried using it with terminal open and it does not work. Please ...
0
votes
1answer
55 views

How do you disable VI-like behavior in macOS terminal?

When I open a terminal and type asdf asdf asdf asdf And hit control-u, the line gets wiped. If I type that line again, but then use option-left to skip a word back, then control-u doesn't wipe the ...
0
votes
0answers
36 views

Create or Edit a new configuration profile .plist using the command line

Take out of the picture MDM or Apple Configurator or any other management software, just for my knowledge and understanding of how to implement a restriction and how to manipulate or create a .plist ...
0
votes
0answers
20 views

Why an error occurred when I run slmgr command in my Windows 10 Command Prompt?

I downloaded a fresh copy of Windows 10 ISO file named Win10_2004_English_x64.iso from the official Microsoft website. I installed it on my MacBook Air via Boot Camp Assitant. All process was ...
0
votes
0answers
31 views

Subversion on macOS Catalina (10.15) producing very strange/incorrect behavior

I've just moved to macOS Catalina 10.15, and installed Subversion via Homebrew. That appeared to go well; svn --version and svn help both work, and I was able to use svn checkout to check out a small ...
0
votes
2answers
37 views

A better usage of apropos for searching the man directory

I will ask my question starting from a real example. From the command line prompt, I want to search for a command line tool that will output information about my smart card. Side Note: I already know ...
1
vote
1answer
664 views

Can't install command line tools on MacOS Big Sur

After updating my OS to Big Sur, I tried cloning a repo. In order to do so, I apparently need to install command-line tools. However, on Big Sur, whenever I try to download command-line tools, I get ...
0
votes
1answer
42 views

Figure out used swap from command line?

When looking at the Activity Monitor it says that I am using 459.5MB of swap. I would like to figure this number out from the command line. I have been able to duplicate all the other memory numbers ...
2
votes
1answer
122 views

How can I set oh my zsh to be my default shell?

I'm using Hyper as my terminal application and I just installed Oh My Zsh via curl. I'd like it to be my default shell environment but for some reason whenever I restart Hyper I have to run the zsh ...
1
vote
1answer
44 views

how dangerous is it to give zsh full disk access?

I have a shell script that runs a few (Duplicacy) backup commands. It works fine when I manually run the script from terminal (cd to the directory where it is and then ./backup.sh). To make it run ...
1
vote
1answer
11 views

How to find tagged files/folders using the command line in Terminal?

What commands do we have for finding tagged files/folders using find on the command line? I have done a search and looked on this site and found nothing.
1
vote
2answers
44 views

MacBook-pro Internal PCIe Samsung 512g SSD no longer recognized on MBP (mid 2015 15" A1398) after crash and hard reset

Short version: Need help finding, diagnosing and fixing the internal factory installed Samsung SSD that has vanished after hard reset. Trying to retrieve data or avoid data loss with whatever options ...
1
vote
1answer
42 views

How to execute this brew installed tool 'gigtools'

My goal is to to run this 'gigtools' folder which extracts and converts .gig [audio] files into .wav files. Website: https://command-not-found.com/gigextract So I've installed the commands with Xcode- ...
0
votes
1answer
57 views

Which is correct, iTerm or Terminal? (Option as Meta or Esc+)

Each provides the ability to change the behavior of Option: as Normal, Meta, or in iTerm only, Esc+. However, an interesting phenomenon is, in order to have Emacs-style shortcuts at the command line, ...
1
vote
1answer
38 views

Why does my curl command fail when run through applescript but work fine when I run directly in a terminal?

I am trying to write an applescript to control an installed projector using it's built in web interface. I have a curl command that pings the appropriate URL and can controll the projector as needed ...
1
vote
0answers
43 views

Automatically run script on login (MacOS 10.15)

Because of a small disk I've got an external USB-C SSD drive where I want to move some software projects I'm currently no working on. To see the outsourced projects in my default projects directory in ...
1
vote
1answer
25 views

How to set command line permissions after npm install

I am trying to run the gatsby-cli on a fresh install of macOS. I downloaded npm and node from https:node.js.org/en. Then installed the packages. Then installed npm i -g gatsby-cl. However, when I try ...
4
votes
1answer
48 views

Is there a way to make my macbook automatically execute a script every time I connect it to an external monitor?

I would like to make my macbook automatically connect to a specific wifi and launch Lunar everytime I connect it to my external monitor, and vice versa when I unplug it, but don't know where to start.....
2
votes
1answer
49 views

Select file from command-line

Is it possible to launch Finder from the command-line to perform a file select action? The purpose of this would be for the end user to, when running a shell script, be able to select a file using a ...
0
votes
0answers
24 views

Get a drive's partition table GUID or disk signature

Given a drive's device node, how can the drive's disk signature (if it uses MBR partitioning) or it's partition table GUID (if it is partitioned with a GPT) be retrieved in a shell script or in ...
1
vote
0answers
50 views

What is the equivalent of “Alternatives” for MacOS

Linux distributions have a concept/command called Alternatives. It's a way to create and manage symlinks to utilities/programs where you can call something by several names. Example: in all your ...
0
votes
1answer
48 views

Not even root can `ls .Trashes` on external disk in MacOS

I want to look in the trash directory on an external disk connected to my Mac. db@15 ~ % cd /Volumes/2TB/.Trashes db@15 .Trashes % ls ls: .: Operation not permitted db@15 .Trashes % sudo su Password: ...
2
votes
1answer
94 views

How To Use '`launchctl print`' as a Replacement for '`launchctl bslist`?'

man launchctl' remarks that: LEGACY SUBCOMMANDS Subcommands from the previous implementation of launchd are generally available, though some may be unimplemented. Unimplemented subcommands ...
0
votes
0answers
18 views

dd from dvd to apfs on Catalina is writing very slow

I did dd if=/dev/disk2 of="disk 1".iso bs=1m where disk2 is a DVD video. After about 30 minutes, dd spewed out the usual message of 7662+1 records in 7662+1 records out 8034680832 bytes ...
1
vote
5answers
399 views

How to identify the largest files in a directory including in its subdirectories?

I have a directory with a lot of files and subdirectories. I know there are a small number of large files contained somewhere within. What is a quick/easy way to identify one or more large files in a ...
1
vote
2answers
49 views

grep ^\. not working as expected in Mac terminal

if I run the following command in my mac terminal: ls -al | grep ^\. or ls -al | grep '^\.' or ls -al | grep "^\." I get no results back even though there are several files in my home ...
1
vote
1answer
46 views

Is there any way to force CLI “softwareupdate” to display & install updates other than the latest one?

I'm currently trying to install updates for Mac OS Catalina using softwareupdate CLI tool. I successfully upgraded a 10.15.5 installation on a VM to 10.15.6: softwareupdate -iaR I tried installing 10....
2
votes
2answers
151 views

MacOS Catalina terminal tab doesn't remember its own previous commands

I upgraded from El Capitan to Catalina recently; when I click ↑ in any terminal tab it used to toggle previous commands executed within that specific tab only, but now it will show commands for all ...
0
votes
0answers
30 views

Is there any way to recover overwritten notes on mac?

I pasted something on top of a note on my Mac that had some moderately important stuff, switched notes (which means no ctrl-z), and I'm trying to recover it. My first mistake is that I unfortunately ...
1
vote
1answer
93 views

Change file creation date to content created date using terminal

I have a lot of pictures with the wrong creation date and wrong modification date. There is however a third date, "content created" that is correct. user3439894 had this command line as an ...
2
votes
1answer
69 views

Shell commands work in Terminal but not in Automator service

I try to implement these two very simple commands in an Automator service to be run by a keyboard short (takes a screenshot and OCRs it): screencapture -i /tmp/tesseract.png tesseract /tmp/tesseract....
2
votes
1answer
44 views

Dump dom of url from command line with safari?

The following command will dump the dom for a web page using Google Chrome: /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --headless --disable-gpu --dump-dom http://example.com I'm ...
0
votes
0answers
72 views

LLDB command line installation on macOS Big Sur edition (11.0) beta

I'm using the following command in order to install lldb without Xcode xcode-select --install However, the window that pops up with the progress bar gets halted on task "Finding Software" ...
1
vote
1answer
41 views

Using zgrep on a remote drive eats space on my local Mac

I connect to a remote drive via WebDAV protocol, whereon I have a folder full of about 143 .tar.gz files containing data dumps, whereamong I'm trying to find my email. Herefor, I use this command: ...
1
vote
1answer
47 views

How to lock a Mac lock screen without using keystrokes in the script?

I'd like to go to the Mac lock screen with a command line script. Many of the existing answers suggest something like osascript -e 'tell application "Finder" to sleep', but my computer does ...
2
votes
1answer
45 views

Backup files in internet recovery mode: cp command errors [closed]

I'm currently trying to backup files from my MacBook Pro (2011) to an external hard drive in internet recovery mode (my laptop has been stuck on the bootscreen for the past 2 days, I think the hard ...
1
vote
0answers
27 views

Can't print remotely with “lpr” command unless I log in to remote Mac

I have remote access to a Mac and I'm trying to print over command line using lpr. However, the command is stuck until I log in to the remote Mac and press an icon to confirm the password already ...

1
2 3 4 5
45