LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   create, edit, or view a file in Linux (https://www.linuxquestions.org/questions/linux-newbie-8/create-edit-or-view-a-file-in-linux-759850/)

Harmain 10-05-2009 01:00 PM

create, edit, or view a file in Linux
 
Hi Friends
Plz Guide: How to I open, create, edit, or view a file in Linux?

itz2000 10-05-2009 01:26 PM

it depends :
With GUI which is probably what you want :
use text editor like kate, or similar. you can start them from gui or from terminal line (while in X).
from terminal, you should use the easiest editor you want, probably for windows users will be nano.
I personally use for both ways vim.
also, another editor is emacs.


emacs or vim are very strong editors, google them for more advices.

Tux-Slack 10-05-2009 01:48 PM

Terminal:
touch filename - to create a file
To view the file:
cat filename
echo filename
To edit the filename you'll need to use a editor, like:
nano filename
vi filename
vim filename
emacs filename
There are more, but I don't know many CLI text editors cuz I'm in love with vim :$

dv502 10-05-2009 02:27 PM

Quote:

Originally Posted by Harmain (Post 3708565)
Hi Friends
Plz Guide: How to I open, create, edit, or view a file in Linux?

You need to be more specific. Is the file an ascii text, binary text file, a media file or other.

From the file Manger
If you're not sure which application to open the file with, just right-click on the file and select open with and a list of applications associated with file types will be shown.

Terminal
If opening/editing files from the terminal, you can try these popular programs.

For ascii and binary text files: vim, nano, emacs, Kate, cat

audio and video files: ffmpeg, ffplay, mplayer, mencoder

images: display, convert

Of course there are many others, but these are the popular ones.

Visit http://www.linuxalt.com/ for a list of windows to linux equivalents.

Hope this helps...

lutusp 10-05-2009 05:26 PM

Quote:

Originally Posted by Harmain (Post 3708565)
Hi Friends
Plz Guide: How to I open, create, edit, or view a file in Linux?

Please add this to your message:

This is homework.

That way, we know you are an honest person.

SharpyWarpy 10-05-2009 08:05 PM

Lot of complex, confusing answers here for a noob. I'll just tell you what I use. If it's a txt file, view with "less", edit with "joe". If it's a multimedia file view with "mplayer". I don't think you're gonna be viewing or editing any binary files since you're a noob -- don't try. The aforementioned apps have to be run from a command line, look in your menu for something like "Terminal" or "Konsole", type in the appropriate command followed by the file name and hit enter. Ctl-h will give you some help in "joe". "q" will quit in "less" and "mplayer". You may have to install mplayer from your repo or install disc(s). A GUI multimedia player is Totem. You'll have to find and download the codecs for these multimedia players to play mp3s or DVDs.
If it's an office file like "somefile.doc" use OpenOffice.org suite of apps, like OpenOffice.Org "Writer", you'll find it in your menu.


All times are GMT -5. The time now is 12:52 AM.