2

I know that there are commands like cat, less or even xdg-open, but I really like the convenience of just previewing. GNOME Sushi doesn't seem to support commands from the terminal.

Maybe a similar application can do the job or even writing a script? Is there a way to do this?

2 Answers2

0

I think you might be interested in ranger. It is a terminal-based file manager that uses a three-columns layout. The left column shows the parent directory, with the current directory highlighted, the middle column shows the contents of the current directory and the right column shows a preview of the selected item.

ranger in terminal

In the above screenshot you can see that I am inside the /var/log directory (left column) and I have selected the faillog file (middle column) which I am previewing (right column).

You can install ranger by running:

sudo apt install ranger

Start it by opening a terminal and running:

ranger 

You can move around using the keyboard arrows or VIM-like shortcuts (h, j, k, l). You can open a file in the selected application by pressing Enter or . You can close ranger by pressing q.

More information can be found in the Official user guide.

  • Thank you for the reply. I downloaded ranger to check it out. Although I can preview all kinds of text files I still can't preview photos or videos and that's a bummer. Maybe I need to tweak it a little bit. – UprightMeatSlab Nov 01 '20 at 15:47
  • It is actually possible to preview images and videos in ranger, but how easy the configuration of this setting is depends on the terminal you use. See this for enabling image previews and this for enabling video previews. – BeastOfCaerbannog Nov 01 '20 at 16:05
  • I use gnome-terminal so I can't really display images with ranger. It seems like there is not really a good solution to my problem. Thank for your time. I appreciate it. – UprightMeatSlab Nov 05 '20 at 19:38
0

Nowaday you can use sushi directly in your terminal with, e.g.:

$ sushi ./something.jpg

It can do exactly only that, and it's great:

$ sushi
The launcher takes exactly one argument

Usage: sushi FILE Opens FILE in a NautilusPreviewer window.

Cirelli94
  • 626
  • 1
  • 6
  • 26