Skip to main content

Questions tagged [macos]

macOS (previously "Mac OS X" and "OS X") is the Unix developed and distributed by Apple Inc. since 2001.

Filter by
Sorted by
Tagged with
0 votes
1 answer
17 views

How to verify downloaded Fedora installation file against the checksum files?

I have downloaded Fedora to my macOS Catalina. I then followed the steps outlined here to verify the downloaded file against the checksum files. Step 4 says to run the following command: sha256sum -c *...
Evan Aad's user avatar
  • 103
0 votes
0 answers
14 views

macos/bash: read "hangs" when executing script second time as another user with stdout redirected before

Hello! My second file descriptors question. Context: Still new at this, I certainly don't get file descriptors. Magic. Unpredictable magic at that, that sometimes works. (joke, but you probably get my ...
Marcus Widerberg's user avatar
0 votes
1 answer
87 views

Mac/Linux command to get device name from IP address using mDNS

I need a command to get the hostname of a device on the network from the IP address, using multicast DNS. I used to use the dig command which worked perfectly on both macOS and Linux, and many ...
htmlcat's user avatar
  • 151
2 votes
1 answer
91 views

What is the limit of string size passed to bash -c?

I have the following command echo '123456789#' | xargs -I% bash -c 'echo %%%%%%%%%%%%%%%%%%%%%%%%%' It doesn't expand the last %. Apparently there's a limit on how long the string passed to bash -c ...
gicig's user avatar
  • 121
-1 votes
1 answer
68 views

To execute a shell script: Using "zsh script.sh" and using "./script.sh" [duplicate]

To execute a random shell script, e.g. script.sh that contains only a single line echo 'foo', I can use zsh script.sh, and this works. But if I try to execute the same file using the dot syntax ...
jsx97's user avatar
  • 71
-1 votes
1 answer
36 views

MacOS: I have a home directory within my home directory

I have never seen my home directory in my home directory until recently. Is this something I need to be worried about? I do not know if this is something problematic.
Boltzmann's user avatar
1 vote
2 answers
60 views

rm on symlinks works different on Mac

The following commands behaves different between Linux and Mac: mkdir tmp ln -s tmp symlink rm -rf symlink/ On Linux, the content of tmp folder is deleted but the folder itself remains, while on Mac ...
Andrés Esguerra's user avatar
0 votes
1 answer
43 views

Salesforce dataloader #!/bin/bash script errors mentions .zshrc

I'm trying to run a certain application (Salesforce dataloader v61) on MacOS. The entry point is a bash script: #!/bin/bash DL_INSTALL_ROOT="$(dirname "$(readlink -f "$0")")&...
Al Cher's user avatar
  • 101
0 votes
2 answers
55 views

Macbook air boots directly to grub menu, can't access BIOS or Boot menu anymore

Running Macbook air 2017 with inuxmint 21.1 xfce, even if I press alt key or alt+e or command+alt+r while booting, it jumps directly to grub menu and i can't access BIOS or boot options. I can't even ...
kan's user avatar
  • 1
1 vote
1 answer
40 views

What is the header/certificate format used in /etc/ssl/cert.pem?

When exporting the certificate from a server I'm using via openssl s_client -servername my_server -connect my_server:443 | openssl x509 -text I get a header with lots of data about the certificate, ...
rbanffy's user avatar
  • 1,218
0 votes
0 answers
63 views

USB passthrough in Android emulator on MacOS M1 failing to acquire exclusive access

I am trying to get my Android emulator to see the Wi-Fi dongle or my Ethernet dongle connected over USB to the Macbook Pro M1. I tried the following methods: Command: ./emulator -avd MyTestEmulator -...
HackX123's user avatar
0 votes
2 answers
245 views

zsh: command not found: yt-dlp

The standalone executable yt-dlp recommended for macOS suddenly stopped working. I used it two weeks ago and it worked. I have not had any updates to my system, expect some brew updates/upgrades. ...
Kamil's user avatar
  • 7
0 votes
3 answers
81 views

Extract YouTube video IDs from the end of filenames

I downloaded some files from YouTube a while back with the YouTube IDs in their names. My problem is that some IDs contain a character that also marks the beginning of the ID itself. $ ls *.mp4 | head ...
Joshua Briefman's user avatar
1 vote
0 answers
33 views

QEMU, Debian VM doesn't boot after shutdown on M1

On M1, I 'm trying to run a Debian 12 VM. After the installation process, whether configured using a deb_preseed.cfg (within the Automated Install) or through the GUI configuration, it fails to run (...
szr's user avatar
  • 11
1 vote
1 answer
49 views

How to find file names with non-printable characters using BSD `find -regex`?

Some folders on macOS have custom icons that are stored in a file named Icon?, where the ? is actually a CR character, and only prints as "?" in most cases (in Terminal and Finder). But when ...
Thomas Tempelmann's user avatar
0 votes
0 answers
23 views

How to modify prompt in macOS terminal?

Stupid question, but how would I remove the following from my macOS terminal? (xyz) abc@defgh~% I want to get rid of (xyz). How would I do it?
newuser90's user avatar
0 votes
2 answers
51 views

How can I only execute sed commands after so many pattern matches in macOS?

I have a file that contains the same pattern multiple times. I am trying to get sed to perform a series of operations only for the second occurrence of that pattern. The file looks like this: pattern ...
Felipe Evaristo's user avatar
0 votes
1 answer
55 views

What does a leading colon in a sh script line means? [duplicate]

Looking inside macOS Homebrew installed cask Emacs file named emacs-nw used to start Emacs in terminal mode, I see the following script (see below). What does the colon (':') at the start of the line ...
PRouleau's user avatar
  • 171
3 votes
4 answers
1k views

Rename files to random filenames (but not to checksums)

Sometimes I need to batch rename files on a macOS system to random or pseudo-random filenames, eight lowercase letters and digits only, e.g. from mcmurdo-station.png to something like a12bc0xy.png. ...
jsx97's user avatar
  • 71
3 votes
1 answer
370 views

cp -P * vs. cp *(.) vs. cp *(-.)

According to man cp, using cp -P * foo/ means that no symbolic links will be followed: -P: No symbolic links are followed. This is the default if the -R option is specified. But how to copy files in ...
jsx97's user avatar
  • 71
3 votes
1 answer
167 views

Replace any number of spaces with a single underscore

How it is possible, using zmv, to replace any number of spaces with a single underscore? What I use currently is zmv -- '* *' '$f:gs/ /_' but it replaces each space, and so foo bar.txt become ...
jsx97's user avatar
  • 71
2 votes
1 answer
252 views

Does 'ls' ignore Zsh glob sorting qualifiers?

I try to understand how to use Zsh glob qualifiers with ls. An article on the internet says that to sort the files from largest to smallest, I can use ls *(oL). o<sort> - Sort files depending ...
jsx97's user avatar
  • 71
0 votes
1 answer
96 views

Understanding the '-a' option of the 'cp' command

From man cp, abridged: -a: Archive mode. Same as -RpP options. Preserves structure and attributes of files but not directory structure. -R: If source_file designates a directory, cp copies the ...
jsx97's user avatar
  • 71
0 votes
1 answer
92 views

To fix the 'locate' database. And to properly update it

I tried to update the locate database, and for some reason it has been corrupted: locate foo locate: locate database header corrupt, bigram char outside 0, 32-127: -1 How to repair it? Or maybe I ...
jsx97's user avatar
  • 71
0 votes
1 answer
68 views

zsh globs: permission denied

You likely don't need find if you're using Zsh. Zsh globs can do most of what find can do through its recursive globbing, extended globs and glob qualifiers. For example, your find ./test-folder -type ...
jsx97's user avatar
  • 71
0 votes
1 answer
58 views

Aliases working in subjective conditions on Mac

I'm currently working on a dotfiles configuration (which runs zsh) which I've been using on my mini home server and and Linux CLIs on my PC. I've also utilised it on my work Macbook which runs MacOS, ...
Maabat's user avatar
  • 3
1 vote
1 answer
32 views

Relaunch a terminal using a terminal command

Today, to convert from Markdown to PDF using Pandoc, it was necessary to install pdflatex. I did brew install basictex and then it was necessary to relaunch Terminal. For this, I simply closed it and ...
jsx97's user avatar
  • 71
0 votes
0 answers
9 views

How to use ctrl and command hot keys for deleting entire lines, words in macbook terminal?

I don't know what this feature is called, but in text editors, word documents, pretty much everywhere you can type text, and even here on stackexchange, I can press command + delete to delete an ...
roulette01's user avatar
6 votes
2 answers
579 views

macOS find with "-f path" doesn't work?

man find: -f path: Add path to the list of paths that will be recursed into. This is useful when path begins with a character that would otherwise be interpreted as an expression, namely “!” , “(” ...
jsx97's user avatar
  • 71
0 votes
0 answers
7 views

can't install gmdb2 using macports on Sonoma

I can't install gmdb2 using MacPorts on Sonoma 14.4.1 I try aladino@pc-23 ~ % sudo port install gmdb2 but I get ---> Computing dependencies for gmdb2 The following dependencies will be ...
Steve-no-Jobs's user avatar
0 votes
1 answer
200 views

crontab /bin/zsh: can't open input file: test.sh

I am trying to create a crontab to run a script: * * * * * cd /Users/test3/Desktop/Scripts/backup/ && /bin/zsh test.sh > /tmp/cron-output.log 2>&1 where test.sh is in /Users/test3/...
Mihail's user avatar
  • 41
0 votes
0 answers
20 views

autoconf error in trying to run TPM2.0 simulator on M1 Mac

I'm trying to run a TPM2.0 simulator on macOS Sonoma (14.2.1) using Official TPM 2.0 Reference Implementation (by Microsoft) and it seems to be failing at generating a make file for executing. This is ...
scottstots's user avatar
0 votes
1 answer
52 views

Open file manager to prompt user for file

I am writing a shell script that is meant to prompt the user for a file, and since I do not expect the end user of my script to be tech-savvy, rather than starting command line for interaction, I ...
fja's user avatar
  • 3
1 vote
3 answers
461 views

How to sort files by size in bash script?

I want to loop over all files in directory on macOS and perform some operations on each file, and do this based on their size, going from big to small. To create a list I can loop over I do this: ...
d-b's user avatar
  • 1,947
1 vote
1 answer
23 views

Maintain position in terminal command history on macOS?

I enter many commands into the terminal. I enter command a, then b, then c, etc. I'm on command g now but I want to execute a, then b, then c, again. I press up (g), up (f), up (e), up (d), up (c), ...
Mario's user avatar
  • 163
1 vote
0 answers
31 views

Can a shell opened via SSH "inherit"/use the same environment as a local shell? Non-interactive shell on MacOS can, "sometimes", not access Keychain

I use Pushbullet and a third party Python script that allows me to send "pushes" from the command line. This script uses MacOS "Keychain" to access passwords and tokens used for ...
d-b's user avatar
  • 1,947
0 votes
0 answers
27 views

How to correct this script to detect OS type? [duplicate]

I'm trying to modify a Makefile so I can easily run my app by make run run: OUTPUT=${uname -a | awk '{ print tolower($1)}'} bin/${OUTPUT}_${ARCH}/${APP_NAME} Running uname -a | awk '{ print ...
anta40's user avatar
  • 421
3 votes
1 answer
387 views

Piping live sound from raspberry pi to macOS

I want to pipe and live play the sound recorded on my raspberry to my MacBook. I've tried the following: On My raspberry: I tried to establish a data stream on a port 3333 arecord -D plughw:3,0 -f ...
zahntheo's user avatar
0 votes
1 answer
97 views

Why has rsync created many hidden files that duplicate my real file names?

I have a directory that I periodically rsync to via rsync -rva. Today I found out that for many files that I have, eg path/to/S00041.jpg, I also have an empty file with the name path/to/._S00041.jpg ...
loxs's user avatar
  • 103
1 vote
1 answer
61 views

Understanding effect of redirecting output of a function call that makes variable mutation not visible

I observed a weird behavior in zsh 5.9 in mac. (Following is a simplification to reproduce the error, it does not try to make sense). If I execute in a terminal $> function assigner() { OPTIONS=...
Whimusical's user avatar
5 votes
1 answer
424 views

Why does env -S with quoted strings in the shebang line work fine in Ubuntu but not in macOS?

I have the following script in an executable file test-shebang.mjs and I wanted to use zx to run my script but have my ~/.zshrc be sourced before that: #!/usr/bin/env -S zsh -c 'source ~/.zshrc; zx --...
runofthemillgeek's user avatar
1 vote
1 answer
47 views

Skip .app folders when using "fdupes" with the option "--recurse"

I am using fdupes to print the list of duplicate files in a certain folder, with the option --recurse. However, since I am using macOS, the recursing process regards Mac apps (which appear to be ...
Jinwen's user avatar
  • 113
0 votes
1 answer
44 views

Using find with regular expression

I try to understand how to use the find command with regular expressions (macOS 14.4.1, Zsh 5.9). I have a directory with files such as note-red.png, note-yellow.png, (and other colors), folder-red....
jsx97's user avatar
  • 71
1 vote
1 answer
50 views

Why do these 2 zsh inline commands return different results (Mac OS Sonoma)?

So I've been playing around with merging "dot_bar" files in mac OS into their core file. One thing I wanted to do was to find all the "dot_bar" files on my Mac (M1 MacBook Air). ...
DownUnder62's user avatar
1 vote
2 answers
133 views

pipe or redirect output from curl to ssh command

I'm pretty sure this isn't possible, but I have been wrong in the past. Basically, what I'd like to do is take the JSON output from a curl command and pipe it to jq for prettiness. Which works fine. ...
supradave's user avatar
0 votes
1 answer
84 views

Where/How does socat insert packet boundaries?

I am using socat to forward incoming serial traffic to a local UDP port (on macOS): socat OPEN:/dev/cu.usbmodem13203 UDP:localhost:12345 I consider a serial device being a streaming interface while ...
Binabik's user avatar
  • 363
1 vote
1 answer
62 views

Unable to read more than 1024 chars on ZSH + MacOS

Trying to read a long input into a variable from ZSH on MacOS. echo "URL: " read URL input is always truncated to 1024 chars... if I try and type additional chars nothing happens. ...
SoonGuy's user avatar
  • 131
0 votes
1 answer
34 views

Delete multiple extended attributes (but not all of them) in one step

For example, I have a file with three extended attributes: com.apple.FinderInfo com.apple.metadata:_kMDItemUserTags com.apple.metadata:kMDItemFinderComment I can delete the first two using xattr -d ...
jsx97's user avatar
  • 71
0 votes
0 answers
41 views

ls: single-column vs. multi-column layout, non-Unicode characters in filenames

Create a directory ~/test with abcdefghijklmnopqrstuvwxyz and zyxwvutsrqponmlkjihgfedcba files in it. ls ~/test will list them using multi-column layout: abcdefghijklmnopqrstuvwxyz ...
jsx97's user avatar
  • 71
1 vote
0 answers
48 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
  • 71

1
2 3 4 5
19