Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

3
votes
1answer
38 views

Extract numbers from string using shell

Using shell script, how do I extract two sets of numbers from a string like "R14C11"? I'd like to get the result as an AppleScript list. R14C11 -> {14, 11} R5C9 -> {5, 9} "R" and "C" will be ...
9
votes
3answers
1k views

Is xar preinstalled on macOS? [duplicate]

$ which xar /usr/bin/xar It's in /usr/bin. Does that mean it's preinstalled on mac?
0
votes
0answers
44 views

Find commande doesn't list existing file

Ok so! I search the file latexindent. The command typpe latexindent given me latexindent is /Library/TeX/texbin/latexindent. I execute find /Library/TeX/texbin/ -name "*latexindent*" but I don't have ...
0
votes
1answer
22 views

How to prevent browser from redirecting AT ALL using terminal

I have a very limited knowledge of this stuff so I hope this explanation makes sense.... My parents have somehow got on my MacBook, and made it so that they can change any setting and view/modify my ...
0
votes
0answers
10 views

Get Keychain password when managed by Network Access Server

I have a corporate macOS computer where the password is managed by a Network Access Server for Active Directory. If an admin changes my password on their system and my computer is connected to the ...
0
votes
1answer
19 views

How to activate Recoverit when 'csrutil' doesn't *on macbk pro 10.13.6

Terminal messaged 'failed to modify system integrity configuration. This tool needs to be executed from the Recovery OS.' Where is Recovery OS.Objective to recover data from Emptied Trash...precious ...
0
votes
1answer
63 views

Mac OS Mojave 10.14.1 File Sharing services off after restart

I have a late 2014 Mac Mini, running Mojave 10.14.1, which I'm using as a file server to a few users in our lab. The server will occasionally see power outages due to weather. The machine reliably ...
0
votes
1answer
30 views

How to read mail via command on Mac?

I set my mail agent tool to send and to receive mails with many accounts such as a gmail account. I want to read the mail via command line for triggering cronjob purpose. For example, | grep "...
1
vote
1answer
14 views

Ignore entire folder using du -I

I tried to ignore an entire subfolder of the current folder when running du: du -I=./subfolder -sh This, however, gives me the grand total size of the current folder as if the -I never worked. I ...
2
votes
1answer
24 views

On macOS, why is the output of log stream different to log show?

On macOS, why is the output of log stream different to log show? Specifically: log stream --predicate '(process == "smtpd") || (process == "smtp")' --debug In this case --debug also shows info ...
7
votes
2answers
714 views

Difference between two quite-similar Terminal commands

I have a script that I run as part of my development (it's the activation script for a Python venv environment). The way the documentation suggests that we run it is by going to the folder containing ...
2
votes
2answers
69 views

Does macOS have a command to retrieve detailed CPU information like /proc/cpuinfo on Linux? [duplicate]

Linux has a command to retrieve detailed CPU information using cat /proc/cpuinfo. Using this command, users can get CPU and CPU's core information like below. processor : 0 vendor_id : ...
2
votes
1answer
24 views

Why does lsof exceed kern.maxfiles?

Running Mojave 10.14.3 I notice there are currently more files open than the maxfiles allowed. How is this possible? In this case I do not have any symptoms or error messages, but in the past I have ...
2
votes
1answer
61 views

Copy SSH Public Key to clipboard WITHOUT newline appended

Every Google search for copying a Mac's SSH Public Key to clipboard yields the following command, which results in a newline appended: pbcopy < ~/.ssh/id_rsa.pub This is undesirable as I need to ...
2
votes
2answers
43 views

How to show current time in mac terminal prompt?

I have this: PS1+="\D{%H:%M:%S}"; But this displays the time the prompt started. I want the prompt to show the current 12 hour (not 24 hours) time live (so it keeps changing, and then when a command ...
3
votes
1answer
110 views

“Permission denied” when running macOS installer from command line

I'm trying to install High Sierra to an external drive, from a system which is running Mojave. I can't run the GUI installer (it warns me about trying to install an older version of the OS), so I'm ...
0
votes
1answer
17 views

Network proxy setup in terminal

I am trying to create a bash script that will update the mac's proxy settings and a few other places when a user changes their password every 60 days. So far I am trying to use this command for the ...
3
votes
1answer
124 views

Is there command to grant Full Disk Access for specific application?

You can allow an application to access data if you change settings in Security & Privacy → Privacy → Full Disk Access. Is there command to accomplish the same in terminal?
1
vote
1answer
54 views

Match the Creation Date of 2 sets of files with same name

I've just converted hundreds of AIF recordings from a few days ago to WAV, but I need the newly created files to keep the original Creation Date of the recordings. Filenames are identical apart from ...
3
votes
2answers
97 views

How to update shell programs

How do I update shell programs like crontab for example? On my Mac I've got version from 29th of December 1993, but on a server linux machine that I am using version of crontab is much better in terms ...
0
votes
0answers
18 views

Problems creating Automator service using ffmpeg

Hi so I am having problems running ffmpeg on a folder of movie files with Mac's automator. My goal is to select a folder and right click/select service and automatically the Automator script (shell ...
1
vote
0answers
23 views

Mac Terminal - How to make “this” terminal stay forefront on startup

I want to make the MacX terminal stay in front of other application windows, when it is "launched". I have found the "startup command" setting in the terminal preferences, but I don't know what ...
4
votes
2answers
207 views

How can I fix my terminal when editing the PATH in .bash_profile has the startup hang and I get no prompt?

I am new to the command line and clearly messed up my setup. macOS High Sierra(10.13.6) Trying to set up Python and VScode. My path variable is what I believe is wrong, but Idon't know exactly how ...
1
vote
1answer
23 views

How to avoid lags when listening to music on a Mac?

On a Mac 10.13.6 I am usually listening to music using the command line command mplayer. However, when the computer is under rather heavy load, the music sometimes stops for a fraction of a second up ...
1
vote
1answer
27 views

How do I get readable system information at the command line?

I'm using High Sierra. I often have to copy & paste system information in a email or in a forum message. For this reason, I'd like a simple and easy way to get info on my operating system and my ...
3
votes
2answers
164 views

macOS Mojave - locate not working

I got a MacBook from my work and wanted to use the locate command, but I get the message: WARNING: The locate database (/var/db/locate.database) does not exist. To create the database, run the ...
0
votes
0answers
25 views

OSX Change monitor profile by command line

I'm looking for a away to simulate night shift on older Mac's (10.9) I generated a Monitor Profile with the ColorSync tools. Now I want to change the profile with a terminal command. Manually you do ...
1
vote
0answers
22 views

Getting serial port name from USB device's serial number

Is there a way to get the '/dev/cu.*' port name from a USB device's serial number? I'm using the following command to get the serial number: system_profiler SPUSBDataType | grep "Serial Number" I'm ...
0
votes
1answer
24 views

What is this title in the watch command? android-

Running the watch command I see this title: Every 2.0s: ls android-94348784d7dfd533: Mon Feb 4 08:59:54 2019 The android portion is confusing me. I don't understand what it is ...
3
votes
2answers
72 views

How do i delete a group of files ending with specific characters?

I'm trying to delete files that end with "_n.png" or "_s.png". How do i do that?
2
votes
1answer
82 views

Terminal not working, resource unavailable

I had a terminal session open and after I woke my laptop up I cannot use the terminal nor create new sessions. The error I get on the opened session is: -bash: fork: Resource temporary unavailable ...
0
votes
0answers
44 views

Cannot configure xdebug; “Operation not permitted” error when trying to cp

I'm trying to configure xdebug, but when I run the command cp Downloads/xdebug-2.6.1/xdebug-2.6.1/modules/xdebug.so /usr/lib/php/extensions/no-debug-non-zts-20160303 I get a "Operation not ...
0
votes
1answer
39 views

Modifying `whatis` to return error code for missing commands

Followup to "whatis" returns 0 for missing commands, I am trying to modify /usr/bin/whatis to return a non-zero exit code after an inappropriate command has been entered. My approach to ...
2
votes
1answer
127 views

Finding MacBook power status from command line (AC plugged in, or not)?

I want to start some rsync jobs in macOS Sierra 10.12 when the power and home network are connected, I know how to use the ipconfig command to check the IP address, but is there anyway to tell whether ...
5
votes
2answers
883 views

Cut in CLI doesn't work as expected - returns full lines every time

I'm running MacOS Mojave and I'm trying to get a list of owners of files in given path. I'm trying to do it like this but it doesn't work. $ ls -l /usr | cut -f3 total 0 drwxr-xr-x 971 root wheel ...
2
votes
1answer
149 views

How does Apple's “find -regex” work?

I'm trying to create a -regex expression for find on macOS. find /Users/gerben/Library -regex '.*\(cisco\).*' -print 2>/dev/null works, and so does find /Users/gerben/Library -regex '.*\(citrix\)...
1
vote
1answer
23 views

Create a custom Quick Action to create a zip file with password

How to create a custom Quick Action to create a zip file with password. I understand, to create a zip file with password the following command-line can be used: zip -er archive.zip /path/to/...
1
vote
0answers
14 views

MacBook Pro 2011 Server

My 2011 Mbp has one of the ill fated AMD GPU's that through some clever work of the people on here is chugging along on its integrated GPU. My question is there a way to set this up for future use as ...
5
votes
2answers
81 views

Opening a new Finder *tab* from command line

I'm wondering if there is a means of opening a new finder tab (not window) from the command line. I can do, e.g., open . but this opens a new window. It would be nice to open a new tab in the most-...
1
vote
1answer
58 views

macOS - Bash commands not working as needs to be

First of all, the problems: I'm not able to use both exported bash commands and default system bash commands at the same time Some of the exported paths working on terminal but some of them not ...
1
vote
1answer
47 views

“whatis” returns 0 for missing commands

On macOS 10.14, using whatis on a command that is not installed prints 'command': nothing appropriate as is expected. But returns 0 instead of an error code, which I believe is expected behavior. It ...
2
votes
3answers
59 views

How to set a fixed title for a terminal in Mac?

I am working a lot with terminals in a Mac with OS 10.13.6 and I want to set a title of a terminal (I have several terminal tabs open). I know that I can select the tab, go to Shell -> Edit Title ...
4
votes
1answer
70 views

Is it possible to access the Clipboard as a file from the command line?

When something is copied to the clipboard, is it available anywhere as an editable file? I'd assume it's written somewhere even if it's just a temporary file - although I am likely mistaken. I'd ...
0
votes
0answers
93 views

Calculating sha256 returns also “-bash: <string> command not”

I'm trying to find a SHA256 hash of a string: $ fdsafdsa | shasum -a 256 While it returns a hash, it also throws an error: -bash: fdsafdsa: command not found ...
1
vote
1answer
97 views

Copy files from Folder A to Folder B based on Text File C with bash

How do I copy files from Folder A to Folder B based on Text File C with bash? folderA: source folder with image files only, e.g. image01.png, image02.png etc. There are no space in the image names, ...
2
votes
0answers
111 views

How to compile/install mplayer on MacOS with subtitle support?

In order to play video files with a sub title file on MacOS 10.13.6 on the command line: How to install mplayer so that I am able to use subtitles? I tried the following suggestion made in some ...
1
vote
1answer
55 views

Determine com.apple.Finder AppleShowAllFiles status using command line?

Is there a way that I can grab the status of com.apple.Finder AppleShowAllFiles in command line? I switch between AppleShowAllFiles yes & no frequently, I want to write a .command file to check ...
1
vote
3answers
56 views

command line error “no volume specified”

Can't understand why I get this response when running this bless command, can someone please explain or suggest how to fix. Note: the volume syntax/path was copied exactly from the output after ...
0
votes
2answers
197 views

Reset admin password without the old password

I am trying to reset the admin password through command line. Below command used to work till High Sierra: sudo dscl . -passwd /Users/admin new_password But on Mojave it throws an error saying: ...
2
votes
3answers
73 views

Make shell script contents difficult to read

I am setting up an escape-room-esque experience for a group of 11 and 12 year olds. As part of the activity, I'm going to set up an old Mac (likely running Snow Leopard) with a specially-created user ...