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

How do you rename multiple files by creation date from cmd or powershell? [closed]

How would I rename multiple files by the dates that they were created or last modified from command prompt or powershell?
0
votes
0answers
20 views

An unknown partition type in diskutil on Mac OS : FFFFFFFF-FFFF-FFFF-FFFF-FFFFFFFFFFFF Partition: How to Save data

I am using MacAir - Big Sur 2015 with 256 Gb hard drive. Hard Drive was portioned in 3: 2x 100GB (Main and Sub) as APFS and 1X 50 GB as ExFat to install Ubuntu. Later on, I decided to do partitioning ...
1
vote
0answers
8 views

How do I use specific Node version in current terminal window only with homebrew?

I've installed Node@10 brew previously and prefer to continue using only brew without nvm etc. All of my projects are on Node@10. Now I need to use Node@12 for just one. How do I set node version to ...
2
votes
1answer
94 views

ping: Lacking privilege for raw socket

I installed ping/inetutils via Homebrew inetutils on macOS 11.1 (20C69) Darwin 20.2.0 but can't use ping even as root: $ sudo ping 8.8.8.8 ping: Lacking privilege for raw socket. Setting S bit didn't ...
2
votes
0answers
17 views

MacPorts to automatically install dependencies

I installed 6 packages in one command, and it prompted me 6 times. I’m using Mac ports on macOS Catalina 10.15 The following dependencies will be installed: Continue? [Y/n]: Is there any command-...
2
votes
1answer
34 views

How to specify the target directory with mv?

I'm trying to move some files with GNU find on the command line, as in this answer: gfind path_A -name '*AAA*' -exec mv -t path_B {} + (added a 'g' prefix to find to use the Homebrew version of find.)...
1
vote
0answers
45 views

Symlinking only most recent file version from each subdirectory using Shell script or AppleScript?

I'm writing an AppleScript that allows me to automate the process of exporting project files. All project files are found in path: App Project Folder > Project Name Folder > Project File....
0
votes
0answers
7 views

Zoom iglasses terminal settings (not signature removal)

I have a setting in my old mac that I applied to terminal using a sudo command (not remove signature) This allowed skype and zoom to access my iglasses and epoc cam pro. Can anyone help me find this ...
0
votes
0answers
26 views

Track files transferred from unauthorized user on private WiFi

I was hacked yesterday and from what I see, it looks like it was someone who lives with me and shares WiFi. Is there a way to find on Mac where my files were sent to and the device id, type, or ...
0
votes
0answers
19 views

Is there a CLI command to “remove download” for a folder and its children?

I'm copying a bunch of files to my Mac to get them into iCloud and then I want to remove the local copy. Is there a way to remove the downloaded copy for a folder and its children so I can script this?...
2
votes
0answers
12 views

Check from command line if Docker has privacy access to Removable Volumes

I have created a shell script that starts a Docker container running some program. If the script is run on MacOS, it creates a bind mount for /Volumes so that USB drives are accessible within the ...
0
votes
0answers
17 views

How to change DNS on macOS CLI (if i don't know interface name)?

macOS (Catalina) and I want to start IKEv2 VPN client (CLI). Bad luck, ipsec can't change DNS servers. I can add UpDown script and run several commands on VPN up/down. For example, I like networksetup ...
0
votes
0answers
14 views

Framerate in command line usage of Compressor

I use Apple compressor from the command line to generate video clips from sequences of images. Here https://support.apple.com/en-gb/guide/compressor/cpsr9be73312/mac it looks like the command line ...
0
votes
0answers
23 views

Microsoft AutoUpdate: msupdate command returns “Daemon is busy…”

I use topgrade for updating my software stack. It's calling msupdate which always fails. '/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate' ERROR: No ...
0
votes
2answers
47 views

Mac daemon not able to run bash script

Originally asked on Stack Overflow, but it may be more suited for here. Wherever it’s answered first, I’ll be sure to update the counterpart question with the same answer. I've already checked this ...
1
vote
1answer
25 views

How to open firewall from terminal

I am developing a go app on a server(mac-mini) where I connect via ssh. I restart the app many times: go run main.go Problem is, that I dont have access to the graphical ui - "Firewall Options......
0
votes
1answer
39 views

Terminal can't execute files In CWD

I stated having this behaviour recently when I tried executing my sh script via sh my_script.sh. It was a simple script with some pyinstaller command. Now, the issue that I'm having is that my ...
2
votes
0answers
19 views

How to organize Launchpad apps with the command line?

Is there any way to change the order, create folders, and put apps in folder in macOS Launchpad from command line. I'm trying to automate a macOS clean install, and it's time consuming to reorder ...
1
vote
1answer
131 views

How to trigger “Get Info” for file using command line?

Similarly to running open "/Applications/Firefox.app", I would like to open the "Get Info" window of /Applications/Firefox.app using command line.
1
vote
1answer
18 views

Check if an app can read certain folders

AFAIK MacOS restricts newly installed apps from reading many folders without user permission. I know these permission are listed under System Preferences->Privacy->Files and Folders But, is ...
3
votes
1answer
161 views

How can I send rendered Markdown files to the printer from the command line?

I wrote a Markdown file which I wish to print. The rendered version, not the raw version. Printing in GUI works fine. I wish to format Mardown files with mdcat and send the result/output to printer. ...
0
votes
2answers
43 views

Is it safe to delete python and pip versions 2 and 3

Considering mac only requires version 2.7 of python, and any version of 3, is it safe to delete to delete pip2, pip3, and python3 completely from my mac when I have v3.9 and v2.7. I found them in this ...
2
votes
1answer
41 views

What is the actual difference between sh and bash?

Based on what I've read online, sh is essentially an alias for bash; running a shellscript with sh will behave the same as if it's run with bash. In my experience this is not entirely true, as ...
1
vote
1answer
23 views

LaunchAgents zip/tar not working in plist?

I created the plist for a 'custom' backup agent (via LaunchAgent). The (zip) program is called, but I keep getting a 'zip error: Nothing to do!' in my logs. I assume it has something todo with ...
0
votes
0answers
13 views

Pause and resume audio/video of application that registers with “Now Playing” widget

Often the pause key (middle key) of my headphone does not pause applications. I wonder if there is a command or applescript to pause and resume media playback for all GUI applications that shows their ...
1
vote
1answer
35 views

Simulate user login using command-line utilities

Sometimes, I need to create a login session (create windowserver instance, run login items / launchagents) of an admin user, because a lot of software cannot be run under root (but can be run as ...
2
votes
1answer
22 views

open dict://“$word” stopped working for Chinese after upgrading to Big Sur

Not sure if this question is appropriate for this forum. If not, please let me know, and I will remove it (if I can). I have a shell script open dict://"$word" that worked well in Catalina ...
0
votes
0answers
22 views

Why do some commands 'hang' the terminal until attached storage spins up?

I have wondered this for a while and haven't found an answer. I open terminal and enter a command and before the command returns a result my external HDD spins up. The OS is not running off that HDD. ...
2
votes
2answers
51 views

How do I force my Mac to log in to an account remotely?

It’s possible to restart a Mac from the command line (sudo shutdown -r now). It’s possible to log out from a Mac from the command line (sudo pkill loginwindow). But is it possible to force a Mac to ...
0
votes
0answers
24 views

“brew bundle dump” shows casks not installed - how can i fix this inconsistency

I generate a list of all installed software brew bundle dump --force xcrun: error: active developer path ("/Applications/Xcode.app/Contents/Developer") does not exist Use `sudo xcode-select -...
0
votes
1answer
47 views

Detect whether clipboard item is image data using AppleScript

This started because I wanted to be able to paste screenshots or pictures copied from Safari into Finder folders. Here are the steps to get to where I am: Install pngpaste using brew install pngpaste....
0
votes
0answers
7 views

How to uncheck “When switching to an application, …” Mission Control option from command line

How can I uncheck the option in System Preferences -> Mission Control -> When switching to an application, switch to a Space with open windows for the application via command line, with the ...
0
votes
0answers
21 views

bash (and others) do not receive ^O [duplicate]

Under Terminal.app and iTerm2, the key combination ^O is not received by many terminal programs. For example, /bin/bash does not receive ^O. Indeed, if /bin/bash could receive ^O, then ^V^O would ...
0
votes
1answer
42 views

Setting Safari preferences from script on Big Sur

I have a Mac mini 2020 with an M1 processor and running macOS Big Sur. On older macs I had this script to set Safari preferences # Show status bar defaults write com.apple.Safari ShowStatusBar -bool ...
2
votes
1answer
64 views

Why does Terminal not honor preferences?

Sometime in the last week my Terminal stopped honoring the "New tabs open with: Same Working Directory" setting. Testing with "New windows ..." gave the same result. My shell is ...
0
votes
0answers
15 views

How to allow accessibility permissions from command line [duplicate]

I can give accessibility permissions to some programs by going in System Preferences -> Security & Privacy -> Accessibility, and manually adding the programs one by one. Is there a way to do ...
3
votes
1answer
32 views

Access user folders via Terminal

When I am using Terminal to go to different folders such as Documents, Downloads, Photos etc I get presented with a dialog requesting me to grant Terminal access to these folders such as below: Is ...
1
vote
1answer
21 views

CLI unable to access files on external disk

I have an external disk onto which I backed up my macOS 10.13 laptop, and now I want to pull some of the files off to use on my newer macOS 10.15 laptop. I can both see and open (read/write) the files ...
-1
votes
1answer
57 views

Is there any command to check if a download is in progress on macos?

I want to know if there's a command that let's me monitor whether a file is being downloaded on my mac. I used to use the netstat -s followed by a grep to find all the connections established but ...
8
votes
5answers
3k views

I accidentally used “touch ..” , is there a way to safely delete this document?

I am using zsh, macOS 11.0.1 (Big Sur), was working on a project and for some stupid reason I decided to write touch ... A file was created in the Desktop so I don't think that it will affect the ...
2
votes
1answer
36 views

Alternative Notification System for Macos || Program or CLI to Display Image/Emblem/Icon at corner of screen (no text or box)

I am hoping there is some kind of alternate notification system available for macos as a program or a cli. I don't mind paying. I have created vim bindings with karabiner that work anywhere on macos, ...
0
votes
0answers
4 views

Resume audio recording

is there a command I can use to resume recording (audio/video) even when the lids are closed? Even though I used sudo pmset disablesleep 1 in order to disaple sleep when the lid is closed, the ...
4
votes
2answers
1k views

AMSupportURL* “is implemented in both”?

I get the below error message when I run git for the first time after a reboot: objc[728]: Class AMSupportURLConnectionDelegate is implemented in both ?? (0x1eff3a7a0) and ?? (0x1188402b8). One of the ...
0
votes
1answer
39 views

inconsistent results for basename?

In the following, why is the third instance of basename including the file's enclosing directory? WGroleau@MBP Music % basename Korean/kr_audio.tbz kr_audio.tbz WGroleau@MBP Music % basename ./Korean/...
7
votes
1answer
752 views

How to determine if a MacOS program on Apple Silicon is emulated x86 or native ARM from the command line?

I have an M1 MacBook Pro and have downloaded both some native (ARM) and x86_64(Rosetta 2 emulated) binaries. How do I determine from the command line which of these ISAs a particular binary file is? ...
0
votes
1answer
53 views

Change Mac terminal name after the @ symbol

I just bought the new Mac mini, this is my first owned Mac. I decided to use the terminal and it shows my name but also my girlfriends name after the @ symbol. I don't know how this happened and what ...
1
vote
0answers
57 views

kitty terminal emulator problems with national characters

I am using the Kitty terminal emulator on three different machines, all using the same .bash_profile and kitty.conf, and all running macOS 11.0.1 Big Sur. One of the machines (Mac mini M1) does not ...
0
votes
1answer
45 views

How do I install p4v (previously p4merge) as my git difftool on macos catalina 10.15.3

Ive found these instructions for setting up p4merge as my git difftool (I've not been able to test these instructions): brew cask install p4merge git config --global diff.guitool p4mergetool git ...
4
votes
2answers
300 views

How do I use zsh to pipe results from one command to another (while in a loop)?

macOS 10.14.6 zsh 5.8 jq 1.6 I have a situation where I have a bunch of .vital files, which are JSON files in disguise. I want to extract one piece of information from each file, and I have worked ...
12
votes
1answer
2k views

Is there a way to tell which files I accidentally renamed to *.jpg aren't actually JPEG images?

I have a folder with many thousands of files, which due to an error had their extensions misnamed, all files now have the .jpg extension. In all the .jpg files I would like to find the non-image files....

1
2 3 4 5
47