permaculture playing cards*
The moose likes Linux / UNIX and the fly likes which command is used ot view file in linux. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Engineering » Linux / UNIX
Bookmark "which command is used ot view file in linux." Watch "which command is used ot view file in linux." New topic
Author

which command is used ot view file in linux.

srikanth sankurthi
Greenhorn

Joined: Oct 09, 2012
Posts: 9
which command is used ot view file in linux.
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

There are many. Depending on what you mean by 'view'. For example, you can use 'vi'.


[My Blog]
All roads lead to JavaRanch
srikanth sankurthi
Greenhorn

Joined: Oct 09, 2012
Posts: 9
To view the content of the file.
And also let me know the difference between cat and vi commands.
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

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.
Anayonkar Shivalkar
Bartender

Joined: Dec 08, 2010
Posts: 1456
    
    5

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.


Regards,
Anayonkar Shivalkar (SCJP, SCWCD, OCMJD, OCEEJBD)
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 13868
    
  10

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.


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15629
    
  15

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.


Customer surveys are for companies who didn't pay proper attention to begin with.
Stefan Wagner
Ranch Hand

Joined: Jun 02, 2003
Posts: 1923

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, ...


http://home.arcor.de/hirnstrom/bewerbung
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: which command is used ot view file in linux.
 
Similar Threads
ejbdeploy tool
how to undo delete folder in linux
SQL not working
To Moderators....(Download Saloon into Harddisk)
where is the file that we can add/edit env parameters in it?