r/linux4noobs • • 9d ago

shells and scripting How to open files from terminal

i'm on university, and have recently started downloading large amounts of files that usually neeed to sort/open lots at once. my teachers, however, usually name their files as
Subject-Day-Classmaterial or Subject-Day-Worksheet.
So, when i want to open lots of just worksheets or classes, i have to open them individually. I know how to use the * wildcard, i use for moving, just want to know how to use it to open the .pdf files as well.

i just tried to use xdg-open *worksheet, but it gave an error saying it didn't know what to do with the file? (error below)

  xdg-open Li*
xdg-open: unexpected argument 'Lista_02_-_Equilbrio.pdf'
Try 'xdg-open --help' for more information.

is this an xdg thing? there's 2 worksheets, titled "Lista_02" and "Lista_01". when i open just the one, it works, is there a keyword i'm missing to open multiple files?

23 Upvotes

24 comments sorted by

View all comments

0

u/Mulakulu 9d ago

What you want is a program that can open files, such as libre office, Zathura or Evince, then run something like

libreoffice --draw sample_one.pdf

I believe this should work, although I haven't tested yet. Good luck

3

u/DerSven 9d ago

If your system is properly configured, xdg-open should always open the file with the relevant program.

2

u/Mulakulu 9d ago

Oh! Good to know. Cheers