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
1 answer
18 views

tmutil delete returns error 22 while deleting backups in external drive to free up space

$tmutil listbackups /Volumes/.timemachine/96F5062D-1718-4C7F-A137-D0C6EC70AF68/2023-12-26-145443.backup/2023-12-26-145443.backup /Volumes/.timemachine/96F5062D-1718-4C7F-A137-D0C6EC70AF68/2024-01-04-...
massisenergy's user avatar
0 votes
1 answer
22 views

How can I mount a TimeMachine Backup snapshot in the Terminal via mount_apfs?

I backup my Apple Silicon Mac (running macOS Sonoma) to an external, directly attached drive via Time Machine. All backup snapshots on that external drive I can list via $ ls -1 /Volumes/.timemachine/...
halloleo's user avatar
  • 1,345
0 votes
1 answer
53 views

How to replace functionality of deprecated `airport` command line application?

I am the author of the wifi-wand Ruby gem and command line application that reports and modifies wifi networking information on the Mac (https://github.com/keithrbennett/wifiwand). The airport utility ...
Keith Bennett's user avatar
4 votes
3 answers
292 views

Where's the `info` command in recent macOS versions?

I used to read info bash, using the info utility, but that seems gone now and it's extremely hard to search for any info (pun intended) about it. Any alternatives? Pointers? I'm using Sonoma 14.4.1, ...
Ionuț G. Stan's user avatar
1 vote
1 answer
65 views

How to install official python releases in MacOS without using the GUI

How do I install the release from python.org on my MacOS? I downloaded the latest release of Python from the official website, verified the PGP signature, and now I want to install it -- but how? user@...
Michael Altfield's user avatar
14 votes
3 answers
7k views

I think I downloaded spyware! I used a curl command in terminal given by a fake support user to download a .sh file

I completely fell for a scammer helping me debug an issue. I ignored all the warnings until it was too late... I entered the below command in my macbook terminal and it downloaded a .sh file on my ...
Creole's user avatar
  • 141
0 votes
1 answer
36 views

How to exclude a folder from `find`?

In a MacOS terminal I am trying to find files with the find command and to exclude the folder .Spotlight-V100/ . I tried find . -name .Spotlight-V100/ -prune -o -type f and find . -path .Spotlight-...
Alex's user avatar
  • 2,334
1 vote
1 answer
46 views

Is there any way to prevent a non-admin user from executing "launchctl unload" on macOS?

I started using a well-known program for self-control on MacOS called Cold Turkey. This program is very powerful, but it's not enough since I can open a Terminal as a non-admin user and execute the ...
Alfred's user avatar
  • 11
0 votes
0 answers
30 views

How do you trigger a CSV export of iCloud Passwords from the command line?

Since macOS Monterey, you can export your iCloud passwords to CSV through the 'Export All Passwords' action in System Preferences > Passwords. Is there a way to trigger this export from a script or ...
Remko's user avatar
  • 101
0 votes
2 answers
32 views

Mac screen sleeps shortly after Mac woken by pmset

I am waking my Mac mini (M2)every morning with the command: sudo pmset repeat wake MTWRFSS 6:59:50 but after a few seconds the screen goes black. In System Settings/Lock screen I have: Start Screen ...
bayswaterbill's user avatar
3 votes
3 answers
227 views

Can anyone improve my batch rename script to make it recursive?

I have a Synology NAS that went nuts and it's full of .tmp files that used to be Excel, PDF, Word, etc.,... I have this script that works fine inside a folder. I've searched for days before asking ...
manuchap's user avatar
11 votes
3 answers
5k views

Is it dangerous to leave “.DS_Store” files left in Git commit history?

I forgot to add it to my .gitignore and although I've added .DS_Store to my .gitignore now, I was wondering if it was dangerous to leave for anyone to see in my Git commit history? I'm not asking if ....
chung's user avatar
  • 213
0 votes
1 answer
33 views

Oh My Zsh + iterm2 - Wrong characters showing

I'm using the iterm2 with omz - version "master (130002a)". From the last update versions, it's started to show strange characters. I've already tried to set different fonts, etc., and also ...
ldpereira's user avatar
2 votes
1 answer
90 views

How to make Homebrew directories writeable by multiple users?

I have two users on my Mac. Both are admins. One which can only access certain things which I use for doing work, and one general purpose. I program in both modes often, but I need to use homebrew ...
lgreenwood_fau24's user avatar
1 vote
2 answers
43 views

Trying to merge multiple folders - I messed up

I wanted to merge multiple folders into one, so I used this command in terminal: cd containing_folder mv */* . Well that didn't really go as planned and resulted in lots of folders being moved to my ...
mixyy's user avatar
  • 11
1 vote
1 answer
35 views

Why is brew trying to install a dependency that is already installed?

Why does brew attempt to download a dependency (and fail) when that dependency is already installed? I'm trying to install a python bottle from homebrew on a system that does not have Internet access. ...
Michael Altfield's user avatar
1 vote
1 answer
41 views

Where are the TimeMachine Backup snapshots in Terminal on macOS Ventura?

I have set up a new Apple Silicon Mac and attached an external drive as Time Machine. The Time Machine drive I can see in Terminal as $ ls -1 /Volumes ... Persistently ... And in Finder I can in the ...
halloleo's user avatar
  • 1,345
0 votes
0 answers
17 views

How to force brew to install from local bottle (without git clone github.com/build/homebrew-deps)

My goal is the have brew skip trying to make calls to the Internet when installing local cached bottles. I have downloaded the brew bottles for python and the python module virtualenv. user@host ~ % ...
Michael Altfield's user avatar
1 vote
1 answer
52 views

Disabling services (daemons, agents) with launchctl

I want to get rid of some system services completely. I turned off sip with csrutil disable. Then following command sudo launchctl disable com.apple.cloudphotod Gave me an unexpected answer: ...
Andrew Orlow's user avatar
1 vote
0 answers
59 views

How can I use launchctl to send a signal to a service?

As you can already see in the text below and screenshot of the terminal, whenever I try to send a signal to a service I have given Not privileged to signal service. and Could not kickstart service &...
Gurhan Polat's user avatar
-1 votes
1 answer
40 views

Issue with running SH file [closed]

I am trying to run the file run.sh with the command sh run.sh However, I get the error of permission being denied whether I use sudo or not. shloakagrawal@shloaks-air EaglerGradle-1.0 % sudo sh run.sh ...
Buddy Agrawal's user avatar
7 votes
3 answers
482 views

Link command in terminal vs ln vs symbolic link (ln -s) differences between them?

I've learnt about aliases and symbolic links ages ago, but only recently learnt of the link command from symbolic link vs. alias Is the link command in terminal on my MacOS - version is Sonoma 14.4.1 ...
avenas8808's user avatar
1 vote
0 answers
18 views

Changing MacOS guest user settings via terminal

I'm currently attempting to set up some shared Mac devices with a guest user through an MDM (Kandji). Ideally, this needs to be done remotely, which can be done through the MacOS terminal. By default, ...
MrGarlic's user avatar
0 votes
0 answers
27 views

Column explanation for netstat open UDP sockets

When I run netstat -v -a -p udp to show the open UDP sockets, I get the following output(truncated): Active Internet connections (including servers) Proto Recv-Q Send-Q Local Address Foreign ...
Garuno's user avatar
  • 61
0 votes
0 answers
13 views

Any way to add playlists with Apple Music streaming content to Apple Music library from command-line?

It's straightforward to add m3u playlists of locally-stored files to the Apple Music app from the command-line. Is there any way to create and add a playlist of streaming content to the library, for ...
ajkessel's user avatar
0 votes
1 answer
33 views

otool shows only single architecture for system fat binaries in macOS

File (cmd tool) shows /bin/ls is a fat binary on macOS (Sonoma 14.2.1 on Apple M1) and otool -f confirms that: % file /bin/ls /bin/ls: Mach-O universal binary with 2 architectures: [x86_64:Mach-O 64-...
mrn's user avatar
  • 111
0 votes
1 answer
54 views

How to force brew to install from local formula (without internet access)

How can I tell brew to skip trying to make calls to the Internet when installing locally? I have downloaded the brew formula and bottle user@host ~ % ls wget-1.24.5.json wget-1.24.5.rb wget-1.24.5....
Michael Altfield's user avatar
1 vote
1 answer
24 views

Make a login/logout script in mac [duplicate]

What would be the best way to log login, logout and the user that is logging into the mac? I have some machines which I control from remote desktop. I want to monitor who is logging into them and what ...
Saikat Karmakar's user avatar
1 vote
1 answer
71 views

how to install SBCL on Apple Silicon without brew and without sudo / admin?

I have an Apple M1 macbook pro in which I want to use SBCL for Common Lisp but without homebrew. The official SBCL page says one way is to build SBCL from source, though you need to bootstrap that ...
xdavidliu's user avatar
  • 1,086
0 votes
0 answers
18 views

Enabling TrueColors in Apple MacBook Pro M2 with Alacritty

I'm trying Alacritty on MBP M2 connected to a Lenovo 4K monitor. I wanted to enable True Colors support as indicated as one of the salient features of the software. My minimal YAML configuration and ...
Inian's user avatar
  • 73
1 vote
0 answers
13 views

How to, from command line terminal, add system voices and download them in addition to selecting them as the default for MacOS Sonoma?

How to, from command line terminal, add system voices and download them in addition to selecting them as the default for MacOS Sonoma? How can I get access without coding to the plist that has the ...
Shyamal Chandra's user avatar
1 vote
1 answer
27 views

What happens to existing files when changing the mount points of volumes?

On 7/17/17 @bingbomboom asked this question about creating a permanent /etc/fstab entry for an external drive. My head spun thinking about this next question. Instead of hijacking its thread, I'm ...
The DOuGTrainer's user avatar
1 vote
0 answers
20 views

how can I find with mdfind a file which starts with DZ and ends with .zip [duplicate]

I want to find out with mdfind where on my file system a file is located that starts with DZ and ends with .zip. I tried mdfind -name 'DZ*.zip' but this does not return any results. How can I ask ...
halloleo's user avatar
  • 1,345
1 vote
1 answer
40 views

running app as a different user

I want to start app N as user U2 while logged in as user U1. The idea is U2 is less privilidged than U1, thus it would be safer to run suspicious apps. Is it possible? I tried su U2; cd /...
Earnest Frankly's user avatar
4 votes
2 answers
441 views

To copy a file and preserve its comment

Is it possible to copy an individual file and preserve its comment? Here is what I have tried. Nothing here works for me on macOS 14.3.1 and Zsh 5.9 (x86_64-apple-darwin23.0). cp file.txt file-copy....
jsx97's user avatar
  • 345
0 votes
1 answer
54 views

ls -g: 'man ls' says -g option has no effect, but it works

macOS 14.3, zsh 5.9 (x86_64-apple-darwin23.0). man ls: -g: This option has no effect. It is only available for compatibility with 4.3BSD, where it was used to display the group name in the long (-l) ...
jsx97's user avatar
  • 345
5 votes
3 answers
3k views

Did this command do anything to my Operating System?

I was just trying to type in this command: echo "export PATH=$PATH:~/Desktop/nand2tetris/tools" >> ~/.zshrc ; source ~/.zshrc But I got to echo "export PATH=$PATH:~/Des before I ...
AsianDora's user avatar
0 votes
1 answer
47 views

nano only opens the first file given on the command line

Setting up a new MacBook. I like to use pico, so I always remember to add export EDITOR=nano alias pico=nano alias pcio=nano alias pioc=nano to my .profile. But I'm still missing something that I ...
Quuxplusone's user avatar
2 votes
1 answer
65 views

cp, trailing slash, and copying to the same vs. to another directory

To copy a directory to another directory, the first directory should be written without the trailing slash: # example 1 # this command will copy dir1 to dir2 # (dir2 is preexisting) cp -Rip dir1 dir2/ ...
jsx97's user avatar
  • 345
14 votes
3 answers
1k views

How are directory contents determined in Finder?

Specifically I'm asking about the mechanism where Finder will show entries that do not exist in the directory on the filesystem as shown by the terminal. Example 1: /Applications shows App Store.app ...
MacBeth's user avatar
  • 141
0 votes
0 answers
15 views

tail: /var/log/snmpd.log: Operation not supported on socket

OS: MacOS Catalina I've already tried kill -s INT syslogd and logd and also loading and unloading snmpd but still cannot open the file: cat /var/log/snmpd.log cat: /var/log/snmpd.log: Connection ...
mariano-daniel's user avatar
0 votes
1 answer
57 views

Can somebody explain why two users are logged in?

Apparently in my terminal a new "user" appeared. (Sorry for my language but I'm not really familiar with terminals and this stuffs). What I mean is that in the upper part of my terminal, ...
Andrea's user avatar
  • 3
0 votes
0 answers
15 views

Terminal user@location is using AppleTV and not computer [duplicate]

I opened terminal this morning after I turned on my computer from a shut down. Normally the terminal starts with username@computerName. This time it's username@appleTVname. I can't figure out how to ...
christine's user avatar
0 votes
1 answer
63 views

Homebrew: How-To forbid a specific package to be installed?

Can I configure brew to never install a specific package even if it is required by another package I install? I do not want to accidentally install any software that has a dependency on Java, i.e. ...
Sybil's user avatar
  • 3,937
0 votes
0 answers
65 views

Two versions of ruby installed

It seems like I have two versions of ruby installed. (3.3.0 and 2.6.10.210) How to fix that? peter@mac ios % sudo gem update --system Password: Updating rubygems-update Fetching rubygems-update-3.5.6....
Grim's user avatar
  • 123
2 votes
2 answers
343 views

How do I restore a plist on another Mac?

I would like to transfer a configuration from one Mac to another using the defaults command within BASH. On one Mac, I can save the configuration by doing: defaults read edu.ucsd.cs.mmccrack.bibdesk &...
Jim L.'s user avatar
  • 550
1 vote
2 answers
99 views

Problems with Python on macos Ventura

So I updated my mac a while ago to ventura 13.3.1 and ever since it messed up my python path, I can't use Pycharm (it can't locate a valid interpreter path), and I can't use pip as well. When I try to ...
ClovisIRex's user avatar
0 votes
1 answer
127 views

How did my hostname change? Where can I see this change being made/what time it changed? [duplicate]

today I logged into my mac and opened zsh and had a big shock! Normally my terminal prompt is something like: sidharthghoshal@macbook-pro But today I found it was : sidharthghoshal@HaeLims-Air I don't ...
Sidharth Ghoshal's user avatar
0 votes
0 answers
16 views

Wrapper around ssh causes AppleEvent handler to fail

I have the script that I've pasted lower down in my path and named ssh. The idea is that it changes the colour of the terminal based on which host I'm ssh-ed into. This worked fine for a long time, ...
thornate's user avatar
  • 101
-1 votes
1 answer
38 views

Zabbix agent daemon does not pickup a PID

(I've searched similar cases and could not find any) I've installed Zabbix agent daemon for MacOS. I'm running it on Catalina. The daemon ran just fine on installation, however after a while it ...
mariano-daniel's user avatar

1
2 3 4 5
64