Can't open id_rsa.pub file on MacOS Monterey via cli that prompts to `No application knows how to open, Code=-10814`

Viewed 688

Couldn't file the resolution within the forum, therefore, resolved it by myself.

ISSUE

macOS Monterey couldn't open id_rsa.pub file via cli giving an error below:

No application knows how to open URL file:///Users/romansaverins/.ssh/id_rsa.pub (Error Domain=NSOSStatusErrorDomain Code=-10814 "kLSApplicationNotFoundErr: E.g. no application claims the file" UserInfo={_LSLine=1489, _LSFunction=runEvaluator}).

2 Answers

RESOLUTION

  1. $ open ~/.ssh/
  2. Open the file manually
  3. Choose the TextEdit app
  4. Close the file.
  5. Open manually again (App should not be asked)

Now id_rsa.pub could be opened via CLI.

  • $ open ~/.ssh/id_rsa.pub

Happy days...

If you want to handle it using CLI only and for any extension, you can use open -a appName filePath where appName could be TextEdit and filePath your relative or absolute filePath.

Related