Which of the following command is used to display the contents of a file on the console screen in Linux?

Like that of .txt or .html

asked Feb 23, 2010 at 8:14

easiest are cat, head, tail, tac (for reverse output)

less and more let you scroll the text files (less being more powerful)

you can also use text editors like nano, pico, vi, emacs

answered Feb 23, 2010 at 8:21

Which of the following command is used to display the contents of a file on the console screen in Linux?

knittlknittl

3,8622 gold badges17 silver badges18 bronze badges

2

cat and less are good for this.

answered Feb 23, 2010 at 8:16

To Display the contents of a file use this command:

cat

Code: cat test.txt

answered Feb 23, 2010 at 8:18

you can use cat, although its really meant for concatenation of files. more or less are 2 other tools you can use. Other's include awk, eg using awk

$ awk '1' file

using sed

$ sed -n '1,$p' file

using grep

$ grep "." file

using head/tail to display some parts of the file

$ head -1000 file $ tail -1000 file

Tools aside, you can also use just the shell to display your file

#!/bin/bash while read -r line do echo "$line" done <"file"

answered Feb 23, 2010 at 8:23

user31894user31894

2,70117 silver badges9 bronze badges

0

Try cat , head or tail.

answered Feb 23, 2010 at 8:15

Which of the following command is used to display the contents of a file on the console screen in Linux?

Tim PostTim Post

8912 gold badges8 silver badges21 bronze badges

For viewing HTML files you can also use lynx, links, elinks or w3m which are text-mode browsers. They can also be used to view .txt files.

answered Feb 23, 2010 at 14:43

Dennis WilliamsonDennis Williamson

102k18 gold badges163 silver badges186 bronze badges

file : Display the type of file cat : Display the content of the file and outputs it on stdout.

You can use vi, emacs command to edit the file in Unix environment. If you do not have expertise in using vi/emacs you might find it little difficult to edit the file.

If you have X11 enabled, You can use a number of Linux editors like gvim, kate, kwrite, kdevelop etc.

Kwrite is my personal favorite in Linux.

answered Feb 23, 2010 at 8:38

Which of the following command is used to display the contents of a file on the console screen in Linux?

www.sapnaedu.inwww.sapnaedu.in

2891 gold badge3 silver badges13 bronze badges

Or, less or more. See the man pages for more information. :)

Which of the following command is used to display the contents of a file on the console screen in Linux?

answered Feb 23, 2010 at 8:16

TomTom

3351 gold badge4 silver badges9 bronze badges

cat Works fine with txt or html. (or less or more if you want tosee it page by page) or any text ediotr... (vi, emcas, gedit...).

Also know that if it's a binary file it's may contain control char that will do some displeasing things with your terminal (like changing charset). If that happen use reset to put it back in sane state.

You can also use file on file before displaying it's content, the system will guess it's type (based on content not filename name) and show it to you.

answered Feb 23, 2010 at 8:26

krisskriss

2211 silver badge5 bronze badges

Which of the following command is used to display the file contents on the screen?

You can also use the cat command to display the contents of one or more files on your screen. Combining the cat command with the pg command allows you to read the contents of a file one full screen at a time. You can also display the contents of files by using input and output redirection.

Which of the following Unix Linux commands is used to display the contents of a file?

cat. This command outputs the contents of a text file. You can use it to read brief files or to concatenate files together. Because cat displays text without pausing, its output may quickly scroll off your screen.

How do you display the contents of a text file in Linux?

Use the command line to navigate to the Desktop, and then type cat myFile. txt . This will print the contents of the file to your command line. This is the same idea as using the GUI to double-click on the text file to see its contents.

Which command is used to display files?

Use the ls command to display the contents of a directory.