LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to edit a HTML file in linux (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-edit-a-html-file-in-linux-685108/)

shaiful 11-21-2008 03:20 AM

How to edit a HTML file in linux
 
Hi guys,

Need your help on this as i'm new to Linux. FYI, my website is hosted by a server running on Linux. I have to update the website where by i have to edit the html file in Linux.

I have tried to edit this publisher.htm file but it seems that my website is not showing just like what i have updated at the html file.

Ok my first question, once finish editing the html file, how do i save the html file?

Next question, what should i do once i finish saving the html file?

Thanks in advance guys. More questions to come guys, if it sounds stupid, pardon me.

pixellany 11-21-2008 03:33 AM

Welcome to LQ!!

I assume that someone else set up this webpage. Regardless, tell us as much as you can about how it was set up, what publishing SW was used, etc. Also, post a link to the site.

The typical web page starts with a file named "index.html". This is typically sent to the server by ftp or some other protocol, and installed in the correct folder so that it will be found when you enter the site address. Many web publishing programs, editors, etc. have built-in utilities for uploading the files to the server, managing changes, etc.

An html file can be generated by a wide variety of editors--including many word processors. The one I prefer is Bluefish.

Saving a file is a function of the editor you use.

I think you will benefit from getting a book on web design. Any reasonable-sized bookstore will have a good selection, or go to Amazon.

shaiful 11-23-2008 07:38 PM

Hi Pixellany,

Appreciate your reply. This is quite urgent and yes it is done by someone else. Software: Red Hat Linux release 9 (Shrike) Kernel 2.4.20-8.

Another question, can i edit the .htm file in the linux itself? Thanks.

r3sistance 11-23-2008 07:46 PM

Hi, I assume your using a command line interface? so the first thing that strikes to mind is Vi, It's a bit complicated tho but there are Vi guides around so I won't bother with it too much. It's also possible you might have Nano, that's easier to deal with then Vi in my opinion if you have it.

However it might be easier for some to just edit the website files on another computer and overwrite the pre-existing ones as necessary, means you can use things like revision control easier too and test things without having to overwrite your live files so to speak (you could also just copy the file and edit it else where but there can be security issues behind that with server side scripting languages like PHP and broken code). you could probably use SCP for this purpose to copy files securely to the server and then just move or copy them to where they need to be.

If you have a graphical user interface on the otherhand, there are also some editors within the application menu like kwrite for example.

pinniped 11-23-2008 07:48 PM

If you have some preferred editing software you can use 'wget' to download all of your web pages, do edits locally, then upload the pages to your server. Web pages are typically edited locally and then uploaded anyway. Editing the actual file which is in use would not be a good idea; what happens if someone goes to browse it while you're editing?

phantom_cyph 11-23-2008 08:01 PM

I'm an amateur website designer, and I used to take the trouble of running Dreamweaver through Wine, but with all the bugs that the two of them have together, I resorted to nano (or pico on some systems). Vi users, please don't flame me...but it would be easier to use nano or pico to edit your files than it would Vi. The only problem with a text editor like nano, pico, emacs, or vi, they don't show you broken syntax like Bluefish does (I think it does..) which is helpful when you aren't used to using HTML, PHP, or any other "languages" like that.

pinniped 11-23-2008 08:38 PM

Have you tried the Mozilla editor ("Composer")?

If you use KDE you can use 'kate'; it even has HTML syntax highlighting. If you're more daring, use 'emacs' (has syntax highlighting and all sorts of goodies that rabid lisp-programming emacs lovers have created).

[edit] Oops ... this was @ phantom_cyph, not the OP

phantom_cyph 11-23-2008 08:52 PM

Quote:

Originally Posted by pinniped (Post 3352293)
Have you tried the Mozilla editor ("Composer")?

If you use KDE you can use 'kate'; it even has HTML syntax highlighting. If you're more daring, use 'emacs' (has syntax highlighting and all sorts of goodies that rabid lisp-programming emacs lovers have created).

[edit] Oops ... this was @ phantom_cyph, not the OP

Haha. Nice. I did forget about kate, its a very good text editor for this if you use KDE. If you don't, you are out of luck. Does XFCE's mousepad do syntax highlighting? I don't think it does...

pinniped 11-23-2008 09:46 PM

Quote:

Originally Posted by phantom_cyph (Post 3352303)
Haha. Nice. I did forget about kate, its a very good text editor for this if you use KDE. If you don't, you are out of luck. Does XFCE's mousepad do syntax highlighting? I don't think it does...

Well, in XFCE you can still use emacs (or xemacs if you wish).

pixellany 11-23-2008 10:31 PM

Quote:

Originally Posted by shaiful (Post 3352249)
Hi Pixellany,

Appreciate your reply. This is quite urgent and yes it is done by someone else. Software: Red Hat Linux release 9 (Shrike) Kernel 2.4.20-8.

Another question, can i edit the .htm file in the linux itself? Thanks.

Linux is an operating system---the SW that actually does things is typically called an "application". For editing, there are a variety of choices, many of which have been discussed here already.

You can also do a Google search using something like "edit html linux".

salter 11-24-2008 11:50 AM

You can edit an HTML by any text editor or any application that allows for saving text files. To name but a few: gedit, kate, kwrite, open-office, bluefish, anjuta, etc.
Obviously it's better or at least easier to use a specific HTML editor (Bluefish for example).

In the end you have to copy your modified HTML file to the remote site. If you are wiorking on the server directly, either because your sitting physically in front of it, or you are using a VNC-client to access it, then you can modify the site contents directly.

Bookstores have tons of HTML guides. It really helps to have a few good ones in your hand during work. Something SAM's Teach Yourself books series.

geek_man 11-24-2008 12:36 PM

Hi!

I would use vi. It is difficult at the beggining but when you get used to it, it is easier and faster than a GUI program.


All times are GMT -5. The time now is 11:32 PM.