open pdf file in Terminal application fails

After migrating to 19H2026 (I am using macOS10.15.7) I find the following problem:

1. I try to open an existing pdf document using the open command inside the Terminal application: open x.pdf

Result: Preview opens a pup, telling me that I have not the sufficient rights to do what I want.

2. I open the Finder application so that it places the cursor at the desired file: open -R x.pdf

Inside Finder I open the file x.pdf using double-click.

Result: The Preview application starts and opens the file x.pdf as desired.

3. I close the Pages aplication, return to the Terminal application and repeat step 1.

Result: Now the Preview application starts and opens the file x.pdf as desired.


I am pretty sure that this behaviour is related to the update 19H2026.


MacBook Pro 13″, macOS 10.15

Posted on Aug 26, 2022 8:24 AM

Reply
Question marked as Top-ranking reply

Posted on Aug 26, 2022 8:49 AM

Try:


open -a preview x.pdf


Check if you have added Terminal to Full Disk Access in System Preferences > Security & Privacy > Privacy.

Similar questions

6 replies

Aug 26, 2022 10:00 AM in response to helmut288

  1. Either your original, or my suggested Terminal approach to opening a PDF should work as they do on any of my local PDFs. Even if that x.pdf has a quarantine bit set on it, the open command should still open it from the Terminal, as that works well here.
  2. Finder has nothing to do with the UNIX operating system behaviors that you are exposed to in the Terminal. The fact that you can open that x.pdf in Finder with a double-click indicates that Preview is the default opening application for PDFs.
  3. Not sure what an open Pages application has to do with a PDF on your filesystem, unless you exported Pages content again as PDF and chose to overwrite that x.pdf.

Aug 26, 2022 2:24 PM in response to VikingOSX

I already performed this step, but the problem persists. Interesting: in Safe Mode the behaviour described did NOT acccur, i. e. I could open pdf-files using open in Terminal.

It is not a severe bug, as I can wor around with opening the file once inside Finder and afterwards work as usual. But I am always concerned, if such strange behaviour occurs.

However, thanx a lot for your quick assistance. I shall do some additional testing tomorrow (using Numbers and Pages files, observe the Logs, etc). I would appreciate, if you would have a look upon the results. Perhaps you get some new ideas.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

open pdf file in Terminal application fails

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.