What is a best way to view pictures (like you see images thumbnail in Nautilus) when you are working in the terminal [...] ?
This part of the question about previewing multiple images at once has not yet been addressed properly. Most image viewers (with the exception of TerminalImageViewer) will not show multiple thumbnails when called with multiple image files. They might display them in a slideshow, which is not always practical (e.g. when browsing through icons).
As a solution, I use a usual file manager in "thumbnail" mode to display all images that I copied to a temporary directory. For example, to display all icons from the KDE icon theme "Breeze" where the filename matches *search*
:
tmpdir=$(mktemp -d -t image-previews-XXXXX)
find /usr/share/icons/breeze -name "*search*" -exec \
bash -c '
tmpdir=$1;
file=$2;
newfile=${file/\/usr\/share\/icons\/breeze\//};
newfile=${newfile//\//-};
cp $file $tmpdir/$newfile
' _ $tmpdir {} \;
pcmanfm-qt $tmpdir
Discussion
This find
s and copies all Breeze icons matching *search*
to a temporary directory, replacing the path relative to the Breeze installation directory with a filename that has -
instead of the directory separator /
. This way, the files are all in one directory for previewing, and won't overwrite each other.
Then this starts a file manager (here pcmanfm-qt
) to show the files in the temporary directory. After it starts, it has to be manually set to thumbnail view for best results. Unlike other image viewers, file managers usually can render SVGs into preview thumbnails.
The find
command uses a technique with positional parameters in a subshell to allow executing multiple commands in find
including variable evaluation, as documented here.