I am a new user to Linux. I have several files and documents in my directory and sometimes when I want to read or display data in these files, I do not know which command I need to type for this purpose. I would be appreciated if one helps me with that.
If you want to display text in the terminal, with automatic conversion to text, you can use less <file>
with Wolfgang Friebel's lesspipe, which will detect some file types and do the conversion transparently.
For graphic applications, you can use xdg-open <file>
, which will automatically select the "right" application.
There are a few commands you can type to view contents of files. There are:
vim
orvi
which is good for viewing text files and creating shell scriptsless
ormore
which is good for viewing log files ( I findless
more useful in that case). You cannot change anything withless
ormore
but is good for viewing.gedit
which is aGUI
tool that will show text/log/conf files.cat
can show contents of a file but your better off usingless
-
Thanks for you all. I tried all your suggestions but each time I get either errors (-bash: syntax error near unexpected token `newline') or (Missing name or redirect). – user1 Aug 20 '14 at 13:42
-
-
As I indicated previously, I am trying to view of read the content of some files on Xterm for Linux desktop. For example a file with pdf or psk format. – user1 Aug 20 '14 at 14:13
-
foo
, typefile foo
. It will tell you what type of file it is, which should give you a clue as to what program to read it with. – G-Man Says 'Reinstate Monica' Aug 19 '14 at 21:28