Saturday, May 4, 2024
 Popular · Latest · Hot · Upcoming
2
rated 0 times [  2] [ 0]  / answers: 1 / hits: 366  / 3 Years ago, thu, july 29, 2021, 11:16:02

I know how to open a LibreOffice writer file from the command line. I need to open the most recently modified file in the directory specified in path. It is an .odt file. Thanks


More From » libreoffice

 Answers
5

If you use zsh in your terminal, you can use its glob qualifiers to select the youngest .odt file (by modification time):


soffice path/to/dir/*.odt(om[1])

To use the zsh features from another shell, you could do


zsh -c 'soffice path/to/dir/*.odt(om[1])'

[#1160] Friday, July 30, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
sharall

Total Points: 407
Total Questions: 127
Total Answers: 121

Location: Saint Helena
Member since Fri, Mar 26, 2021
3 Years ago
;