med-mastodon.com is one of the many independent Mastodon servers you can use to participate in the fediverse.
Medical community on Mastodon

Administered by:

Server stats:

363
active users

#commandline

6 posts6 participants0 posts today

The power of LibreOffice

I have many documents created with Microsoft Office for assignments written for graduate school courses years ago. How can I easily convert those dozens of documents to a different format without using an online application? This is an excellent example of the power of open source.

Five years ago I took a course at a local university where all of the documents were provided in ‘docx’ format. Is there a way to convert those documents to an ‘odt’ format? There is and it is quite simple.

$libreoffice --headless --convert-to odt *.docx

What if I decided I wanted to convert those ‘docx’ items to ‘html’ so they could easily be shared on my classroom website. What if I had wanted to convert all those documents to html?

$libreoffice --headless --convert-to html *.docx

I can use the same tool to turn those ‘docx’ files into ‘pdf’ files with an iteration of the same command.

$libreoffice –headless –convert-to pdf *.docx

Using LibreOffice from the command line inside the directory where the files you want to convert is easy and the conversion is accomplished in a matter of seconds depending on your processor and memory. You can find many more uses of LibreOffice from the command line by entering the following command on your own command line if you have LibreOffice installed as most Linux distributions do.

$libreoffice --help

This is a great example of the power of open source software.

www.libreoffice.orgHome | LibreOffice - Free and private office suite - Based on OpenOffice - Compatible with MicrosoftFree office suite – the evolution of OpenOffice. Compatible with Microsoft .doc, .docx, .xls, .xlsx, .ppt, .pptx. Updated regularly, community powered.
Replied in thread

@gsuberland

In fairness, that's a culture that the GNOME, KDE, et al. desktop people changed by doing, years ago.

They've had long meaningful names, with more than 1 vowel in, in the desktop applications world for years.

When it comes to nomenclature "st" actually sucks *more* as a name to unfamiliar users than "gnome-terminal". (-:

It's the same sort of deal with the "convenience" aliases versus the full cmdlet names in #PowerShell.

I had a dream last night I was the host of a popular YouTube show which was basically Cribs, but for famous programmers showing me around their command line shell setup.

The Linus Torvalds episode did numbers, but no one wanted to watch me show myself around my own shell.

😅 such is the fickle imaginary audience of one's own dreams. Lol.

I’ve been playing around with this and I can’t tell you how much I love this cli interface. It’s much easier for me, now, to edit and create new newsletters/emails. I’m super glad this newsletter platform offers this! it’s a lot cleaner, for me, than the web interface. As of right now, there’s a few bugs, but it still works well and i’ve already started contributing to the documentation! Providing some more notes for Windows users and explaining a few things that’s not in the original documentation. Buttondown CLI | Buttondown Documentation docs.buttondown.com/buttondown #Cli #CommandLine @buttondownemail @buttondown #Terminal #OpenSource #TUI

Buttondown DocumentationButtondown CLI | Buttondown DocumentationButtondown is the easiest way to start and grow your newsletter. Check out our docs and start building something great!

I'm mostly posting this as a way to help myself remember, but:

I have been using the venerable `less` Unix utility for over a quarter century (!) but just today I learned you can view multiple files with it!

less file1.txt file2.txt file3.txt

Use `:n` and `:p` to go to the next/previous file.

TIL that bash allows you to put leading zeroes in ranges and it'll do the correct thing:

for n in {01..10}; do echo $n; done

outputs:

01, 02, 03, …, 10

No more messing about with printf for simple ranges. Wheee!

#linux#shell#bash

I was trying to open "+layout.ts" file with `less`. But kept getting "Missing filename" error.
Turns out `less` sees the `+` as an option, not part of the filename. 🤦‍♂️

The fix:
- Use `less -- +layout.ts`
- Or `less ./+layout.ts`

Escaping the `+` with `\+` or quoting the file name does not work.

Problem solved! Sharing in case anyone else stumbles on this.