69

Simplest solution that worked when upgrading to Big Sur. A clean install may not require the solution below. There is inconsistency with the way CLT is upgraded to 12.2. sudo rm -rf /Library/Developer/CommandLineTools sudo xcode-select --install Worked with the following versions (post-install) ❯ /usr/bin/xcodebuild -version Xcode 12.2 Build version 12B45b ...


39

You can use file FILENAME to determine the type of data in a file. $ file image.jpg text.jpg pdf.jpg image.jpg: JPEG image data text.jpg: ASCII text pdf.jpg: PDF document, version 1.4 So, file *.jpg | grep -v JPEG should give a list of all non-JPEGs with the ".jpg" extension Also, assuming there are PDFs you can rename them in one go find . -...


14

The problem seems to be that you're using git ontop of iCloud Drive. I.e. the problem is not with Time Machine and backups at all - it is instead that you have chosen to store your ~/Documents/ folder in iCloud Drive, which is not compatible with programs such as git. The issue is that iCloud Drive treats each file as an individual and independent file, ...


6

Do not parse/interpret the output of ls, too many things can go wrong. A simple way to accomplish your goal would be for f in *.vital; do echo -n "$f: " jq '.author' "$f" done which might still fail if there are directories matching the pattern for instance. You can overcome this by using for f in *.vital; do [[ -f "$f&...


4

sudo on macOS does work as it does on other platforms - at least through macOS 10.15.6: If you, as a "Standard" user, want or need privileges to perform certain tasks, those privileges may be granted by the Admin user in the sudoers file. If you are both the Admin user, and the unprivileged StandardJoe user, this becomes a bit trite, but here's how ...


3

Run file on a binary: krismatth@KristophersMBP3 ~$ file /bin/bash /bin/bash: Mach-O universal binary with 2 architectures: [x86_64:Mach-O 64-bit executable x86_64] [arm64e:Mach-O 64-bit executable arm64e] /bin/bash (for architecture x86_64): Mach-O 64-bit executable x86_64 /bin/bash (for architecture arm64e): Mach-O 64-bit executable arm64e Activity ...


3

The relevant file for that specific dmg is SecUpd2020-006Mojave.pkg/PackageInfo. After mounting the dmg, do this: % cd /tmp % xar -x -f /Volumes/Security\ Update\ 2020-006/SecUpd2020-006Mojave.pkg SecUpd2020-006Mojave.pkg/PackageInfo % grep -o 'com.apple.pkg.update.*" ' SecUpd2020-006Mojave.pkg/PackageInfo | sed 's/.*\.//' For updates that have been ...


3

This has nothing to do with iTerm, but rather the shell that you're using and whether or not the option interactive_comments is enabled or not. To treat the line as a comment, you have to start the line with a comment character. Bash Reference Manual (Chapter 3.1.3) - Comments In a non-interactive shell, or an interactive shell in which the ...


3

As explained in https://stackoverflow.com/questions/56951712/why-is-zsh-not-able-to-read-tilde-from-a-path-in-a-script zsh doesn't expand ~ within double quotes. So you can do one of export ZSH=~"/.oh-my-zsh" export ZSH="$HOME/.oh-my-zsh" (where the second option also works if there are space characters in your home path), or set set -o ...


2

Do you know of a way to automatically log commands that return successfully ... in order to keep a record of how you managed to finally successfully set up your environment to compile that one stubborn piece of code? You first need to answer the question What constitutes a successful command? You're probably thinking "that's easy! One that works and ...


2

i know this seems like a locale problem -- i spent of bunch of time looking into that but it turns out this is actually a problem with the date command. from the man page for date: %U week number of year, with Sunday as first day of week (00..53) %W week number of year, with Monday as first day of week (00..53) so if i rewrite your command to use %U ...


2

All Cmd. does is sending CtrlC to the shell running in the current Terminal tab/window. So you can get the same effect in iTerm2 by just typing CtrlC.


2

/usr/libexec/path_helper is used to build PATH from the default in /etc/paths and the entries in /etc/paths.d (see man path_helper for details). By default this is called in /etc/profile which is executed for each sh/bash/zsh style login shell. On my system /etc/profile looks like this # System-wide .profile for sh(1) and friends if [ -x /usr/libexec/...


1

Animas-Air is your local hostname. Read Apple Support: Change your computer’s name or local hostname on Mac If you want to change PROMPT (or PS1), you might some ideas in Removing computer name from terminal


1

It doesn't impact the commands given. Just brew cask install p4v and all other commands remain the same.


1

Looking back, past crashes are logged in the log system, and also individual dump files are saved for about a month in /Library/Logs/DiagnosticReports Looking forward, to cause them is a bit harder and risky. You could try issuing a SIGABRT or SIGQUIT signal if you know the process: How to crash an application to produce Crash Report Something more generic ...


1

The message Homebrew shows you after installing curl gives you all the required details ==> Caveats curl is keg-only, which means it was not symlinked into /usr/local, because macOS already provides this software and installing another version in parallel can cause all kinds of trouble. If you need to have curl first in your PATH run: echo 'export PATH=...


1

As user3439894 stated in the comment already, there is a history file recording all commands issued on the command line regardless of success or failure. This list of commands is finite, however, and will toss off the oldest command after having issued a number of commands. I have not checked, but I think on average that would be somewhere between 500-1000 ...


1

I agree that I wouldn't change the global LC_COLLATE. Just use it locally in your alias: alias ls="LC_COLLATE=cs_CZ.ISO8859-2 /bin/ls" Watch out for the undesirable effect of this particular LOCALE. Files that start with "ch", "CH", or "Ch" will be sorted between files that start with "H" and "i". I ...


1

macOS 10.14.6 preinstalled python 2.7.10, but it doesn't come with pip. It does have pip3 for python3. bash-3.2$ python --version Python 2.7.10 bash-3.2$ which pip bash-3.2$ which pip2 bash-3.2$ I just want pip to be pip3 BUT not with alias because on other mac I found they are not alias. ~ ➤ which pip /usr/local/bin/pip ~ ➤ which pip3 /usr/local/bin/pip3 ~ ...


1

There's also the mac_apt MacOS Artifact Parsing Tool - It provdides for extraction of Notes, amoungst many other data types. The authour has also written a blog post on extracting Notes from the Notes DB.


1

This Apple Support article on how to Narrow your search results on Mac is the most detailed documentation I have been able to find on Finder searches. While the OP is mainly asking about regular expression searches in Preview, the question title brought me here looking for the same information for Finder searches. The last section on boolean operators (...


Only top voted, non community-wiki answers of a minimum length are eligible