editing files


12 posts
by mannock » Sun Jan 20, 2013 11:36 am
I seem to have trouble even with basic linux tasks, I follow guides carefully but never quite get to the end of the task, and it's starting to make me wonder 'why bother with linux, it's so hard' I bought the Pi thinking I could learn how to use linux and the first two things I tried were: edit the config file to get the screen resolution right, and edit the inittab file to get pi to boot automatically into the gui without any input from me except power up. In the first case it will only open a new blank file instead of the existing config and when I try to overwrite the existing one it says unable to open file to write. In the second case it opens the file ok but again refuses to save my changes for the same reason. Is this a permissions thing? And why are these things not explained to absolute beginners like me, of which there must be many thousands. Sorry to sound grumpy, but I've spent many hours trying to do basic stuff with no success at all. btw, I'm using debian which was preloaded on my sd card from new.
Posts: 6
Joined: Sun Jan 20, 2013 11:20 am
by jamesh » Sun Jan 20, 2013 12:03 pm
Hi,

Linux is one of those things that is a PITA at first, then once you do get the hang of it (I'm no expert) you begin to realise how good it actually is. But it does take some effort because it can be inconsistent and odd compared with Windows.

So to you problems. Can you post exactly what you are typing in, then we will be able to tell you where you are going wrong.
Soon to be employed engineer - Hurrah! Volunteer at the Raspberry Pi Foundation, helper at PiAcademy September 2014.
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 11917
Joined: Sat Jul 30, 2011 7:41 pm
by RobHenry » Sun Jan 20, 2013 3:30 pm
The standard pi user does not have privileges to edit config.txt so you have to do it using the authority of the system administrator (or superuser). This is achieved by prefixing your command with sudo thus:

sudo nano config.txt

Hope this helps you get going.
Posts: 245
Joined: Fri Sep 21, 2012 9:04 pm
Location: Edinburgh
by Jim JKla » Sun Jan 20, 2013 4:44 pm
Or you can edit it from windows as config.txt is in the bit of the SD that Windows can see.

NOTE use Wordpad not Notepad.

Linux is not for the faint hearted, it is a seriously robust operating system.

You have to take note that the Raspberry Pi is the new kid on the block and we are still ironing some of the lumps out. Every time you get knocked back just think how much you are NOT paying. ;)
Noob is not derogatory the noob is just the lower end of the noob--geek spectrum being a noob is just your first step towards being an uber-geek ;)

If you find a solution please post it in the wiki the forum dies too quick
User avatar
Posts: 2198
Joined: Sun Jan 29, 2012 11:15 pm
Location: Newcastle upon Tyne UK
by mannock » Sun Jan 20, 2013 6:43 pm
thanks for your replies. ok, I tried sudo nano config.txt and it just opened a new empty file. but if I look at config.txt in the file manager it has an entry: disable_overscan=0 so I am not sure why I don't see this when using the command line. Looking on google I saw another version:
sudo nano /boot/config.txt and this one does open the actual file. however I am not sure what to add or change to get the correct resolution. at the moment my res. is 1824 x 984 and I want it to be
1920 x 1080. I tried changing the 0 to 1 but when I tried to save it all I got was "cannot open file to write" . and I'm not sure that disabling overscan would do the trick. would it?
Posts: 6
Joined: Sun Jan 20, 2013 11:20 am
by DeeJay » Sun Jan 20, 2013 7:03 pm
mannock wrote: I tried sudo nano config.txt and it just opened a new empty file. but if I look at config.txt in the file manager it has an entry: disable_overscan=0 so I am not sure why I don't see this when using the command line. Looking on google I saw another version:
sudo nano /boot/config.txt and this one does open the actual file.


Just like the Windows command line, linux has the concepts of a current directory, and a path to a file. The file is named config.txt. The path to it is /boot. If you were 'in' /boot - that is if /boot was your current directory - then you could access it as 'config.txt'. If your current directory is elsewhere nano fails to find the file you want and helpfully gives you a new empty one, as you have discovered.
How To Ask Questions The Smart Way: http://www.catb.org/~esr/faqs/smart-questions.html
How to Report Bugs Effectively: http://www.chiark.greenend.org.uk/~sgtatham/bugs.html
User avatar
Posts: 2033
Joined: Tue Jan 01, 2013 9:33 pm
Location: East Midlands, UK
by DeeJay » Sun Jan 20, 2013 7:10 pm
You might find this reference to editing /boot/config.txt helpful?

http://elinux.org/R-Pi_ConfigurationFile

The content of the file and its settings are described here -

http://elinux.org/RPi_config.txt
How To Ask Questions The Smart Way: http://www.catb.org/~esr/faqs/smart-questions.html
How to Report Bugs Effectively: http://www.chiark.greenend.org.uk/~sgtatham/bugs.html
User avatar
Posts: 2033
Joined: Tue Jan 01, 2013 9:33 pm
Location: East Midlands, UK
by mannock » Sun Jan 20, 2013 8:56 pm
right, I have the config file open. all it contains is disable_overscan=0
I change it to disable_overscan=1 to see if the screen size becomes the full 1920 x 1080 on reboot
then I click ctrl x to save but it does nothing ?? shouldn't ctrl x save it?
so I close it, and when asked if I want to save changes I say yes, then it says file already exists and do I want to overwrite it, I say yes, then it says ''can't open file to write'' ''access denied''

what now?
Posts: 6
Joined: Sun Jan 20, 2013 11:20 am
by redhawk » Sun Jan 20, 2013 9:03 pm
Sid you use the "sudo" prefix before running the editing program??

Richard S.
User avatar
Posts: 3519
Joined: Sun Mar 04, 2012 2:13 pm
Location: ::1
by efflandt » Sun Jan 20, 2013 10:34 pm
Code: Select all
sudo nano /boot/config.txt

should open and allow you to modify/save the real one regardless of what directory you are in. You may be opening one in your home directory that you opened before.
Posts: 359
Joined: Mon Dec 03, 2012 2:47 am
Location: Elgin, IL USA
by radiotitoraspi » Sun Jan 20, 2013 11:14 pm
is it possible to edit config.txt in Windows Wordpad instead of notepad ?

And Notepad++ ?
Posts: 12
Joined: Thu Jan 17, 2013 10:48 pm
by mannock » Mon Jan 21, 2013 5:46 pm
editing in debian was too difficult for me so I decided to use windows notepad for now. I have added a line in the config file as seen in the http://elinux.org/RPi_config.txt list of video modes:
hdmi_mode=16 as this was the one listed as 1080p at 60hz
this is an improvement but the resolution is still only 1824 x 984. how do I get it to 1920 x 1080p, can I just type it in somewhere?
Posts: 6
Joined: Sun Jan 20, 2013 11:20 am