create, edit, or view a file in Linux
Hi Friends
Plz Guide: How to I open, create, edit, or view a file in Linux? |
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. |
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 :$ |
Quote:
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... |
Quote:
This is homework. That way, we know you are an honest person. |
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. |