Win a copy of TensorFlow 2.0 in Action this week in the Artificial Intelligence and Machine Learning forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Paul Clapham
  • Bear Bibeault
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Jj Roberts
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • salvin francis
  • Scott Selikoff
  • fred rosenberger

which command is used ot view file in linux.

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
which command is used ot view file in linux.
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are many. Depending on what you mean by 'view'. For example, you can use 'vi'.
 
srikanth sankurthi
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To view the content of the file.
And also let me know the difference between cat and vi commands.
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Learn to use the "man" command.
-> man cat
-> man vi

"cat" will outputs the content of the file, while "vi" is an editor which allows you to edit the file. Apparently, "vi" is a bit to early to use.
 
Bartender
Posts: 1558
5
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

srikanth sankurthi wrote:which command is used ot view file in linux.


As Christophe mentioned, there are various editors available for Linux (not 'linux') based distros.

It depends on what kind of system you are using.

Are you connecting to a system via terminal? Do you have to work explicitly via command line? In that case vi editor can be useful.

If you are working with some desktop environment, then you can use gedit, kedit, emacs and so on.
 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

srikanth sankurthi wrote:And also let me know the difference between cat and vi commands.


cat just prints the content of the file to the terminal window. vi is a text editor.
 
Saloon Keeper
Posts: 22678
153
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually, the commonly-used command to view text files is the "more" command, which provides a paged view of the file (cat just dumps the whole thing to the console, where it can roll off the screen).

An improved version of "more" is named "less", and that program can also scroll the display backwards. "more" can only go forwards.

I don't recommend using editors such as "vi" to view files. You might accidentally alter the file.
 
Ranch Hand
Posts: 1923
Scala Postgres Database Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

srikanth sankurthi wrote:which command is used ot view file in linux.



Which kind of file? Java-source/textfile, (less, cat, gedit, nano, mcedit, vi, emacs), image (eog, gimp, ...), video (vlc, mplayer, gxine, ...), pdf (xpdf, evince, acroread), zip, mp3, rar, xml, ...
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In linux dir command is used to show files

for more about linux commnads open below link

https://www.puttygen.com/linux-commands
 
Marshal
Posts: 70711
288
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch Most of us use ls to view a directory's contents.
 
Adam Perrine
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Campbell Ritchie wrote:Welcome to the Ranch Most of us use ls to view a directory's contents.



Right, but i'm using dir command !!
 
Well don't expect me to do the dishes! This ad has been cleaned for your convenience:
the value of filler advertising in 2020
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic