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

Determining if Low Power Mode is Enabled/Disabled from Command Line · macOS 12.2.1 (Monterey)

According to this article the following script should return the current Power Mode state: pmset -g |grep lowpowermode This is what it actually returns in my case: When set through system ...
user avatar
  • 170
1 vote
1 answer
63 views

How to run "node index" from a folder in terminal

I've managed to open the terminal in the right folder using AppleScript. but I can't figure out how to make it run node index. How the line of code looks so far: do shell script "open -a '...
user avatar
1 vote
1 answer
69 views

How to mount external disk with sshfs and show the name in Finder?

I am using sshfs a lot to mount external disks using MacOS 12.3.1. The command I am using is something like sshfs $USER@28.28.28.127:/remote_folder ~/remote -o 'allow_other,gid=10067' and then this ...
user avatar
  • 835
1 vote
1 answer
26 views

How to fix unresponsive filesystem without rebooting?

I tried to mount an external storage device in MacOS 12.3.1 using sshfs, but I had to stop this process in the middle of whatever it is doing. Now, when I do a ls -l in the file system it hangs for ...
user avatar
  • 835
1 vote
0 answers
22 views

How to get memory consumption attributes of a processes in the shell/Terminal as per columns in Activity Monitor?

I have a process that I need to monitor somewhat frequently for growth due to it having a slow leak and the developer being quite unresponsive. (Not important, but since folks ask: This utility is ...
user avatar
  • 4,464
1 vote
2 answers
32 views

Running the same commands on multiple remote hosts

I have the need to run some simple commands on multiple remote hosts, then view the output side by side. For example I might want to run: cd /var/log/server grep 'UUID: 12345-12345-12345' *.log Then ...
user avatar
  • 131
1 vote
1 answer
46 views

How can I execute a function defined in bash profile, from a launchD plist file?

I want to run a function defined in my .bash_profile file. How do I execute this function from launchd? Here is my plist file, 'backupIf' is my function. In my launchd GUI editor it tells me 'no such ...
user avatar
  • 304
2 votes
1 answer
66 views

How to export Time Machine exclusions or list them in Terminal

I have a Mac running Time Machine and it has dozens of exclusions that were added through the Time Machine UI. How can I export this list? Using tmutil in Terminal, I am able to access Time Machine ...
user avatar
0 votes
4 answers
55 views

Is an image as ".jpe" an ordinary JPEG, just with a different file extension?

I have a little dozen images with the file extension *.jpe. All the others are the well-known *.jpg, *.jpeg and so on. Can these images be renamed from *.jpe to *.jpg? Is there any difference to *.jpg?...
user avatar
  • 3,323
2 votes
2 answers
87 views

In Terminal, using the "touch" command to mass create consecutive files with leading zero's, with bash, produces different results than zsh

In Terminal, I prefer to use bash as my default shell. Issuing the command touch File_{01..10}.txt produces these results: File_1.txt, File_10.txt, File_2.txt, File_3.txt, File_4.txt, File_5.txt, ...
user avatar
  • 6,289
1 vote
2 answers
58 views

Is it safe to use `trash-cli` on macOS?

Introduction The program nnn has a send-to-trash functionality, and it uses trash-cli. I would like to use nnn and trash-cli on macOS. Reading trash-cli's homepage, I see it uses ~/.local/share/Trash/,...
user avatar
0 votes
1 answer
32 views

How to use `netstat' to show utun (socket) interfaces?

I've looked through help using help netstat and can't see a way to just show tun interfaces (or sockets). I found one netstat option that isn't listed in the help, netstat -u which only shows "...
user avatar
  • 717
1 vote
1 answer
54 views

Linker command failed (clang-13)

I'm installing this software for my research, but I'm getting this macOS-related error (macOS Monterey 12.3.1) and I'm not quite sure if it is something I can handle myself or if I should contact the ...
user avatar
2 votes
0 answers
14 views

MAC OS Sierra 10.12.6 - does not accept region preference changes

For whatever reason, the region preference changed from Brazil to United States (Custom) and I cannot change it back to Brazil. The currency changed to USD and I can also not change it back to BR. The ...
user avatar
  • 21
2 votes
2 answers
253 views

Change Mac terminal name before the @

In my terminal app, it shows (base) jeffsungs@Sung-Macbook-Air ~ % on every row. I know that Sung-Macbook-Air is the localhostname, and how to change it. But how about the writings before the @ (in ...
user avatar
  • 21
0 votes
0 answers
45 views

Shell Script to check password has been set to Immediately and what the screen saver time is set to

I need to create a script for checking a security posture of a machine using OPSWAT MetaAccess. They have a built-in check, however, according to them, they aren't able to check since macOS 10.13+. ...
user avatar
0 votes
0 answers
27 views

Bioutil (Touch ID) shell script in shortcuts.app on MacOS don't work

I have a problem with bioutil function. In Terminal, I am using two commands which are working: sudo bioutil -ws -u 0 # disables TouchID for unlock sudo bioutil -ws -u 1 # enables TouchID for ...
user avatar
  • 1
1 vote
2 answers
66 views

What is '<<EOS' in shell commands like 'osascript <<EOS'

In this post and one or two others I've seen things like: osascript <<EOS -- some AppleScript code EOS I expect it's part of bash and presumably other shells... or is it an AppleScript/...
user avatar
  • 378
0 votes
1 answer
33 views

How to get the same date time in two formats in command line?

I have the following code DATETIME=$(date '+%F %T') GIT_TAG_DATETIME=$(date '+%Y%m%d-%H%M%S' --date="$DATETIME") to assign the same datetime in two vars in different formats. It works on ...
user avatar
  • 229
0 votes
1 answer
21 views

Recover HFS volume, missing partition UUID

I am attempting to follow the answer post at https://apple.stackexchange.com/a/231027. However, the third partition does not have a listed UUID. Instead, I have the following. start ...
user avatar
0 votes
1 answer
16 views

Shortcuts.app Copy Image Text

The Shortcuts app can be run from the CLI: shortcuts run 'Extract Image Text' -i /Users/rich/Desktop/alpha.png -o /Users/rich/Desktop/imagetext.txt However, the structure of the actual Shortcut is ...
user avatar
  • 159
-1 votes
1 answer
40 views

How to show the latest modified date of any files underneath a given directory? [closed]

As shown in this reverse chronological order listing the last file or subdirectory of '.' was modified on April 12, but the date of modification shown on the directory itself is April 17. I would ...
user avatar
0 votes
1 answer
30 views

gpg-agent running but command line tools missing

When I was trying to configure my gpg-agent, there were was no command line tool i.e. /usr/local/bin/gpg-agent doesn't exist (nor does it exist in the other dirs in my PATH variable: /usr/local/bin:/...
user avatar
5 votes
0 answers
60 views

How to get supply levels of a printer via command line

I'm trying to get the supply levels of a printer via the command line. So far I was able to get some information with a lpoptions (marker-message property) command. The problem is that the status of ...
user avatar
  • 51
1 vote
1 answer
44 views

tree Full Path Prefix not displayed

I have installed tree using homebrew, however it isn't behaving as expected. I have the following to list recursive files, but I want the full path for each file to be displayed. Unfortunately it's ...
user avatar
  • 159
0 votes
0 answers
24 views

How to power cycle a USB modem without rebooting?

I have a usb modem plugged into Mac Mini. I've found that rebooting the device or plugging the modem out and putting it in will change my IP, which is what I want. How do I power cycle the modem ...
user avatar
  • 51
0 votes
0 answers
22 views

How to monitor hard disk busy time?

I want to monitor hard disk busy time (as a percentage) to find out when the disk is causing a bottleneck in my workflow. On linux / BSD this can be done with iostat -x to see extended statistics ...
user avatar
  • 2,591
1 vote
1 answer
155 views

Cannot run shell scripts on OS Monterrey (12.3.1) after update from Big Sur (11.4)

I use shell scripts a lot. Ever since upgrading to OS Monterrey 12.3.1, none of my shell scripts will run. They are in the same locations they were before the upgrade to Monterrey. I execute a shell ...
user avatar
0 votes
0 answers
18 views

How can I set the default view of all folders using the command line?

I have a provisioning script I run on new machines to specify the default view of new folders to always be list view sorted by name. I know it is possible to modify the default view when opening ...
user avatar
  • 111
0 votes
0 answers
18 views

Set Mac active speaker to AirPlay target via command line (but not Apple Script)

I'm looking for a way to get a list of the available airplay speakers and connect to one of them from my Mac using command-line. Right now I'm using Apple Script but it requires to control the System ...
user avatar
0 votes
0 answers
26 views

How to restart "pinch-to-zoom" feature via terminal?

Both my macs have been having this issue with the latest releases of MacOS: Quick Look stops working randomly and Finder needs to be relaunched. Pinch-to-zoom feature stops working with the trackpad (...
user avatar
3 votes
1 answer
57 views

Can qrencode be made portable so it will run on macOS recovery?

this question was solved and the details is at the end question: I want to print a qrcode to terminal in Mac Recovery. My process ends up needing dynamic linked libraries. On Big Sur, qrencode from ...
user avatar
1 vote
1 answer
30 views

Enable system extension without UI access

I'm trying to set up a program on a CI with a system extension without access to the UI. The main problem is the server is wiped between runs, so I can't configure this program beforehand. I tried ...
user avatar
1 vote
0 answers
27 views

Sed command to replace values on custom lines

I'm trying to replace custom values in a configuration file using sed, but the changes should be applied for specific indexes of lines (e.g. first two lines only, line 3, etc). For now, using this ...
user avatar
  • 111
0 votes
0 answers
16 views

Find out which process creates a file/directory [duplicate]

There's a file and a directory that gets created semi-randomly and I'm struggling to find out which process is creating it. After deleting the file, it will get recreated later (more details about ...
user avatar
  • 2,541
0 votes
2 answers
118 views

Setting up env command for bash scripts

I am using Big Sur for work. I want to write a bash script that uses some modern bash features. The bash that comes with Big Sur is fairly old: $ /bin/bash --version GNU bash, version 3.2.57(1)-...
user avatar
0 votes
3 answers
269 views

zsh: command not found

I created a script , tried putting it in ~/.local/bin/script.sh and /usr/local/bin/script.sh but I get zsh: command not found: script This is my .zshrc file: cat .zshrc # If you come from bash you ...
user avatar
1 vote
1 answer
29 views

mdfind using -name option

I get this result: user@10 $  mdfind kind:application -name "Seashore" -onlyin /Volumes/WD\ Elements /Volumes/WD Elements/backup 2018/Desktop/Seashore.app /Volumes/WD Elements/backup Juli ...
user avatar
0 votes
1 answer
187 views

tar: could not chdir to 'dirname' when using -C with tar

I downloaded this file and when I try to use -C with tar to change the name of the directory it outputs to, I get this error $ tar -xvf requests.tar -C requests tar: could not chdir to 'requests' I ...
user avatar
  • 529
3 votes
2 answers
60 views

How do I get newly updated timezone data to be used, rather than the old one?

My /var/db/timezone/tz/2021a.3.0/zoneinfo was updated to version 2022a on 18 March 2022. The old one is still being read, that is 2021a. The new links are shown here:– total 0 lrwxr-xr-x 1 root ...
user avatar
1 vote
1 answer
210 views

Install Dagster on M1 MacBook

I am trying to install Dagster on my M1 MacBook Pro with pip. But keep getting these error messages. ImportError: dlopen(/Users/test/.local/share/virtualenvs/test-pRGt4I8q/lib/python3.9/site-packages/...
user avatar
  • 11
0 votes
0 answers
23 views

application start from command shortcut

Hi I'm using grandma3 and for more options like soundcodes I'm required to start from the command line. which can become quite furstrating after a while. I'd wish it could be done in a press of a ...
user avatar
0 votes
3 answers
52 views

socat UDP multicast issue on WiFi interface

I have installed socat on macOs Montery thanks to homebrew. The command: socat UDP4-RECVFROM:8888,ip-add-membership=239.255.98.99:192.168.1.100,fork,reuseaddr - doesn't retrieve any datagram (same ...
user avatar
0 votes
1 answer
27 views

Programatically disconnecting/reconnecting Yubikey device

I have a: MacBookPro 16" OS 12.3 and I have a "YubiKey 5C Nano". each time my device goes to sleep the key stops responding, and disconnecting + reconnecting is a hassle found similar ...
user avatar
0 votes
1 answer
182 views

clang showing incorrect target on M1 Mac

When I run clang --version I get this result: Apple clang version 13.1.6 (clang-1316.0.21.2) Target: x86_64-apple-darwin21.4.0 Thread model: posix InstalledDir: /Library/Developer/CommandLineTools/usr/...
user avatar
  • 1
1 vote
1 answer
51 views

Using Find, Execdir, and Grep all in one command

I'm trying to use a shell script to: return all .mov files in a given directory without path, file names only filtering out dot-underscore files from results separate each result by \n but haven't ...
user avatar
0 votes
0 answers
17 views

How can I run a script to add keyboard shortcuts on macOS?

See also: How to script a global keyboard shortcut in MacOS I like to maintain some scripts I use to set up new Macs the way I like them. One thing I would like to automate is the setting of some ...
user avatar
  • 521
1 vote
1 answer
78 views

cp seems to not allow --backup=numbered

I am trying a cp option that runs fine on Ubuntu: cp --backup=numbered src dest Is there some way to get this to work?
user avatar
1 vote
1 answer
89 views

Recursive ZIP won't work in zsh

Until catalina I used zip -r xmp.zip . -i *.xmp To add all xmp files from subdirectories to xmp.zip. Upgraded to mojave (zsh) and now it won't work anymore (return no matches found). How could I do ...
user avatar
  • 125
1 vote
1 answer
236 views

Installing Homebrew fails with "The unauthenticated git protocol on port 9418 is no longer supported"

I am trying to install homebrew to my mac with /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" but, I keep getting this amaku@Davids-MacBook-...
user avatar
  • 51

1
2 3 4 5
55