Linux File Reader For Mac

Active3 years, 2 months ago

I've found the 'open' command in Mac OS X very handy in the command line. From 'man open':

First of all, DiskInternals Linux Reader is absolutely free. Secondly, the program provides for read-only access and does not allow you to make records in file system partitions. This guarantees that the interference in an alterative file system will not affect the work of Linux later.

The open command opens a file (or a directory or URL), just as if you had double-clicked the file's icon. If no application name is specified, the default application as determined via LaunchServices is used to open the specified files.

That is, if I want to open a PDF file with the default PDF viewer (happens to be Preview), I only need to do:

In Linux, however, to open a PDF file from the command line, I had to dig around to find the default PDF viewer is, for instance, 'evince' (who'd have guessed??), and then

So, is there a simple equivalent of the 'open' command in the Linux command line?

Thanks!

Joachim Sauer
246k50 gold badges494 silver badges568 bronze badges
Liu Chang

closed as off-topic by legoscia, Glen Solsberry, Kevin DiTraglia, Christopher Marshall, mishikAug 16 '13 at 18:24

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • 'Questions about general computing hardware and software are off-topic for Stack Overflow unless they directly involve tools used primarily for programming. You may be able to get help on Super User.' – legoscia, Glen Solsberry, Kevin DiTraglia, Christopher Marshall, mishik
If this question can be reworded to fit the rules in the help center, please edit the question.

7 Answers

You could try xdg-open, most Linux distros have it. It will open default associated app for your file.

FYI https://portland.freedesktop.org/doc/xdg-open.html

number5number5
11.1k3 gold badges42 silver badges46 bronze badges

The equivalent you are looking for is xdg-open, which can be used in the same way as OS X's open command. For example:

However, this is really hard to type quickly and accurately. Instead, you should make an alias to xdg-open, which makes the process much quicker.

Of course, you can alias it to open to make it match OS X (you can pick anything you want), but personally, I use the right square bracket (]) for my shortcut for speed reasons. To use this, add the following to your .bashrc file:

Then, to open any resource, use it like any of these examples:

Also this lets you open a file browser (e.g. Nautilus) in the current directory:

From experience I have found that one-letter aliases work best for the above shortcut. After all, the goal is efficiency. And you can go back and make the same alias on OS X — I leave that as an exercise to the reader. :-)

Jeremy VisserJeremy Visser
3,9381 gold badge19 silver badges29 bronze badges

I just sorted this out myself so thought I would write down how I did it, which is specifically relevant to what Suan asked.These steps allow you just type 'open ' and not your terminal covered in messages you don't need:

Create a script called open in ~/bin, the content is just:

Save and close the script, then type 'source .profile' (or .bash_profile if relevant).Thats it so typing 'open Music' will open your music folder in the nautilus GUI and shouldn't enter anything onto your terminal.

MestreLion
7,4392 gold badges43 silver badges46 bronze badges
AnakeAnake
2,86411 gold badges34 silver badges51 bronze badges

Traditionally, you can use the 'see' command. Which just uses run-mailcap. This will work without Gnome and X etc.

Windows File Reader For Mac

Ali AfsharAli Afshar
34.2k12 gold badges82 silver badges103 bronze badges
Sony reader for macAna BettsLinuxAna Betts
66.3k15 gold badges122 silver badges193 bronze badges

Adobe Reader For Mac

If you have your mimes setup correctly, you can use mimeopen. Check out its man page, since it has some useful options.

stacksiastacksia

Under Gnome Desktop environment, I use the following command:

This is similar as 'open .' command in Mac

Niall C.

Linux File Reader For Windows 10

10.5k7 gold badges60 silver badges58 bronze badges

Linux File Reader For Windows

WonderLiWonderLi