Tagged as Linux
Written on 2007-06-02 07:23:00
Happy Friday my fellow netizens! I've been meaning to write a piece about Linux on the Desktop and perhaps it just may surface this weekend. If anything though it has become more of a Linux and Mac perspective piece for me. I don't want to say anything just yet but I will say that it is more about what each has to offer than who's going to win on some higher level. That said, we've got some Linux Learning to do.
This time I'll be focusing on the concept of configuration files. Configuration files are more useful than you might think. Indeed, it may seem that any configuration that can be done should be done through nice pretty graphical toolkits but text file configuration can be incredibly helpful. Especially when for some reason the system won't boot and there's one little edit you could make in a configuration file to fix it if only Windows or Mac tried to let you boot to a command prompt to fix things. Not that you can't, it's just a bit of a pain in the ass compared to Linux. Then again maybe it happens more in Linux. Ok, I promise to save the rest for the Mac\Linux article. So, now that we've covered how to move around the filesystem with cd and how to act as the superuser with sudo we need a practical task to use those commands with. I've got just the thing. Say you install some nice new graphics drivers...but then your system won't boot into the GUI after the command prompt. Odds are good that those new drivers aren't working right. Wouldn't it be nice if you could just use the old ones? Well, you can. That's why text configuration files are useful. So, let's see how to solve this state of affairs with this week's application: nano.
The configuration file that tells the computer what graphics driver to use is stored on your system at "/etc/X11/xorg.conf". Open a terminal (as covered in our first lesson) and cd to the directory that holds the configuration file "cd /etc/X11/xorg.conf". Now, to edit it with our text editor (nano) type "nano xorg.conf". It will probably spit back some error about you not having adequate permissions to touch that file and go to hell. That's why we have sudo. Type "sudo nano xorg.conf" to tell the machine to open xorg.conf, with nano, as the superuser. It'll ask for the password and if you enter it correctly nano will start right up. Now, alternatively you could've skipped the whole cd step and just given the full path to the file at the start "sudo nano /etc/X11/xorg.conf" but I figured I'd employ as much that we've covered as possible. Now, you'll see the file in the editor, which won't remind you much of Microsoft Word by the way. Look on the bottom of the screen to where it says "^W where is". This is a shortcut. The ^ represents the control key. Hit Ctrl-W and nano will ask what you're looking for. Type (Section "device") (without parentheses) and hit enter. Notice how the list of shortcuts at the bottom changed. Under that there should be a line that looks something like (driver "some_driver"). Erase the some_driver part from quotations and type vesa to load a basic graphics driver and get your system running again. It should look like this (Driver "vesa") again, without the parentheses. Look at the shortcuts again. The one for saving (here referred to as "writing out") is ^O or Ctrl-O. Type Ctrl-O and hit enter when it asks for the filename to save it as the same name. Now reboot and you're all done but...ah wait...you don't know how to reboot do you? Ah well, I guess it'll have to wait til next week won't it?