How to open word document file in terminal?

75,543

Solution 1

You can open it with help of libre-office-writer by following command (open with libre office writer):

lowriter "<path/to/file>"

From man libreoffice:

Name
       libreoffice - LibreOffice office suite

SYNOPSIS
       libreoffice [--accept=accept-string] [--base] [--calc] [--convert-to output_file_extension[:output_filter_name] [--outdir
       output_dir] file]...  [--display display]  [--draw]  [--global]  [--headless]  [--help|-h|-?]  [--impress]  [--invisible]
       [--infilter=""]  [--math]  [--minimized]  [-n file]... [--nodefault] [--nolockcheck] [--nologo] [--norestore] [-o
       file]... [-p file...]  [--print-to-file [--printer-name printer_name] [--outdir output_dir] file]...   [--pt  printername
       file...]    [--show   Impress  file]...  [--unaccept=accept-string]  [--terminate_after_init]  [--view  file]...  [--web]
       [--writer]  [file...]
       lobase
       localc
       lodraw
       lofromtemplate
       loimpress
       lomath
       loweb
       lowriter

DESCRIPTION
       LibreOffice (LO for short) is a multi-platform office productivity suite.

Solution 2

Technically speaking xdg-open should work for all file types. It'll just open them in the appropriate application. All the document mime types are mapped to Libre Office by default so this should just work:

xdg-open document.doc

Solution 3

It should work with Libre Office.

libreoffice document.docx

Solution 4

Following worked for me

catdoc document.rf

Share:
75,543
user3616399
Author by

user3616399

Updated on September 18, 2022

Comments

  • user3616399
    user3616399 almost 2 years

    As I'm trying to open a word document from the terminal, i used wvWare and some other commands for the same, but i couldn't get it. Could any one please help me out!

  • user3616399
    user3616399 almost 10 years
    Could you please tell me the other commands lines for opening the basic files, like pictures and all from the terminal.
  • Pandya
    Pandya almost 10 years
    @user3616399 use cat "<filename>" to display basic file and eog "<filename>" for image.
  • user3616399
    user3616399 almost 10 years
    NO! its not working.. @Pandya was right.
  • Pandikunta Anand Reddy
    Pandikunta Anand Reddy almost 9 years
    @user3616399 worked for me. +1 for universal opener!
  • Huw Walters
    Huw Walters over 7 years
    Works for me (on Ubuntu 16.04). Upvoted this answer because I want the command line equivalent of finding the file in the file manager application and double-clicking it. I shouldn't have to remember the application executable name (lowriter in the accepted answer).