1

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?

BeastOfCaerbannog
  • 12,964
  • 10
  • 49
  • 77

1 Answers1

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.

BeastOfCaerbannog
  • 12,964
  • 10
  • 49
  • 77
  • 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](https://github.com/ranger/ranger/wiki/Image-Previews) for enabling image previews and [this](https://github.com/ranger/ranger/wiki/Video-Previews) 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