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
2
votes
0answers
97 views

How to enable/disable Do Not Disturb from shell on Mojave?

I've searched far and wide, but obviously not enough, to find a solution for this on macOS Mojave. I found the answers here, but they don't work on Mojave: https://apple.stackexchange.com/a/303400/...
1
vote
1answer
25 views

Create an hardlink across storage device (or alternative solutions)

I have named my secondary SSD with a name with a space in it - "My SSD", and have been using it for many years with multimedia applications without any problem. Part of my media library with thousands ...
1
vote
1answer
237 views

How to open multiple iTerm2 tab with admin privilege

So I have an executable program in my /usr/local/bin/ called myApp. I need to run multiple myApp processes in new iTerm2 tabs with sudo. The file structure is like this: --myFolder ----v1 ----v2 ---...
3
votes
0answers
293 views

Renew free provisioning profile from CLI

I'm developing an iOS app to run only on my phone (a.k.a. sideloading), and I don't need to distribute it. With a free iOS dev account, my provisioning profile expires every 7 days. I'm looking for ...
1
vote
0answers
41 views

Change Text to Speech Speed on the command line

I want to change the speed of my text to speech. I know I can do this via preferences like this: However, I want to configure this setting via the command line. How can I set the speaking rate via ...
3
votes
1answer
1k views

Terminal command to remove custom icon from file (HFS+)

Context In Mac OS X / macOS you can select a file in the Finder, click Informations then click the icon, and paste any image/icon that is in the clipboard. Now this file has a custom icon made of ...
3
votes
1answer
59 views

How can I run “say --output-file” without it hanging (and worse) with more than 310 bytes of input?

For my non-commercial curiosity, I'm interested in turning some of Lewis Carroll's work into machine-generated speech. When sending the output to an audio device, the say command can do this even with ...
18
votes
3answers
7k views

Why is /usr/include missing? I have Xcode and Command Line Tools installed (Mojave)

I just upgraded to Mojave from High Sierra and installed Xcode plus its command line tools and additional tools. Nothing will compile from the terminal, everything says /usr/include is missing! I ...
1
vote
2answers
559 views

I need Git. Is it better to install command line tools (183mb) or `brew install git`?

I think that it is better to install Git from Homebrew: Less size Install only what I need - I do not need LLVM compiler, for example. Faster install All packages in one place No need to re-install ...
11
votes
1answer
5k views

Is there a script I can use to download the Mojave installer without being signed in to the App Store?

Is there a way to script and download the Mojave installer without signing in to the App Store? Something other than opening or clicking a url that points to the installer on the Mac App Store would ...
42
votes
5answers
10k views

Homebrew and Git - Wrong language on the command line

I have a strange issue - when I use the git command which comes with the Command Line Tools package, the interface on the command-line is in English, as I want it to be. However, the version installed ...
1
vote
3answers
312 views

Running `nano` uses the old nano(2.0.6) even though nano 3.0 is installed

I installed nano 3.0 with brew install nano, but when I run nano --version, it shows version 2.0.6, which is what came with macOS. Screenshot: echo $PATH also shows that /usr/local/bin is listed ...
3
votes
2answers
1k views

Copy the first n files from one directory to another

Im looking to copy the first 'n' files from one directory to another directory preferably with only cli tools (no scripts). I've tried the following: find . -maxdepth 1 -type f | head -5 | ...
2
votes
1answer
280 views

Any way to open a URL in a script without having it open in a browser

The situation: My mobile carrier offers for free to send SMS notifications by following a URL. What I'd want: Include these URLs in various scripts to get notifications when I'm away from keyboard. ...
3
votes
2answers
178 views

Difference between filename and . filename in macOS terminal

I'm newbie to MacOS. (I'm using mac OS high sierra 10.13.6) I installed a software. They said to initialize the software by . /path/setsas.sh I give no thought to . and space, so I just ran path/...
4
votes
1answer
7k views

Command line to find bluetooth device's MAC address [duplicate]

Is there a way to get the MAC address of the Bluetooth device in my Mac? I am using a MacBook Pro running macOS High Sierra. I am looking mainly for macOS but the command could also be for another ...
1
vote
1answer
63 views

Save command line output to a file without any graphics or special characters

I want to save the command line output data in a text file. I am running macOS High Sierra 10.13.6. The problem is, it has some graphical output which I don't want to store. What I need is, only the ...
4
votes
2answers
118 views

Bash - Suppressing output to STDOUT

I've written a script for fresh macOS installs that installs Homebrew, Cask, and a bunch of apps I like, along with creating a .vimrc file. Thanks to an answer by daniel Azuelos (located here: Best ...
0
votes
2answers
983 views

After installing wine with a .pkg, I get the error wine: command not found when running from the terminal but the app works fine

I have installed wine through a .pkg from here. Wine Stable.app works fine, but when I run any wine-related command from the terminal, I get command not found.
0
votes
0answers
393 views

Post-install step not completing while installing wine with homebrew

I'm trying to install wine with brew install wine, but it keeps on showing Warning: The post-install step did not complete successfully and when I try again with brew postinstall wine, it shows the ...
3
votes
1answer
202 views

How do you insert literal control chars in vim on Mac?

How do you insert literal control characters in vi on Mac? For example what is the Mac equivalent of Unix ^V^M Windows ^Q^M (in vim) to insert a \r into a substitution string?
3
votes
3answers
177 views

Make Time Machine use two drives from Terminal

My desire is to have two identical Time Machine backups on two different locally attached drives. My first thought was a clone via Carbon Copy Cloner, but it won't do it, because Apple won't let third ...
0
votes
1answer
110 views

How to get the Disk Image property using terminal?

Let's say I have the volume path. Normally I can right-click and 'Get info' to get its Disk image. I want to replicate the same on terminal (basically need to code it in objective C) mdls doesn't seem ...
0
votes
1answer
69 views

How to script a global keyboard shortcut in MacOS

I want to configure a global keyboard shortcut in MacOS using a script. Specifically, I want to set the "Move focus to next window" to ⌘⇧§ (since I have a Swedish keyboard and the default ⌘⇧` has a ...
0
votes
1answer
35 views

Why isn't xargs running one command per line for this use case?

My overall task is to ping each EC2 server I happen to be connected to. I am using this command to do that: netstat -W | grep ec2 | cut -d " " -f 18 | sort -u | cut -d "." -f 1,2,3,4 | xargs -0 -p "...
-3
votes
1answer
77 views

Hacking via Terminal Shell Script [closed]

Is there a shell script that you can use to hack cell phones with just their number from your macOS? I ask because my phone was hacked with just the number and I am curious how it was done? This may ...
6
votes
4answers
3k views

Is it normal to have same user logged in twice but from another TTY?

I don't know if this is something that is in macOS, but in Linux I normally see only one user if I run the who and w command. Is it normal to have same user logged in twice but from another TTY? I ...
3
votes
2answers
92 views

Trigger the Creation of a Specific Preference List?

I have the following function: hardware_model () { local hardware_mod hardware_mod=$(defaults read ~/Library/Preferences/com.apple.SystemProfiler.plist 'CPU Names' \ | cut -sd '"' -f 4 \ | ...
2
votes
2answers
700 views

Set pmset to sleep in a specified time

I could set sleep as pmset sleep now I'd like the machine to sleep in 10 minutes later for example, (I am going to have lunch but desire Mac wait a process to be finished) I checked the "pmset" and ...
1
vote
0answers
77 views

Terminal Startup command not found

Whenever I open my terminal there is a line that reads, -bash: 6ee67d3f2005ceaf5266c966198b7f3c165bf5d7: command not found This is shown after the line that states my last login information. I am ...
6
votes
2answers
873 views

“bash -D” command doesn't seem to do anything useful

I'm finally getting around to getting more familiar with the shell after all these years. I was exploring the man page for bash and looking at the -D option, which, according to the manual: -D ...
1
vote
1answer
1k views

Change mouse speed in terminal without restarting

I used this link https://paulminors.com/how-to-speed-up-mouse-tracking-on-mac/ which has a bash line that updates your mouse speed (beyond the default maximum): defaults write -g com.apple.mouse....
3
votes
0answers
162 views

Rearrange Spaces via command line from the terminal emulator

TL;DR: I need to replace the dashboard with a terminal emulator. Hi. I need to 'rearrange spaces' so a terminal emulator gets first from the left before the desktop, where the dashboard used to be. ...
3
votes
2answers
1k views

Spell check for macOS Terminal app?

Is there a spelling library or command line tool that can be installed to use on macOS command line Terminal app?
9
votes
2answers
692 views

Delete all backups of specific file/folder with tmutil

I'm trying to delete all backups of specific items through the command line. I can accomplish this using the GUI through the following steps: Enter Time Machine Navigate to the file to be deleted ...
2
votes
2answers
698 views

Can't open a PDF from Terminal on Mac because it ‘couldn't get a file descriptor referring to the console’

I tried to use the command: open <filename.pdf> but the message I got was Couldn't get a file descriptor referring to the console What can I do?
1
vote
1answer
845 views

How do I trigger a script when a second monitor is attached

I am on macOS El Captain (upgrading to High Sierra soon) and I'm looking for a tool which can trigger an AppleScript or shell script every time when the number of monitors/displays attached to the ...
4
votes
3answers
546 views

How can I find the “friendly name” of the operating system from the shell / Terminal / bash?

I know that I can use sw_ver to find this information: ProductName: Mac OS X ProductVersion: 10.14 BuildVersion: 18A353d …and I know I can find other things like uname can give me some types of ...
1
vote
0answers
73 views

Installing gcc twice on a Snow Leopard machine?

I have an old early 2008 Macbook that runs Snow Leopard and can't upgrade to anything better. I wanted to install a C++ compiler on it and finally stumbled across this: https://github.com/...
0
votes
1answer
124 views

bsdtar gives (Empty error message) when trying to extract an ISO

On High Sierra 10.13.6 (17G65), trying to bsdtar -xf something.iso fails with: bsdtar: (Empty error message) bsdtar: Error exit delayed from previous errors. I have plenty of disk space left and ...
4
votes
2answers
132 views

How to implement text editing features in terminal interface?

Sorry if the title is confusing but essentially what I want is to have standard text editor features like Command< to move to the beginning of the line or CommandShiftBackspace to erase a line. Is ...
1
vote
0answers
49 views

AirPort - How to put accessories on a network using command line instead of AirPort App

I have an application where my application device starts a WAC(Wi-Fi Accessory Configuration). I then use either my Mac or iPhone to put that application device on a network. In Mac, I see my ...
2
votes
0answers
124 views

mdls returns `(null)`

function ls-by-added() { # Doesn't work well for files having '(null)' as their DateAdded, which some do. mdls -name kMDItemFSName -name kMDItemDateAdded -raw -- *(D) | \ xargs -0 -I {}...
2
votes
2answers
45 views

How to check if file is in use?

I have c++ application and I need to know if one file is in use by anyone. I'm ok with running any shell command, but I don't want to run lsof command for this purpose, since I think I can't safely ...
3
votes
1answer
44 views

How to auto paste above return value on command line

I am trying to create a very simple script (.command) that will basically change my mac address.. i do know that the command: openssl rand -hex 6 | sed 's/\(..\)/\1:/g; s/.$//' will return me a ...
0
votes
1answer
41 views

Finding minimized apps through terminal

I would like to know how to find what apps are minimized in the dock but through the terminal? The idea is to make a script that pauses minimized apps in order to reduce memory usage but the first ...
0
votes
0answers
137 views

Make iTerm2 read profile from file, from the CLI?

I want to make iTerm have these values set: - Load preferences from a custom folder or URL - Save changes to folder when iTerm quits And I want to set them from a CLI command (no GUI, no clicks). ...
0
votes
1answer
817 views

Atom editor no longer opens from command line

I've been using the Atom editor on my iMac running High Sierra. I usually run it from the terminal by typing atom. I moved many of my apps to an external drive to free up disk space. I originally ...
1
vote
1answer
212 views

What is the equivalent of the 'gsettings' command on OS X?

Under Ubuntu it's possible to get various settings information via gsettings command in terminal. For instance, current wallpaper path can be obtained via $ gsettings get org.gnome.desktop.background ...
2
votes
1answer
2k views

Cannot run refind-install from Recovery because “/usr/bin/env: bad interpreter”

I have managed to change the present working directory to the folder containing downloaded rEFInd files. I have booted to Recovery Mode. The refind-bin-0.11.3 folder was downloaded to my Downloads ...