Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use less, Antiword and odt2xt programs in linux

2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

Editor to share with you how to use less, Antiword and odt2xt programs in linux, I believe most people do not know much about it, so share this article for your reference. I hope you will learn a lot after reading this article. Let's learn about it together.

Less

The beauty of less is that it is easy to use. It breaks down the files you are viewing into blocks (or pages), which makes them easier to read. You can use it to view text files on the command line, such as README, HTML files, LaTeX files, or any other plain text file. I introduced less in my last article.

To use less, simply type:

Less file_name

Scroll down the file by pressing the Spacebar or PgDn key on the keyboard and press the PgUp key to move the file up. To stop viewing files, press the Q key on the keyboard.

Antiword

Antiword is a useful Mini Program that you can use to convert Word documents into plain text. You can also convert them to PostScript or PDF if you want. In this article, let's continue to use text conversion.

Antiword can read and convert files created by Word versions 2.0 to 2003. (LCTT note: this is suspected to be Word 2000, because Word 2.0 for DOS was released in 1984 and WinWord 2.0 released in 1991, which seems too old.) It cannot read the DOCX file-if you try to do so, Antiword will display an error message indicating that you are trying to read a ZIP file. This is technically correct, but it is still frustrating.

To view the Word document using Antiword, enter the following command:

Antiword file_name.doc

Antiword converts the document to text and displays it in the terminal window. Unfortunately, it cannot decompose a document into pages in the terminal. However, you can redirect the output of Antiword to a utility such as less or more and paginate it all at once. Do this by entering the following command:

Antiword file_name.doc | less

If you are new to the command line, I'll tell you | it's called plumbing. This is redirection.

Odt2txt

As a good open source citizen, you will want to use open formats as much as possible. For your word processing needs, you may need to work with ODT files (used by word processors such as LibreOffice Writer and AbiWord) instead of Word files. Even if not, you may encounter an ODT file. And even if you don't have Writer or AbiWord installed on your computer, it's easy to view them on the command line.

How do you do that? Use a practical Mini Program called odt2txt. As you can guess, odt2txt converts ODT files to plain text. To use it, run the following command:

Odt2txt file_name.odt

Like Antiword, odt2txt converts the document to text and displays it in a terminal window. Like Antiword, it does not paginate documents. However, you can also use the following command to transfer the output pipeline of odt2txt to a utility such as less or more:

Odt2txt file_name.odt | more

These are all the contents of this article entitled "how to use less, Antiword and odt2xt programs in linux". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report