I will show you mine if you show me yours – Displaying files

Here is a little stuff from me for all UNIX/Linux users out there. What are your favorite ways to displaying files while working at shell prompt? Here is my list (according to task):

Display text files

  • cat – Display text file ( don’t use, go for less)
  • less – Display text file, move forward or backward
  • head -Display top of the file
  • tail – Display bottom of the file
    $ tail -f /var/log/message
  • zless – Display compressed or plain text file, no need to use pipe.
    $ zless /usr/share/man/man1/ls.1.gz
  • rev – Display file lines in reverse from last character to first
    $ tail -2 /etc/passwd | rev
  • tac – Display file lines in reverse order
    $ tac /etc/passwd | less

Display MS-Word file

  • antiword {.doc file} – Display MS-Word file
  • catdoc {.doc file} – Reads MS-Word file and display its content as plain text on screen
    $ catdoc /tmp/db-2-releasenotes.doc | less
    Note use ‘apt-get install’ command to install both catdoc & antiword.

Display PDF file

  • pdftohtml – Program to convert pdf files into html, xml and png images and then display them using text browser such as elinks or lynx.

$ pdftohtml DB2-HOWTO.pdf
$ lynx DB2-HOWTO.html
$ elinks DB2-HOWTO.html

Display Images in text browser (under xterm)

  • w3m – Display images in text browser, for example:

$ w3m http://cybrciti.biz/nixcraft/forum/

Display Man pages
w3mman – an interface to the reference manuals, you can search via keyword, section wise etc.

As you see some of above commands are extremely useful on remote Linux/UNIX/BSD server. That’s it folks, time to show me yours 🙂

🐧 Get the latest tutorials on Linux, Open Source & DevOps via RSS feed or Weekly email newsletter.

🐧 0 comments... add one

CategoryList of Unix and Linux commands
Disk space analyzersdf duf ncdu pydf
File Managementcat cp mkdir tree
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Modern utilitiesbat exa
Network UtilitiesNetHogs dig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg glances gtop jobs killall kill pidof pstree pwdx time vtop
Searchingag grep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04
0 comments… add one

Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre> for code samples. Still have questions? Post it on our forum