Before submitting ZIP files to various third parties, I often have the need to ether remove superfluous files from my archives. Until today I’ve never had the need to add a file to such archives. Had that happened in the past, I would have probably just deleted the whole archive and crated a new one from scratch.
Today I felt adventurous and researched a way to add files to existing ZIP files and found a (not-so-obvious) solution to this puzzle, using the -r switch.
Let me show you how it works:
zip-rv YourArchive.zip NewFile.txt
According to the man page, the r switch actually replaces an existing file in the archive, so this command can be used to update files in the ZIP file too. I’ve added the v switch for convenience (it means “verbose” and can be omitted.
When ZIP up directories, particularly on macOS, some files may find their way into our ZIP archives that were never meant to be there. I’m thinking of those pesky .DS_Store and __MACOSX files, maybe even .htaccess files. For *nix based systems, * really means “everything”.
The ZIP command line tool let us remove such unwanted files from an existing archive. Here’s how:
zip-dyour-archive.zip file1 file2
The -d switch tells ZIP to hunt for and delete the unwanted files. Files whose names contain spaces can be defined in “regular quotes”, and the * asterisk can be used as usual.
For example, to remove all DS_Store files and __MACOSX files, we can use this:
To verify that such idiosyncrasies have indeed been removed from a ZIP archive before we release it into the wide, we can check with the UNZIP utility:
This will simply list the contents of your-archive.zip without actually extracting it.
Sometimes it’s easy to delete a ZIP file and create a new one – say you’ve forgotten to include a file. Just drag it into the folder to be ZIPped up and start again.
However, the clever little ZIP command line tool has a built-in ability to simply add a file to an existing archive without us having to do any manual grunt work. That can come in handy when we no longer have access to existing unZIPped content.
We can even add entire directories this way too, like so:
This will recursively add all files (indulging hidden and annoying ones) to our file.
Note that ZIP accomplishes this by temporarily extracting all files before creating a new archive for is (while deleting our original file). So in essence, the tools is doing what we’d do manually, just more conveniently and in the background without bothering us.
We all love Emojis, and it’s so super easy to insert them from an iOS keyboard. I do this frequently in messages. It stands to reason that it should be just as simple to do this on laptops and desktop Macs too – but how? Isn’t there some kind of shortcut we can use?
Well yes there is – I just keep forgetting which one it is 😂 so here it is:
CTRL + CMD (OPTION) + SPACE
This handy combination brings up an Emoji Picker. Find the icon you like, click on it, and the dialogue automatically closes again after it inserts your Emoji.
For a while now I’ve seen my poor Spotlight Search disappear on all my Macs disappear after typing only two or three letters. This has never been a problem since I’ve been using macOS. I have 4 systems in total, running Sierra and High Sierra, and all of them exhibit this problem.
However, my wife’s MacBook Air is still running Mavericks and – not having been updated for a while – is NOT experiencing this issue. So what’s going on there?
After some digging, I am not the only user who has an issue with Spotlight Search. Some suggest we all have to re-index Spotlight (which does take a while, multiplied by all the computers you’re using), but they report that the issue will come back sooner or later.
The most efficient way to make Spotlight Search operational again is to simply disable one of the items it’s searching when we use it – namely the Bookmarks and History option.
To access the above menu, head over to the Apple Icon and select System Preferences. From here, either click the Spotlight Logo (top right corner) or search for Spotlight. Un-tick the second box from the top, close the dialogue and – voila – Spotlight is working again!!
This thread on the Apple Forums suggests that the culprit is Safari 12 (I’m using 12.0.1 at the time of writing). Disabling Bookmarks and History means Spotlight is not accessing Safari’s (changed / faulty / updated / whatever) database and seems to work fine as a result.
Worked great for me – I hope it’ll work for you just as well 🙂
My good old MacBook Pro from 2011 can only supports macOS up until 10.13 High Sierra. It’s been purring along nicely with macOS 10.12 Sierra for the last couple of years, and I didn’t see the need to upgrade just yet. Why risk breaking things that are working, right?
A couple of weeks ago, macOS 10.14 Mojave was released, with which my MacBook is sadly no longer compatible (not officially at least). So when I searched for “High Sierra” on the Mac App store, I was surprised to learn that it didn’t come up. It appears that only the very latest macOS release is available to download from the Mac App Store.
So now the $100k question is: How can I get an official copy of macOS High Sierra, now that Mojave is out? I’ve never downloaded it before, therefore it doesn’t show up in my “previous purchases” tab either. Have I missed my 12 month window to download the last operating system that’s compatible with my hardware?
Lucky for us, Apple have made some contingencies. I did some research and found several older Mac operating system for ya’ll’s enjoyment. Might come in handy 😉
There is an iOS and Android App available to transfer files directly from a GoPro camera to a mobile device. Those apps transcode files and compress them for easier viewing, and to save storage space.
While that approach gets footage onto my iPhone, I still need to transfer the files to my Mac for editing. Plus, there’s an additional compression step involved which can’t be good for picture quality. Besides, it takes forever to do its job.
A much more useful approach would be to hook directly into the GoPro and transfer files that way. This leaves the SD card place and doesn’t disturb the (sometimes hard to reach or difficult to recreate) position of the camera.
Ever since Lion, Mac OS X 10.7, there has been a great and very underrated feature built-in to every Mac: the ability to highlight some text and have macOS turn it into an audio file.
This is a wonderful way to listen to written text while you’re on the go, or if you want to skim through text you or others have written while you’re occupied with another activity, such as walking or driving. I love this feature!
I’ve seen the option in the context menu many times, but I’ve never dared to use it until today. Perhaps I held off for so long because the option reads “add to iTunes as Spoken Track” – and I’m just not a big fan of iTunes.
Turns out, this text-to-audio option bypasses iTunes altogether. It doesn’t open automatically and we won’t need it to transfer tracks to our iPhones either. What a relief!
Yesterday I had to transcode some audio files recorded with Quicktime on macOS. Quicktime works great for that, but it only stores files in its native AIFC file format. That’s the Audio Interchange File Format, a format developed by Apple in 1988, storing audio data as uncompressed PCM data.
Sadly though, AIFC is not commonly readable by many applications, and as such the data needs to be transcoded to be used successfully elsewhere. And Quicktime offers that option too, simply by choosing File – Export – Audio Only. This will create an MPEG 4 audio file with the M4A extension.
While that file sounds fine, and its size is only a fraction of what the original AIFC file was, this transcoding process does not allow us to choose which compression algorithm to use upon export. As it turns out, Quicktime introduces a very good, albeit lossy compression when it exports files in this manner.
I wondered if there was a way to extract uncompressed lossless data from the AIFC file, and how to do it. If Quicktime didn’t let me, perhaps there was another way, maybe using some kind of free software tool.
All we have to do is open a Finder window, right-click the AIFC file in question, and select Encode Selected Files at the bottom of the context menu. We can even select multiple files and transcode them all at once.
When we do that, a dialogue window comes up. This may take a moment or two, so don’t get nervous if your Mac doesn’t respond instantly to this request (like I did).
Now we get options! We can pick destination for our new files, and we even get the choice to delete the original AIFC file if we so desire (and if we’re confident enough about this workflow’s capabilities).
The best option we get though is that we can pick how the file(s) are to be transcoded though. While we do not get these options during the Quicktime export process, which appears to use the “High Quality” setting (and probably the same tool under the hood), with Finder we can choose the Apple Lossless codec.
From what I understand, all three options apply a lossy AAC compression in varying degrees, resulting in different file sizes, data rates and of course different levels of quality. The only one that stands out is the Apple Lossless setting, which creates a file still smaller than the AIFC file, but with lossless compression, in M4A format.
The resulting M4A output is readable by a wide range of applications.
Thanks, Finder! I didn’t know you did Audio Encoding so well 🙂