LinHES Forums
http://forum.linhes.org/

Noob help - how do i edit a file ?
http://forum.linhes.org/viewtopic.php?f=5&t=12830
Page 1 of 1

Author:  beaster [ Sun Dec 03, 2006 1:11 pm ]
Post subject:  Noob help - how do i edit a file ?

I'm completely new to linux... Just installed R5D1 with a PVR-350 and I'm trying to edit my '/etc/init.d/gdm' file as per <http://mysettopbox.tv/phpBB2/viewtopic.php?t=11311> but I don't know how to do this. I foolishly tried using the old DOS command "edit" but it didn't work :( could someone please help me before I a) lose my hair or b) install R5C7!

Thanks,

jp

Author:  call_me_ben [ Sun Dec 03, 2006 1:32 pm ]
Post subject: 

type "nano" followed by the full path of the file you want to edit.

Author:  tjc [ Sun Dec 03, 2006 1:59 pm ]
Post subject: 

See this page for more. http://www.knoppmythwiki.org/index.php?page=LinuxTips

Remember that you need to login as the appropriate user to edit certain files.

Author:  soundoff [ Sun Dec 03, 2006 5:04 pm ]
Post subject: 

vim is my editor of choice. man is your frend when your new..

man vim

man nano

Author:  mjl [ Mon Dec 04, 2006 7:56 pm ]
Post subject: 

Hi,
I kind of like gedit but you have to apt-get install gedit first.
Mike

Author:  johnboy68 [ Tue Dec 05, 2006 4:55 am ]
Post subject: 

Here is what I do. And since you are new to Linux it would be good for you to look into the two programs even if you don't use them for this topic.

If you haven't already download PuTTy, do so. It is a SSH (secure shell) client that will allow you to connect to your mythbox remotely. With PuTTy you can run all your command line stuff remotely.

Also, look into WinSCP. This will allow you to connect to your mythbox and manage files from a "windows" program.

Most the time when I need to edit a file on my mythbox I connect with WinSCP which allows me to navigate the file system with a GUI almost like Windows Explorer (although it looks more like a GUI FTP program). And then I can either edit the file by copying it to my Windows box by just drag and dropping it where I want it or most times I can just double click it and it will automatically open the file in the appropriate program and then when I am done it will save it right back to the mythbox.

I am assuming you mostly use Windows. Just google PuTTy and WinSCP and you will find them and how to use them.

I do agree that you need to learn at least VI and Nano as they, at some point, will be needed. You never know when you won't be able to connect to your mythbox and will have to edit files locally.

Good luck :)

Author:  mjl [ Tue Dec 05, 2006 7:00 am ]
Post subject: 

Hi
johnboy68 has some good guidence except the part for vi. nano is quit friendly and the user guide is at the bottom of the window. It will also work for user root or mythtv as it is text display. To edit a file with nano simply at the $ nano -w <your-file-name> (use the -w allways).

Mike

Author:  abigailsweetashoney [ Tue Dec 05, 2006 1:44 pm ]
Post subject: 

If you care to learn "vi" or "vim" you can read thru these docs...

http://www.arizonaed.com/unix/vimfaq.html
http://www.arizonaed.com/unix/vi-cheatsheet.html

Fyi,

-Abs

Author:  tjc [ Tue Dec 05, 2006 10:15 pm ]
Post subject: 

johnboy68 wrote:
Here is what I do. ... either edit the file by copying it to my Windows box by just drag and dropping it where I want it or most times I can just double click it and it will automatically open the file in the appropriate program and then when I am done it will save it right back to the mythbox.

A couple words of caution here, MS-Windows can leave artifacts in your files many Linux/Unix programs are not happy about, like CR/LFs instead of just LFs, VTs, files without a final LF at the end, ... You are generally better off opening an ssh session and editing the files with some kind of native editor on the Linux side. We regularly have to troiubleshoot problems for folks who've gotten bad/missing invisible characters in their config files this way.

Author:  falinskip [ Tue Dec 05, 2006 10:35 pm ]
Post subject:  winvi32

There is also a VI editor for windows that will not leave artifacts in the code. It is called WinVI32.exe, you can find it using this link or searching using Google.

http://www.winvi.de/en/download.html

I often drag a unix file into it and save it back to my windows server, then move it back over a samba share.

Paul

Author:  tjc [ Tue Dec 05, 2006 10:39 pm ]
Post subject: 

MS-Windows versions of freeware editors like jed or vim will also do the right thing. Notepad, however, "does not play well with others". ;-)

Author:  mjl [ Tue Dec 05, 2006 11:11 pm ]
Post subject: 

Hi,

I have used wordpad without problems but that is usually a very rare thing for me to edit linux scripts on a M$ machine. You could boot with ubuntu live and then ssh into your myth box or as mentioned previous, PuTTY on windows works very well, almost like being there :) PuTTY I use a lot.

http://www.chiark.greenend.org.uk/~sgtatham/putty/

Mike

Author:  psicard [ Wed Dec 06, 2006 7:13 pm ]
Post subject: 

To edit linux files from Windows, I use this:
http://www.linspect.com/product/ledit

I find it easier than using putty to ssh into my myth box and running nano )or whatever).

Page 1 of 1 All times are UTC - 6 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/