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
42 views

What is sh in the accessibility permissions in Catalina?

Not sure what this is, but I upgraded from High Sierra and it asked me to enable it. This isn't on my Macbook Pro running Catalina. How can I tell if this is needed?
1
vote
1answer
55 views

In bash, how to open .png file in a Mac app which only has “import” in the app menu

I'm using 'engauge Digitizer' to digitize the charts (.png file). When to automate the process, I wish to write bash script or to use Python Subprocess library to control it. The first step is to ...
1
vote
1answer
42 views

brew search generates mail notification “You recently used a password to access an endpoint through the GitHub API using Homebrew/2.2.2”

I got a mail from GitHub: You recently used a password to access an endpoint through the GitHub API using Homebrew/2.2.2 (Macintosh; Intel Mac OS X 10.15.2) curl/7.64.1. We will deprecate basic ...
1
vote
1answer
70 views

MacOS command-line security updates: equivalent for apt-get update all

I am accustomed to updating systems with sudo apt get update and would like to ensure MacOS security updates are installed from the command line. This `software update' command was issued on my ...
1
vote
0answers
29 views

PS1 setting on macOS using Modulo

I'm trying to set up my PS1 setting in my .bash_profile for my company laptop (Touchbar Mac) and noticed special characters like \u and \w were being used literally. I tried using the single and ...
1
vote
0answers
45 views

Change “Open With” from terminal [duplicate]

How do I change the default program to open a file on Mac? For example, I want docx-files to be opened with Word 2011 instead of Word 2019.
0
votes
1answer
29 views

Terminal command to show FileVault and Firewall settings

I'm as a system admin and a big pain is physically checking people's private MacBooks for FileVault and firewall settings. Is there a way to get the Terminal to output the FileVault and Firewall ...
0
votes
1answer
70 views

Add colours to output of existing CLI commands

I would like to create a function / alias that colorizes the output of another command. Is there a best-practice way to do so? For instance, let's take the alias command, whose output looks something ...
0
votes
1answer
67 views

List of all interfaces in my laptop

Below is the machine: $ uname -a Darwin whatever 18.7.0 Darwin Kernel Version 18.7.0: Sun Dec 1 18:59:03 PST 2019; root:xnu-4903.278.19~1/RELEASE_X86_64 x86_64 $ In ubuntu, ip addr or ip a gives ...
1
vote
3answers
152 views

How to find out if iTerm is installed on a mac from within a shell script?

I am writing an automated script that will install iTerm2 if it's not already installed. What's a good way of checking if iTerm2 is already installed?
0
votes
1answer
89 views

How to remotely connect Macs across different networks?

I'm trying to connect two Macs that are not in the same Wi-Fi network. I'd like to use terminal instead of available Remote Desktop programs. My remote Mac had already all the preferences active in "...
2
votes
0answers
53 views

Run a command without opening the terminal

Is it possible to start a terminal command without opening the terminal first? I have some quick commands, and for those I open the terminal window, run the command, and close it again. I generally ...
3
votes
2answers
505 views

Which terminal window app allows for multiple panes and click to open new window

I am watching this screencast series where the guy is using OSX and has this cool terminal window client. Trying to figure out which one he is using. Here is a screenshot: It looks like he is able ...
-1
votes
0answers
50 views

syspolicyd assessment denied

My server has a bash script that executes twice a day, so far so good, it worked for a looong time. Yesterday I updated the server OS to Catalina and then the script stopped working. I've checked ...
0
votes
1answer
71 views

How to delete Command Line Tools while keeping Xcode? [duplicate]

I recently purchased a new Mac and I am currently in the process of setting it up as a development machine. Before installing Xcode I went ahead and installed: Sublime Text Sublime Merge While ...
1
vote
1answer
41 views

Correlation between Mac OS X GUI actions and Logs

I am not sure if it is possible but I was trying to discover/view/analyze if there is any correlation between the actions that a regular user perform on the GUI side with some logs inside the system (...
2
votes
1answer
33 views

Chown to make sudo unncessary?

I am setting up a new Mac for mobile app development and so I need to install a lot of things through the Terminal. Its asking me for sudo to do a lot of things and I vaguely remember a chown command ...
0
votes
1answer
53 views

Taking screenshots with the command line of a specific window

I wanna take a screenshot of a specific application using the command line. Doing screencapture -h Shows option "-o" -o in window capture mode, do not capture the shadow of the window Which ...
1
vote
1answer
53 views

How can I tell if True Tone is on/off in a script?

I want to be able to print out if True Tone is on or off in a script. Is there a command to determine this?
1
vote
1answer
36 views

tracing stuck local to local mails in macOS

I'm sending myself a mail like this: AdministorsMBP2:~ administrator$ mail -s "subject here" me@mydomain.com <<< "message" AdministorsMBP2:~ administrator$ echo $? 0 The command returns ...
2
votes
1answer
53 views

Taking screenshots with the command line, but of specific regions

I want to capture a screenshot of a specific region, say 10x, 10y, 200width, 200height using the command line I am aware of the command "screencapture," so I do screencapture -h and I see this: ...
1
vote
0answers
66 views

Executable only works in specific folders

I have some executable files that I run in the terminal, and I noticed that they only work if they are on the Desktop or in the Applications folder. One example is this small script. When I compile ...
0
votes
1answer
29 views

How do I add the wifi and bluetooth icon to the menubar programatically (from the command line)?

We have a large number of computers to set up and would like to add the wifi and bluetooth icons to the menubar. How can I turn these settings on via a shell script or command line instruction?
0
votes
1answer
31 views

vim ignoring .vimrc syntax highlighting

I had a ~/.vimrc with some basic syntax highlighting that was working fine until I upgraded to Catalina. Running vim -V I see it loads my vimrc but it totally ignores anything in it. If I run :so ~/....
1
vote
1answer
95 views

web request failures in curl

I have a macbook pro running Catalina 10.15.1. However this issue has been present since at least Mojave. After a reboot it runs fine for a while (up to about an hour but I haven't measured) and then ...
1
vote
3answers
80 views

Deleting (intrusive?) Facebook files ok?

Platform(s): MacOS Catalina (10.15.2) and an iPad (13.3). Disclaimer: I'm in no way experienced or knowledgeable in anything relating to computers. Background: I'm keen to cut ties with Facebook ...
1
vote
1answer
65 views

macOS catalina no longer sends email if job outputs to stdout

After upgrade to macOS Catalina 10.15, I no longer receive emails from crontab jobs. Sometimes it's desirable, but in most cases I need to see these errors, so I could act on failures. I know I can ...
2
votes
1answer
67 views

How to make auto-complete work for AWS on ZSH?

I installed awscli from brew. The amazon instructions refer to a shell script, aws_zsh_completer.sh that doesn't appear to be included. I do have an /usr/local/bin/aws_completer. How do I make the ...
2
votes
1answer
51 views

How do I set the working directory as the tab title in Terminal for Mac?

One of my Macs is running Mac OS Mojave and so for parity with my Catalina machine I switched the shell to zsh. Not sure exactly when but at some point I noticed the current working directory was ...
0
votes
0answers
59 views

How to change zsh prompt which now shows probably MAC address?

I have been try to change the prompt on my terminal and the prompt that shows up looks like a MAC address. This is what it looks like: Last login: Mon Dec 16 20:41:33 on ttys000 ...
0
votes
1answer
47 views

Certain Commands are not Found in Catalina's Zsh

This is sort of a specific question that seems like it would be better suited over on Atom's user blog, but I figured I would post this here as well as I have actually asked it there and have received ...
1
vote
1answer
25 views

Where are iCloud documents stored in the file system? [duplicate]

Where are iCloud documents stored in the file system? Under Finder you can find the iCloud directory, however 'Get Info' gives absolutely no clue as to where these files are located in the file ...
1
vote
3answers
95 views

Terminal command to move all loose files into a directory with the file name

I have a folder containing thousands of files and directories. I would like to move all the files that are not contained in a sub directory into a directory and name it the file name, while leaving ...
0
votes
2answers
70 views

Automator Change to directory of dropped files before running Shell command

Seems extremely simple, but I can't figure it out... I want to be able to change to the directory (folder) where the dropped file is located before running my shell script on that file. So either I ...
3
votes
1answer
249 views

Reference book or websites on how Mac OS works

I'm looking for a good book or other set of reference materials on how MacOS works. I'm not concerned with the GUI tools or advanced Finder tips or things like that. Rather, I'm interested in the ...
0
votes
2answers
199 views

history command in macOS Catalina

I can't delete the shell history in macOS Catalina. I use rm ~/.bash_history. history -c all command fields. I need to delete the command history.
2
votes
1answer
51 views

How to Fix Generic File Icons in macOS Catalina?

How to restore file icons when they have gone generic in Mac OS Catalina ?
4
votes
1answer
77 views

Compare any checksum with proposed checksum by website

I often download files from the Web and many websites suggest to compare a proposed checksum with what I obtain from my computer (usually in Terminal). However, as the checksums tend to be quite long ...
1
vote
1answer
48 views

How to make .command file execute at its location

When you execute a .command file it is not at the location where the file resides. You can place a .command file anywhere with the command pwd in it, and it will always print your Users folder. I ...
0
votes
0answers
39 views

Using find in terminal after upgrade to Catalina

After upgrading to Catalina, I am unable to use find command in iterm2. Here is the error: --- ~ » sudo find / -iname mysqld.sock ...
1
vote
1answer
125 views

'ls' command not working on mac OS Catalina

Ever since updating my mac to OS Catalina I have noticed quite a few changes were made to the terminal. Upon opening the terminal there is always the entry: The default interactive shell is now zsh....
0
votes
1answer
21 views

How to allow Terminal to Find Commands without Export PATH?

The terminal on my Macbook Pro cannot find any commands until I enter this before every session I use : export PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin" How can I make it so that I do not ...
0
votes
1answer
37 views

Wrong line-drawing characters when write “tree” command output to file

Under macOS Catalina 10.15.1, Using the standard "tree" command (as supplied by MacPorts), if at the Terminal prompt I cd to a folder and then execute tree there, I get output like this: . ├── ...
1
vote
0answers
20 views

using breakpath command in shell file

From somewhere I have available in the macOS 10.15.1 Terminal window the command "breakpath", which gives as output the entries in $PATH, one per line. And I can redirect its output, e.g.: breakpath &...
3
votes
1answer
93 views

cat: illegal option — 2 while merging

wlan-141056:part_u_2 prova$ ls -2e-5_cas 0_cas 10e-5_cas 20e-5_cas 40e-5_cas 5e-5_cas wlan-141056:part_u_2 prova$ cat -2e-5_cas 0_cas > prova cat: illegal option -- 2 usage: cat [-benstuv] [...
0
votes
1answer
41 views

remove time date information from file

I saw the post on how to change time and date using touch or setfile. Is there a way to remove time and date entirely from a file? I tried xattr -c which did not work.
3
votes
1answer
58 views

Path into PS1 prompt is broken (\n) on different lines when it is too long

I am using iTerm2 on MacOS Catalina . Here is my PS1 into ~/.bashrc , using a function ps1 : function ps1 { # PROMPT SECTION BLUE='\[\033[0;34m\]' LIGHT_CYAN='\[\033[1;36m\]' ...
1
vote
1answer
40 views

How to make “python” command in terminal open python3 instead of python2.7 which comes with mac?

Mac comes with Python2.7. For a project, I need to use Python3.7.5. I installed it. However, if I just type python in terminal, the 2.7 interpreter starts. How do I make it so that when I type ...
1
vote
1answer
42 views

macOS catalina ignores shell in AD and uses zsh instead

We have Catalina hosts connected to our AD domain. Directory Utility shows AD users having /bin/bash as their shell (in Directory Editor), and the default shell for the domain is /bin/bash (in ...
5
votes
2answers
289 views

A way to run console commands in menu bar?

I have a couple of console commands that I a) want to run and stop at demand (optionally automated) and b) without opening terminal window and/or leaving it open, ideally from menu bar. Some of them ...