macos

zsh globs: permission denied

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 f -name ‘*.txt’ is just ./test-folder/**/*.txt(D.) D to include hidden files to match find‘s default behaviour. You …

Total answers: 1

Aliases working in subjective conditions on Mac

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, but noticed I was running into some weird issues. (($+commands[terraform])) && …

Total answers: 1

Relaunch a terminal using a terminal command

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 opened it again. But is it possible to relaunch it using a command, …

Total answers: 1

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

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 “!” , “(” and “-”. But why find ./test-folder -type f -name ‘*.txt’ works, …

Total answers: 2

Open file manager to prompt user for file

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 would like the shell to be able to …

Total answers: 1

Maintain position in terminal command history on macOS?

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), up (b), up …

Total answers: 1

Piping live sound from raspberry pi to macOS

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 S16_LE 44100 -t raw | nc -l -p 3333 …

Total answers: 1

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

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 at the rsync destination. I imagine they …

Total answers: 1

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

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 folders ended with .app) as folders and runs into them, …

Total answers: 1

Using find with regular expression

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.png, folder-yellow.png, (and other colors), but the following commands don’t show any results when executed in that folder. What I’m …

Total answers: 1

Where/How does socat insert packet boundaries?

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 UDP is packet-based so there exists no definitive right answer where or how to introduce packet boundaries. In my test, …

Total answers: 1

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

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 com.apple.FinderInfo file.txt xattr -d com.apple.metadata:_kMDItemUserTags file.txt But I would prefer to not invoke xattr multiple times, and to use something like …

Total answers: 1

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

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/ Otherwise, the command will copy directory contents …

Total answers: 1

Find all the folders that are concealed using 'chflags'

Find all the folders that are concealed using 'chflags' I have concealed some folders on my laptop using chflags: chflags hidden hide-me And I don’t remember where exaclty these folders are located. How is it possible to find all of them? (Probably by using find and/or grep.) Asked By: jsx97 || Source Something like that: …

Total answers: 1

Difference between cp and cp -rf on a Mac

Difference between cp and cp -rf on a Mac Could anybody explain is there any difference between cp some-file.txt some-folder and cp -rf some-file.txt some-folder on a Mac? I was told that cp -rf forces cp to overwrite existing files, but it seems it overwrite them even without -rf. So what is the reason to …

Total answers: 1

i am getting error : fatal error: 'openssl/sha.h' file not found while installing mongodb in mac m1 for the laravel project

i am getting error : fatal error: 'openssl/sha.h' file not found while installing mongodb in mac m1 for the laravel project nssl.c:24:10: fatal error: ‘openssl/sha.h’ file not found #include <openssl/sha.h> ^~~~~~~~~~~~~~~ 1 error generated. make: *** [src/libmongoc/src/libmongoc/src/mongoc/mongoc-crypto-openssl.lo] Error 1 ERROR: `make’ failed my OS Details are : ProductName: macOS ProductVersion: 14.3 BuildVersion: 23D56 unix variant …

Total answers: 1

GREP matching 6-7 digits within other data

GREP matching 6-7 digits within other data I am trying to create a Regular Expression that will match a string of digits that is 6 or 7 digits long. [0-9]{6,7} This works but i dont want a match in strings that are longer than 7 digits. Please see the sample data below with the digits …

Total answers: 6