• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

which command is used ot view file in linux.

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 25483
180
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 75729
354
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 !!
 
Yeah, but does being a ninja come with a dental plan? And what about this tiny ad?
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic