Thursday, February 12, 2009

Who Says It's Easy?

I started two blog entries today that ended up crumpled up in the virtual wastebasket. Maybe I'm just too lazy.

The first one was gonna be about customizing the Linux command prompt. My user prompt looks something like this:

steve[~]$

That prompt shows my username (steve), the directory I'm in (~, which indicates the home directory, /home/steve), and finally, the dollar sign, which is where I can start typing. I made the color of the prompt green because I think it's a friendly color. My root prompt in the terminal is colored red to remind me that I'm working as a root user and that I have to be more careful.

I started looking over my notes on how I've customized my command prompts. The notes start out like this:

For changing the user prompt in bash, use the line

export PS1="\e[1;32m\u[\w]\\$ \e[m "

in ~/.bashrc.

For changing the root prompt, I'm using

export PS1="\[\e[1;31m\]\u[\w]\\# \[\e[m\] "

in /root/.bashrc


Yuck. Lots of explaining to do there.

And to make it worse, in Mint Elyssa and Ubuntu Hardy, customizing the prompts was a lot more complicated than that. For one thing, Elyssa didn't have a ~/.bashrc file to begin with, and I had to copy the ~/.bashrc_vanilla file
over to a new ~/.bashrc file, then work with that. Second, the PS1 variable defined there was much more complicated even than what's shown above.

In the end, I figured anybody who wants to learn how to do this better just Google it. (Search customize bash prompt if you're interested.)

Then, I wanted to write some things on the subject of mounting filesystems in Linux. OK, not so bad. A filesystem is any place where your data is stored: a floppy disk, a CD, a USB flash drive, a partition on your hard drive. Each filesystem needs to be mounted before it can be accessed. The mount points can be any empty directory. The file /etc/fstab determines how and where each filesystem is mounted. Blah, blah.

The more you go into it, the more there is to talk about. I finally decided, anybody who wants to learn about this can read man mount. Or Google it.

Look, I'm a Linux lover. I'll probably never go back to using Windows as my primary system at home, and I seriously doubt that I'll ever buy a Mac. But, I'm not gonna try to convince anyone to use Linux.

Sure, somebody could go with Ubuntu or another fairly easy distro and not run into too much trouble, but the fact is, you've got to really love messing with computers and be willing to put yourself through some learning to be able to take advantage of what Linux has to offer. For a lot of things, I get worn out just thinking about how to explain ways of doing stuff.

I mean, you're used to Windows and C: drives and G: drives, that kind of thing. Then you look at a typical Linux filesystem, like mine in Linux Mint:

/
/bin
/boot
/build
/cdrom
/dev
/etc
/home
/initrd
/lib
/lost+found
/media
/mnt
/proc
/root
/sbin
/srv
/sys
/temp
/usr
/var

Do you remember how you felt when you first started with Linux and saw all that?

Do you remember struggling with the difference between the root directory (/) and root's home directory (/root)?

I do.

Folks, don't go telling people that Linux is just as easy as Windows. Maybe it is, maybe it isn't, but admit it, there's a lot of difficult stuff there.

And, I don't even think we should try to be Linux Evangelists, thinking we should convert everyone to Linux. Most of the folks who are willing to learn about it and who will take advantage of what Linux has to offer will find their way over to Linux on their own. Everybody else is probably happy enough using what they're using.

Having said all that, though, I have to admit: If my parents lived nearby, I'd have set up their computer with Linux long ago. They'd be web-browsing with Firefox, sending emails, doing everything they're doing now. I'd probably stop over now and then to run Synaptic, or maybe to install the latest Mepis release, and they wouldn't have to be bothered with any of this Linux stuff, any more than they're bothered right now with Windows stuff. Their machines would be free of malware, and they could tell all their friends that they "use Linux." If they wanted to learn more, they could, but they wouldn't have to.

A computer is supposed to make your life easier, isn't it?

No comments: