Radified Community Forums
http://radified.com/cgi-bin/yabb2/YaBB.pl
Rad Community Technical Discussion Boards (Computer Hardware + PC Software) >> PC Hardware + Software (except Cloning programs) >> Continued: Linux and Shell Scripting
http://radified.com/cgi-bin/yabb2/YaBB.pl?num=1246200520

Message started by Rad.in.UbuntuVM on Jun 28th, 2009 at 9:48am

Title: Continued: Linux and Shell Scripting
Post by Rad.in.UbuntuVM on Jun 28th, 2009 at 9:48am
Your guide mentions that the RPM package manager is better than apt-get. Why is that? What advantages does RPM have?

Are you familiar with both Debian-based and Redhat-based systems? Or do you specialize in one? Those are the two main flavors, right? Plus Suse.

I like the way your guide feels like a friend talking to you, focusing on the initial important points, cutting thru the clutter.

Also, how do you check/see if there are any updates to Ubuntu/Gnome/etc??

doesn't matter if you put the argument BEFORE the command??

eg

-l ls

when you type "cd" and hit <enter> key, that takes you to your "home" directory .. BUT that's isn't your /home directory, right?

kinda confusing terminology .. similar to "root" directory .. slash vs /root.

Title: Re: Continued: Linux and Shell Scripting
Post by MrMagoo on Jun 29th, 2009 at 2:29am

Rad.in.UbuntuVM wrote on Jun 28th, 2009 at 9:48am:
Your guide mentions that the RPM package manager is better than apt-get. Why is that? What advantages does RPM have?

I meant that RPM is more powerful than Yum (rather than apt-get), although I should reword the guide because really yum and rpm work together.

I actually like apt-get better than yum/rpm because I feel like it is easier to find packages and it seems to do better at resolving dependencies.  However, I think RPM is still a great package manager and probably more powerful overall than apt-get.


Rad.in.UbuntuVM wrote on Jun 28th, 2009 at 9:48am:
Are you familiar with both Debian-based and Redhat-based systems? Or do you specialize in one? Those are the two main flavors, right? Plus Suse.

Ubuntu is my favorite desktop distribution, so I know debian-style systems well.  I've tried several other desktops distros but have come back to Ubuntu several times for its multimedia support and how easy it is to install and update.  Most everything works after install without have to manually configure anything and its easy to keep up with updates.

I also know Red Hat fairly well because it is one of the most popular distros to run a server on.  As a server, it is stable, easy to set up, and easy to manage.  The only reason I don't use Red Hat as a desktop is because I've had trouble with multimedia.  Basic sound and video isn't too hard, but transcoding video or advanced applications like MythTv don't seem to integrate well on Red Hat.

Suse is popular because it has the support of Novell.  The desktop felt bloated last time I tried it, and I've used it in a professional environment, so I don't know much about it.  They have contributed a lot of good things to the community, tho, like XGL graphics acceleration.

The other major flavor of Linux is Mandrake based distributions.  They aren't nearly as popular as Red Hat and Debian based systems.  Notable offshots of Mandrake are Linspire (formerly Lindows - the distro sold by Walmart for a short time,) and PCLinuxOS.

Besides the main flavors, there are several more independent distros.  Notable one's include Slackware, Linux From Scratch, and Gentoo.


Rad.in.UbuntuVM wrote on Jun 28th, 2009 at 9:48am:
I like the way your guide feels like a friend talking to you, focusing on the initial important points, cutting thru the clutter.

I've been told my writing style is conversational, which I take as a compliment.

What I tried to do with the guide is bring together enough information to get someone started in Linux and point them towards how to expand their knowledge.  I've never been 100% satisfied that it meets that goal, and as I learn more about Linux and get experience teaching it to new people, I see ways to improve the guide.  I hope to make some time to reorganize the guide this fall.


Rad.in.UbuntuVM wrote on Jun 28th, 2009 at 9:48am:
Also, how do you check/see if there are any updates to Ubuntu/Gnome/etc?? 

Ubuntu will notify you with an update icon that shows up near the clock.  The user experience is similar to Windows automatic updates (although it is much more obvious what is being updated and why.) 

You can also use the commands:

Quote:
sudo apt-get update
sudo apt-get upgrade

to fully update your system manually.

Title: Re: Continued: Linux and Shell Scripting
Post by MrMagoo on Jun 29th, 2009 at 2:35am

Rad.in.UbuntuVM wrote on Jun 28th, 2009 at 9:48am:
doesn't matter if you put the argument BEFORE the command??

Yes.  The command has to come first. 


Rad.in.UbuntuVM wrote on Jun 28th, 2009 at 9:48am:
when you type "cd" and hit <enter> key, that takes you to your "home" directory .. BUT that's isn't your /home directory, right?

Every user has their own home directory.  Think of it as your 'My Documents' folder in Windows.  Your home directory is usually named after your username, and contained with the /home folder.  So, my home directory is '/home/magoo'.  Yours might be '/home/rad' or whatever your login name is on your VM.

The root user's home directory is in a special place: /root

While the naming is a little confusing, that directory is different from the root of the file system, which is: /

Title: Re: Continued: Linux and Shell Scripting
Post by MrMagoo on Jun 29th, 2009 at 2:42am
This Topic was moved here from PC Hardware + Software (except Cloning programs) by MrMagoo.

Title: Re: Continued: Linux and Shell Scripting
Post by MrMagoo on Jun 29th, 2009 at 2:42am
Just noticed our original thread is over 50 posts.  Splitting it up so nothing weird happens to it.

Title: Re: Continued: Linux and Shell Scripting
Post by Rad.in.UbuntuVM on Jun 29th, 2009 at 2:13pm

MrMagoo wrote on Jun 29th, 2009 at 2:42am:
Just noticed our original thread is over 50 posts.Splitting it up so nothing weird happens to it. 

Thanks. I thought about doing the same. I'm so glad we got off that stupid Shared-Hosting account/server and now have a VPS with some decent horsepower to handle bigger files, cuz I think the overloaded Shared-Hosting server was at ythe root of those problems.

Learned today that Linux does not have/support file associations like Windows, in that a specific prgm is not assigned to open a specific file extension.

This was confusing because many (all?) of the files contained in the forum software DO have file extensions (such as *.pl (Perl) and *.log, *.lng (language), etc.), but I recall, early on that YaBB used to have *two* different downloads, one for Perl,that ended in *.cgi (e.g. Yabb.cgi) and another that ended in *.pl (e.g. YaBB.pl)..

.. so it's not exactly clear HOW these different files are handled and processed (is the correct term 'parsed'?) .. if Linux does not associate the different extensions with with different files types?

Title: Re: Continued: Linux and Shell Scripting
Post by Rad.in.UbuntuVM on Jun 29th, 2009 at 2:48pm

MrMagoo wrote on Jun 29th, 2009 at 2:29am:
I meant that RPM is more powerful than Yum

What is Yum? I think I recall using Yum with Ruby .. no?


MrMagoo wrote on Jun 29th, 2009 at 2:29am:
apt-get .. better at resolving dependencies

how do 'dependencies' work (in a nutshell)?


MrMagoo wrote on Jun 29th, 2009 at 2:29am:
RPM .. probably more powerful overall than apt-get.

How so? What features/capabilities make it more powerful? (kinda my original question)


MrMagoo wrote on Jun 29th, 2009 at 2:29am:
I hope to make some time to reorganize the guide this fall.

Google sees/notices updates and will give you (the guides/its pages) points for that. I know it's a lot more work than it seems.


MrMagoo wrote on Jun 29th, 2009 at 2:29am:
Ubuntu will notify you with an update icon that shows up near the clock.

Yeah, I've seen that, and that is what I was looking for, but saw no way to tell Ubuntu to "go look and see" if there were any updates.


MrMagoo wrote on Jun 29th, 2009 at 2:29am:
You can also use the commands:

Seems that once you learn the various commands, you know them for all-time, as they don't change (much?). In other words, it seems as if time spent learning Linux commands is time well spent (if you're going to be using Linux).


MrMagoo wrote on Jun 29th, 2009 at 2:35am:
Yes.The command has to come first.

Under NO circumstances can an option come BEFORE a program?? .. e.g.
$ -l ls
this will error?


MrMagoo wrote on Jun 29th, 2009 at 2:35am:
Every user has their own home directory. Your home directory is usually named after your username, and contained with the /home folder. So, my home directory is '/home/magoo'.Yours might be '/home/rad' or whatever your login name is on your VM.

Yes, you are correct. I see. I was getting confused with "/rad" being "my home directory" when "/home" is called/named "home". One is named 'home' while the other is the 'user home'.

Title: Re: Continued: Linux and Shell Scripting
Post by MrMagoo on Jun 29th, 2009 at 2:57pm

Rad.in.UbuntuVM wrote on Jun 29th, 2009 at 2:13pm:
Learned today that Linux does not have/support file associations like Windows, in that a specific prgm is not assigned to open a specific file extension.

Well, Linux doesn't use file extensions to manage it's associations, so it is completely different than Windows, but it does know what program to open most files with.  I don't know exactly how it does it.  Now that you bring it up, I realized I have always wondered exactly how it works, so maybe I'll study it a little today if I have time.

I know that any binary file just executes.  Also, most scripts (shell, perl, ruby, etc) have a special note in the first line of the program that tells the system how to execute it.  For example, the first line of a Perl program should be:
#!/usr/bin/perl
or something similar.

I think media files have meta-data contained in the file to help the system know if it is a video or music or whatever, but I'm not sure how the system knows it is a media file.  Maybe I can give you a better answer in a few days.


Rad.in.UbuntuVM wrote on Jun 29th, 2009 at 2:13pm:
This was confusing because many (all?) of the files contained in the forum software DO have file extensions (such as *.pl (Perl) and *.log, *.lng (language), etc.),

The file extensions used in Linux file names are for people to read, not Linux.  It is helpful to users of a computer for log files to have .log extensions and Perl files to have .pl extensions and so on, so you can see what the file is at a glance.  Linux doesn't care what the file name is.

Title: Re: Continued: Linux and Shell Scripting
Post by MrMagoo on Jun 29th, 2009 at 3:25pm

Rad.in.UbuntuVM wrote on Jun 29th, 2009 at 2:48pm:
What is Yum? I think I recall using Yum with Ruby .. no?

You can think of Yum as the Red Hat equivalent to apt-get.  For example, to install vim on Red Hat you might type "yum install vim".  Debian's equivalent to RPM is called Deb.  In my experience, RPM is more powerful than Deb because of the ability to run scripts before and after the package install and do lots of other things besides install packages.  Deb may have those capabilities, but my experience with it is limited.


Rad.in.UbuntuVM wrote on Jun 29th, 2009 at 2:48pm:
how do 'dependencies' work (in a nutshell)?

When you install an application, it might rely on the capabilities of other applications in order to work properly.  For example, MythTv needs MySQL in order to work correctly.  This makes MySQL a dependancy of MythTv. 

So, when you install MythTv with apt-get, it needs to see what dependencies MythTv has, then check to see which one's you have installed and install all of the dependencies you don't already  have.  Now, MySQL may have dependencies of its own that have to be installed before MySQL will work right, and its dependencies cold also have dependencies.  This sort of dependency chain makes installing a complex application like MythTv a very arduous process, and a lot of work has gone into package managers like apt-get to automate it all.


Rad.in.UbuntuVM wrote on Jun 29th, 2009 at 2:48pm:
Seems that once you learn the various commands, you know them for all-time, as they don't change (much?). In other words, it seems as if time spent learning Linux commands is time well spent (if you're going to be using Linux).

The commands change more if you change flavors of Linux (move from Debian based to Red Hat based, for example) than they change with time.  Once you learn them, they work pretty much the same forever.  When they do change, there is usually an option to use the old behavior so that people have plenty of time (several years) to learn the new ways before giving up the old. 

Shell commands are pretty universal between all of Unix/Linux, so those are definitely time well spent.  The location of various files and the system utilities are what changes when you move between distributions, so there is a learning curve when you switch but it is much much easier than learning Linux the first time.  You can switch distributions and be immediately productive, it just takes a few months to get comfortable with a new distro.


Rad.in.UbuntuVM wrote on Jun 29th, 2009 at 2:48pm:
$ -l ls
this will error?

Yes, that will error.

Title: Re: Continued: Linux and Shell Scripting
Post by MrMagoo on Jun 29th, 2009 at 4:00pm

Rad.in.UbuntuVM wrote on Jun 29th, 2009 at 2:48pm:
I know it's a lot more work than it seems.

I don't mind the work as long as I'm helping people get information that would be hard to get if my guide didn't exist. 

When I wrote my BitTorrent guide, BitTorrent was pretty new and lots of people had never heard of it or didn't know how it worked.  These days, you can find a bittorrent guide for just about every bittorrent client on every OS.  I don't like to be that specific.  I prefer to teach people to fish than to hand the fish to them, so I keep my guides more generally applicable.

Same thing with Spyware.  When I wrote that guide, there were computer savvy people with no idea why their computer was slow and why they got lots of pop-up ads.  These days, spyware is a household term and any decent anti-virus will check for it.  That guide in it's current form is past its prime, and I've been thinking about how it should look if I rewrote it.  People still need information on computer security, but I'm not sure what my unique contribution to that should be.

I'm pretty happy with the wireless guide.  There are parts I'd like to clean up to make what I'm trying to say a little clearer, and there are a few new related technologies (like Ethernet over Coax) that I'd like to include.  Other than that, I haven't found other guides that do a better job of explaining all the basics of operating a wireless network.  They all seem to leave something out or over-simplify.

I've always found the Linux guide difficult.  It's such a big subject that it's hard to bring someone from brand new to the point where they are productive in a guide that is short enough to hold their attention.  I tried to focus on topics that would cause roadblocks to getting going with Linux and give enough info that a reader would know how to get around those road blocks.  The other problem is how to stay general.  I want the information to apply to Linux in general, not any specific distro.  There are plenty of guides on how to install Ubuntu or Red Hat or whatever, so I want to teach people things that apply to all of Linux.  I'm glad I have something out there for people who are interested in it, but I wish I could get people off to a better start.

Like I said, I learn a little every day, so my perspective changes.  Linux changes too.  It is easier than ever for a new person to have a useful Linux system with distro's like Ubuntu.  So, hopefully I can make some improvements to the guide later this year.

Title: Re: Continued: Linux and Shell Scripting
Post by Rad on Jun 29th, 2009 at 5:15pm
the 'cat' program/command displays the contents of a text file (e.g. *.txt, or *.html, etc.)

is 'cat' short for something?

i mean, it doesn't seem intuitive to remember (like cp or mv or rm or ls)

Title: Re: Continued: Linux and Shell Scripting
Post by MrMagoo on Jun 29th, 2009 at 5:56pm

Rad wrote on Jun 29th, 2009 at 5:15pm:
is 'cat' short for something? 

It is short for concatenate.  The original use for the program was to concatenate two text sources (e.g. "cat textfile1 textfile2" would produce a single file with the contents of textfile2 pasted at the end of textfile1.) 

It just so happens that the default place for cat to put its result is stdout, which is usually your shell.  So, these days it is most commonly used to display the contents of a text file.  It is usually used with grep to narrow down what you are looking for.

For example:
"cat /etc/fstab | grep home"
would show you how your home directory is configured to be mounted at boot time.

Title: Re: Continued: Linux and Shell Scripting
Post by Rad.in.UbuntuVM on Jul 6th, 2009 at 11:37pm
i am not clear on the concept of a mount point. can you explain how that works?

i am learning about many diff commands. what are the common ones you use most frequently?

it would seem that vi is a biggie, no? and that a familiarity with that is necessary, as you have already seemed to indicate.

what is the


Quote:
X.org version of the X Window System

what is your feeling of gnome vs kde?

what would you say is linux's biggest weakness?

what are linux's main strengths over windows, other than cost.

Title: Re: Continued: Linux and Shell Scripting
Post by MrMagoo on Jul 7th, 2009 at 12:08am

Rad.in.UbuntuVM wrote on Jul 6th, 2009 at 11:37pm:
what is your feeling of gnome vs kde?

I like Gnome better than KDE 3.5, but its just personal preference.  Gnome feels cleaner.  KDE 4.0 is out and is beautiful, but isn't ready for end-users just yet. 


Rad.in.UbuntuVM wrote on Jul 6th, 2009 at 11:37pm:
what would you say is linux's biggest weakness?

Lack of vendor support.  If I could run games in Linux, I'd never need Windows at home.  There are many applications people depend on that don't *just work* in Linux.  You can make many of them work, but that isn't good enough for the end user.  There is also still some hardware that struggles (as you have discovered with your wireless chip.)  Things have to *just work* to gain the approval of the masses (and even then sometimes it isn't easy enough,) and that requires some cooperation from vendors. 


Rad.in.UbuntuVM wrote on Jul 6th, 2009 at 11:37pm:
what are linux's main strengths over windows, other than cost.

To me, the cost isn't a big deal.  I'd pay more for Linux than I'd pay for Windows.  Linux is free in 2 ways - the cost of it is free (free as in free beer during happy hour,) and it is free for the user to do with as they please (free as in free s speech.)

To me, Linux's greatest strength is that it is free (as in free speech.)  I use it because I can do what I want with it.  I can install it anywhere and make it behave the way I want it to.  With Windows, you are stuck with the underlying system Microsoft has decided is best for you.  With Linux, you can swap out, change, remove, or add anything you like.  And, with a world-wide user-base, there are tons of applications and instructions for making your computer do almost anything. 

Between that and Linux's reputation for stability, it is quickly becoming the choice for everything from the Space Shuttle to smart phones (both Google's Android and Palm's WebOS are Linux-based, and the iPhone OS is BSD based.)

I'll try to answer the rest of your questions over the next day or so.  Some of them aren't easy to answer in a few sentences.

Title: Re: Continued: Linux and Shell Scripting
Post by MrMagoo on Jul 7th, 2009 at 12:17am

Rad.in.UbuntuVM wrote on Jul 6th, 2009 at 11:37pm:
what is the

Quote:
X.org version of the X Window System

Xorg provides the graphical environment for Linux.  It handles mouse interaction and graphical display.

http://www.x.org/wiki/

Gnome and KDE (and most other windows managers) are built on top of X.  You can use X by itself (without Gnome or KDE) but it is not a modern user interface by itself.

Title: Re: Continued: Linux and Shell Scripting
Post by Rad.in.UbuntuVM on Jul 7th, 2009 at 1:20am

MrMagoo wrote on Jul 7th, 2009 at 12:17am:
Xorg provides the graphical environment for Linux. 

is xorg different from xwindows? or are they talking about the same thing?


MrMagoo wrote on Jul 7th, 2009 at 12:08am:
To me, Linux's greatest strength is that it is free (as in free speech.)

this requires a knowledge of programming, yes? what language is/was used to prgm linux? what do you use to compile your modded versions?

Title: Re: Continued: Linux and Shell Scripting
Post by MrMagoo on Jul 7th, 2009 at 4:23pm

Rad.in.UbuntuVM wrote on Jul 7th, 2009 at 1:20am:
is xorg different from xwindows? or are they talking about the same thing?

X.org is the organization that makes XWindows.


Rad.in.UbuntuVM wrote on Jul 7th, 2009 at 1:20am:
this requires a knowledge of programming, yes?

No, usually it doesn't.  That's what was getting at mentioning the world-wide user-base.  I've found that someone has usually already written something that does what I want to do.  If you know how to install the program you need and configure the system to use it, you are set.


Rad.in.UbuntuVM wrote on Jul 7th, 2009 at 1:20am:
what language is/was used to prgm linux?

Mostly C.


Rad.in.UbuntuVM wrote on Jul 7th, 2009 at 1:20am:
what do you use to compile your modded versions? 

The gcc compiler is sort of the standard compiler for Linux.  It is (of course) free (as in speech and beer.)

Title: Re: Continued: Linux and Shell Scripting
Post by MrMagoo on Jul 7th, 2009 at 4:54pm

Rad.in.UbuntuVM wrote on Jul 6th, 2009 at 11:37pm:
i am not clear on the concept of a mount point. can you explain how that works?

So Linux doesn't address it's drives with A:, B:, C:, etc, which if you think about it, is kind of abitrary anyway.  Instead, Linux uses mount points.  A mount point is little more than an empty folder that the contents of a disk sits in. 

Say you have one drive with 3 partitions.  Partition 1 is your root partition ("/").  The contents of that partition get mounted at the root "/" mount point.  That partition is going to contain a bunch of files and folders.  How, say paritition 2 has your home directories.  Partition 1 will have an empty folder named /home.  Partition 2 will have all your home directories (rad, magoo, user3, user4, etc.)  You mount partition 2 in the empty folder /home.  Now, /home is no longer empty, and you can access the contents of partition 2 by browsing /home/rad, /home/magoo, /home/user3, etc.

Now, say user4 has a TON of data, so it doesn't fit on the same partition as all your other home folders.  So, user4's data is on partition3.  You can mount partition3 onto /home/user4.  Now, that data is accessible there, right where it should be.

Windows will also let you mount partitions into empty folders, achieving the exact same effect, but I've never seen it done by anyone but me in practice.

Title: Re: Continued: Linux and Shell Scripting
Post by Spanky on Jul 7th, 2009 at 10:05pm

MrMagoo wrote on Jul 7th, 2009 at 4:23pm:
Mostly C.

so if you wanna tweak the linux source code, you would do that in/with C?

have you ever tweaked the kernel?

Title: Re: Continued: Linux and Shell Scripting
Post by MrMagoo on Jul 7th, 2009 at 11:49pm

Spanky wrote on Jul 7th, 2009 at 10:05pm:
so if you wanna tweak the linux source code, you would do that in/with C?

Yes.  Most of the OS is written in C. 


Spanky wrote on Jul 7th, 2009 at 10:05pm:
have you ever tweaked the kernel?

No, I've never changed the source code. 

I have compiled a custom kernel.  Compiling your own kernel allows you to remove modules you don't need and compile in custom stuff.  You can make it faster, or more secure, or tweak a lot of other things to fit your needs.  It doesn't require editing C source code, tho.  You can edit text-based make files or use a menu based kernel compiler.  It does take a good understanding of what your particular situation requires from the kernel.

The only common reason for compiling a custom kernel in Linux is to harden it for security.  It is more common to need a custom kernel with the BSD flavors, which is where I learned it.

Title: Re: Continued: Linux and Shell Scripting
Post by Rad.in.UbuntuVM on Jul 12th, 2009 at 1:11am

MrMagoo wrote on Jul 7th, 2009 at 11:49pm:
Compiling your own kernel allows you to remove modules you don't need and compile in custom stuff. It doesn't require editing C source code, tho. 

Interesting .. especially that you don't have to edit any source code.

One thing I seem to be having trouble grasping is when you do and don't add an initial fwd slash when using paths to various files and folders.

I understand the concept of relative (to the current directory) and absolute paths. Most of the time, it seems an initial fwd slash is NOT used .. e.g » business/reports/july/sales.txt

but then other times i see them using the fwd slash, such as » /tmp/sales.txt

Can you provide any insight on when the initial fwd slash is (and isn't) used??

or maybe when you WOULD use the initial fwd slash, cuz it seems like it;s normally not used.

Title: Re: Continued: Linux and Shell Scripting
Post by Rad.in.UbuntuVM on Jul 12th, 2009 at 12:46pm
after further research, it seems the initial fwd slash is only used when using an absolute path, and that means that the initial fwd slash refers to the root ("slash") directory.

yes?

this would make sense.

so you could actually be IN the root / directory, but would still not use the initial fwd slash when typing a path name to a file buried several directories deep, if that path name was relative. and to make that path name absolute, you would simply add an initial fwd slash, assuming we're talking about being in the root / directory.

Title: Re: Continued: Linux and Shell Scripting
Post by MrMagoo on Jul 12th, 2009 at 6:35pm

Rad.in.UbuntuVM wrote on Jul 12th, 2009 at 12:46pm:
after further research, it seems the initial fwd slash is only used when using an absolute path, and that means that the initial fwd slash refers to the root ("slash") directory.

Yes!  That's exactly what I was going to say.  The leading forward / refers to the root directory and indicates an absolute path.  An absolute path takes you to the same place no matter where you start. 

Without the leading /, a path is realtive to where you are currently at in the filesystem (know as your "working directory".)  You can find out where you are at with the command 'pwd' (which stands for "print working directory" I think.) 

So, if you are in /home/rad and you type "cd tmp", you would end up in /home/rad/tmp.  If you type "cd /tmp" you would end up in /tmp.

Title: Re: Continued: Linux and Shell Scripting
Post by Rad on Jul 13th, 2009 at 4:24pm
Enjoying learning about relative vs absolute path names, cuz I've always used absolute paths when copying files, which resulted in very long strings (would have to stretch the WinSCP window across the entire screen -- 1280x800 -- to prevent the command from wrapping).

How much simpler things seem when you learn how things work.

Noticed that Apress just released a new book on CentOS .. the "definitive guide":

http://www.amazon.com/Definitive-Guide-CentOS-Peter-Membrey/dp/1430219300/

wonder if that would be worth perusing, seeing that WiredTree uses CentOS 5.



From the intro:


Quote:
Although CentOS has a huge number of benefits over other operating systems, we cannot
escape the fact that it’s also free. With virtual machines starting to replace traditional
hosted services, people are finding that having their own server is not only much more
flexible but also often cheaper.

But running your own server is very different from simply using a hosted service, and
this is where The Definitive Guide to CentOS comes in. It has been written to help newcomers
to the platform get up and running in production as quickly and as painlessly as
possible. Each of the chapters has a specific task-oriented goal and explains how to do the
majority of tasks that people are looking to do.

Just like CentOS itself, we hope to be able to improve and refine this definitive guide.
We would be grateful for any and all feedback with regard to the book and how it could
be improved to better suit the needs of new users. Your experiences are hard won, and we
would love to hear what you have to say. After all, The Definitive Guide to CentOS is here
to help, and who better to advise and provide feedback than the very people who have
made their first steps with it?

This book will let you hit the ground running, and the CentOS community will ensure
that you are able to keep in the race!

It is common for newcomers to Linux to set up servers using “consumer-grade” Linux
distributions such as Fedora and Ubuntu Desktop. Although these distributions make
great desktops, they’re not the ideal choice for a production server because the software
versions change on a regular basis. Enterprise Linux distributions such as CentOS maintain
specific software versions over an extended period of time, which helps to ensure
that you don’t have any nasty surprises (see the “Extended Support” section).

Examples of enterprise Linux are Red Hat Enterprise Linux, SUSE Linux Enterprise
Server, Ubuntu LTS, and CentOS. Examples of consumer Linux are Fedora, Ubuntu,
OpenSUSE, Gentoo, and Debian.

More:


Quote:
Enterprise Linux has gained an awful lot of attention recently—for very good reason. Linux
has a reputation for being updated and improved at an amazingly fast rate. Conventional
wisdom would suggest that this is a good thing. After all, it means you’re getting better
software, and that can’t be a bad thing, can it? Actually, it can, and this is one of the key
areas that enterprise Linux looks to resolve.

by the way, how is it that RedHat can CHARGE for their distro?

https://www.redhat.com/apps/store/desktop/

I thot the nature of Linux and the Linux license prevents that.

Same with Suse, no?

Title: Re: Continued: Linux and Shell Scripting
Post by Rad on Jul 13th, 2009 at 6:00pm
my course says you don't use the minus sign with options for/with the tar command, yet i have and it works.

tar -xzvf

have you heard of this? .. not using - with tar options?

sounds weird.

Title: Re: Continued: Linux and Shell Scripting
Post by MrMagoo on Jul 13th, 2009 at 7:08pm

Rad wrote on Jul 13th, 2009 at 4:24pm:
wonder if that would be worth perusing, seeing that WiredTree uses CentOS 5.

Sounds like a good book right at your skill level.  I haven't read any of the "Definitive Guide to..." books, but there's a lot of them out there so they must have some success.  CentOS is a great distro to learn.


Rad wrote on Jul 13th, 2009 at 4:24pm:
by the way, how is it that RedHat can CHARGE for their distro?

I thot the nature of Linux and the Linux license prevents that.


Absolutely not.  Linux is licensed under the GPL.  You can do (almost) anything you want with GPL code, including sell it, as long as you make a copy available of any changes that you made to it.  Red Hat does make their source code available.  That's where CentOS comes from.

http://www.gnu.org/copyleft/gpl.html

Also, Red Hat is really selling tech support more than software.  If you purchase from Red Hat, they give you access to their tech support for a period of time (something like 3 years, I think.)



Rad wrote on Jul 13th, 2009 at 6:00pm:
my course says you don't use the minus sign with options for/with the tar command, yet i have and it works.


Ya, that's true for a few commands.  "ps" is another example where the - is optional ("ps aux" works the same as "ps -aux")

Title: Re: Continued: Linux and Shell Scripting
Post by Rad on Jul 13th, 2009 at 8:57pm
are you certified anything? linux-wise. rhce?

Title: Re: Continued: Linux and Shell Scripting
Post by Rad on Jul 13th, 2009 at 9:15pm

MrMagoo wrote on Jul 13th, 2009 at 7:08pm:
where the - is optional 

optional? well that's different from "don't use"

what's the rational behind eliminating the need for the "-" on certain commands? .. other than trying to confuse me.


MrMagoo wrote on Jul 13th, 2009 at 7:08pm:
Red Hat does make their source code available.That's where CentOS comes from.

they MUST make their source available, right? (per the GPL license) I mean, it's not a nice-guy thing they're doing, right?

If not, and they stopped, CentOS would be outta business, right?

if their source is freely available, then why are ppl PAYING for it? Why doesn't RH just sell support subscriptions? Anybody can take their source and compile it, right?

I see the logic behind selling sppt .. which is beneficial for all parties involved. But I don't get why anybody would pay hundreds of dollars for an OS they can get for free .. follow me?

Have you heard anything about RH sppt? Are they good? Okay? Suk?

Title: Re: Continued: Linux and Shell Scripting
Post by MrMagoo on Jul 13th, 2009 at 10:35pm

Rad wrote on Jul 13th, 2009 at 8:57pm:
are you certified anything? linux-wise. rhce?

I have RHCT, which is a step below RHCE.  I could probably pass the RHCE if I studied a little but I'm trying to steer my career in a different direction so I haven't put the time into it.


Rad wrote on Jul 13th, 2009 at 9:15pm:
what's the rational behind eliminating the need for the "-" on certain commands? .. other than trying to confuse me.

Well, its optional, so just use whichever is least confusing.  I don't know why it is that way.  Probably a decision someone who worked on the code at one point made.


Rad wrote on Jul 13th, 2009 at 9:15pm:
hey MUST make their source available, right?

They have to make source available any GPL code they have changed and want to distribute in binary form.  The could choose not to provide the source for anything they have written themselves (and they do write a lot of code) and I don't think they have to supply the source for GPL code that they merely repackage and distribute (like the Linux kernel, for example.)

So, they have to give some of it away.  They are nice enough to give it all away in a fairly easy to use form.


Rad wrote on Jul 13th, 2009 at 9:15pm:
If not, and they stopped, CentOS would be outta business, right?

Correct. 

Although CentOS is not "in business."  It is a community effort that the people responsible make no money from.  In fact, I wouldn't be surprised if it costs them money to cover hosting bandwidth and such.  But, yes, there would be no CentOS if Red Hat sources were not publicly available.


Rad wrote on Jul 13th, 2009 at 9:15pm:
Why doesn't RH just sell support subscriptions?

Essentially, they do.  You get a free copy of the code when you buy support.


Rad wrote on Jul 13th, 2009 at 9:15pm:
Anybody can take their source and compile it, right?  ...I don't get why anybody would pay hundreds of dollars for an OS they can get for free .. follow me?

It is legal for anyone to compile the code and use it.  Actually doing it is another matter.  I have no interest in trying to compile an entire OS from source and install it.  That's why CentOS is so cool - they do the hard work for you.

In practice, the people who pay for Red Hat is probably a small percentage of the people who use it.  Many individuals and businesses use CentOS or Fedora instead. 

However, for some businesses, Red Hat is the better choice because you get support from the vendor.  This is key for small businesses who need constant hand holding, bigger businesses who need expertise to get the software deployed organization wide, or any businesses who needs someone to blame when things go wrong.  I'm always amazed at how little expertise some of the bigger tech companies keep in-house.  Many of them are content with some lower-level admins and lean heavily on vendor support.


Rad wrote on Jul 13th, 2009 at 9:15pm:
Have you heard anything about RH sppt? Are they good? Okay? Suk?

I've never dealt with them personally, but I've heard good things.  The guys that taught the class/test for my RHCT were solid.  They knew their stuff and were very professional.

Title: Re: Continued: Linux and Shell Scripting
Post by Rad.in.UbuntuVM on Jul 14th, 2009 at 12:54am

MrMagoo wrote on Jul 13th, 2009 at 10:35pm:
It is legal for anyone to compile the code and use it.Actually doing it is another matter.I have no interest in trying to compile an entire OS from source and install it.

you make it sound difficult. Isn't it simply a matter of launching the compiler, pointing it to/at the source code file and clicking the 'Compile' button? .. so to speak. I mean, if it's done via command-line, then there's obviously no button to click.

Hmmm. I noticed your double-spaced sentences are turning into no spaced sentences when I mark-n-quote them. Must be a bug.

does the f option have to come last in a series of options for tar?

Title: Re: Continued: Linux and Shell Scripting
Post by MrMagoo on Jul 14th, 2009 at 5:04am
You are coming up with good questions.


Rad.in.UbuntuVM wrote on Jul 14th, 2009 at 12:54am:
Isn't it simply a matter of launching the compiler, pointing it to/at the source code file and clicking the 'Compile' button?

Sure, compiling source into binary for one program isn't overly difficult.  The problem is that there are thousands (maybe hundreds of thousands) of smaller programs that make up the Linux OS.  RH packages them into a few dozen source tarballs.  What makes it complicated is that you have to compile them in the right order and put the resulting binaries in the correct places, and later ones depend on compiled versions of earlier ones. 

And, all this on a computer you are trying to install an OS to... so what are you using to do all this compiling and installing?  You have to have an OS of some sort somewhere to do all this downloading and compiling.

There is a 'distro' (I have to use that term loosely here) of Linux where you download original sources and compile them from scratch called Linux From Scratch:

http://www.linuxfromscratch.org/

Check out their install guide to get an idea of what's involved in a very basic install (containing no graphical environment and no frills):

http://www.linuxfromscratch.org/lfs/view/stable/chapter01/how.html

I've installed Gentoo before: http://www.gentoo.org/

The Gentoo install is not totally from scratch like LFS is, but does take you through some of the lower-level things that happen during an install.  It wasn't hard (with good documentation) but it did take about 4 days (with most of the last 3 days spent compiling.)  I learned a lot about some of the inner workings of Linux, but it isn't something I want to do regularly.  Even with the excellent documentation that the Gentoo project provides, I wouldn't have gotten through without already knowing Linux fundamentals. 

So, its not a matter of just hitting a button.

Title: Re: Continued: Linux and Shell Scripting
Post by MrMagoo on Jul 14th, 2009 at 5:08am

Rad.in.UbuntuVM wrote on Jul 14th, 2009 at 12:54am:
does the f option have to come last in a series of options for tar? 

No, but the name of the file that you want tar to operate on has to come immediately after the 'f', so it's easiest to put the 'f' as the last flag and then put the filename at the end.  For example:
  • tar -z -f somefile.tgz -x

should work, but its harder to type than
  • tar -zxf somefile.tgz

Title: Re: Continued: Linux and Shell Scripting
Post by MrMagoo on Jul 14th, 2009 at 5:16am
I think I'm going to change my tagline from "Linux Fanboy" to "Linux Guru."  I think I've earned it with this thread.

Edit:
From Wikipedia: In contemporary India and Indonesia, the word "guru" is widely used with the general meaning of "teacher"

I think I like it.

Title: Re: Continued: Linux and Shell Scripting
Post by Rad on Jul 14th, 2009 at 9:44am

MrMagoo wrote on Jul 14th, 2009 at 5:04am:
So, its not a matter of just hitting a button.

10-4, roger that.  :)


Quote:
•tar -z -f somefile.tgz -x

here you have an option after the argument (file name). I thot options had to come BEFORE arguments, no?


Quote:
think I'm going to change my tagline from "Linux Fanboy" to "Linux Guru."

You've always been a Linux guru to me.  :)

Title: Re: Continued: Linux and Shell Scripting
Post by MrMagoo on Jul 14th, 2009 at 6:42pm

Rad wrote on Jul 14th, 2009 at 9:44am:
I thot options had to come BEFORE arguments, no?

You are correct.


Rad wrote on Jul 14th, 2009 at 9:44am:
here you have an option after the argument (file name).

The filename is not an argument.  It is part of the '-f filename' option.

Title: Re: Continued: Linux and Shell Scripting
Post by Spanky on Jul 14th, 2009 at 6:45pm

MrMagoo wrote on Jul 14th, 2009 at 6:42pm:
The filename is not an argument.It is part of the '-f filename' option.

eyebrow-raiser.

that explains some other questions i had.

Title: Re: Continued: Linux and Shell Scripting
Post by Rad.in.UbuntuVM on Jul 14th, 2009 at 9:06pm
Just to let you know, Wiredtree says the Rad VPS server is currently running CentOS 5.3

They *do* upgrade to each point release (5.1 .. 5.2 .. 5.3 .. etc) when cPanel says it's okay, so as to not break compatibility, cuz all VPS servers are based on cPanel/WHM.

Title: Re: Continued: Linux and Shell Scripting
Post by Rad.in.UbuntuVM on Jul 19th, 2009 at 6:29pm
It would seem the 'chmod' command/program gets little use from the shell/command line due to programs such as WinSCP (SSH) that make using chmod so much .. easier. No?

Hmmm. I am trying to paste the URL for WinSCP from IE in Windows, but it's not working. Wonder why. Used to work fine. Weird.

How do I run a command as a super user in Ubuntu. Seems VMware Tools is not configured correctly. Sudo? What does "do" stand for? in sudo

Title: Re: Continued: Linux and Shell Scripting
Post by Rad.in.UbuntuVM on Jul 19th, 2009 at 9:00pm
http://winscp.net/eng/index.php

haha! I *am* the man!  8-)

took quite some finagling to get that copy-n-paste to work.

ultimately had to reconfig vmware tools (said it wasn't config'ed properly/correctly), and then had to run "vmware-toolbox &" to start.

can you tell me why after the terminal says 'command not found' it does not retutn me to a prompt?

i get a new line, but not prompt.

had to close terminal window (ubuntu) and open a new one to get a prompt.

i think the previous vmware tools mighta been broken when i updated ubuntu.

Title: Re: Continued: Linux and Shell Scripting
Post by MrMagoo on Jul 19th, 2009 at 10:43pm

Rad.in.UbuntuVM wrote on Jul 19th, 2009 at 6:29pm:
It would seem the 'chmod' command/program gets little use from the shell/command line due to programs such as WinSCP (SSH) that make using chmod so much .. easier. No?

I use it from the command line - mostly after I finish with a script and want to make it executable or when I'm trying to adjust who can/can't get to the files on a central file server.


Rad.in.UbuntuVM wrote on Jul 19th, 2009 at 6:29pm:
How do I run a command as a super user in Ubuntu. Seems VMware Tools is not configured correctly. Sudo?

Yes, sudo.  Or login as the root user with "sudo su -" and then run your commands (if there are several of them.)

Title: Re: Continued: Linux and Shell Scripting
Post by MrMagoo on Jul 19th, 2009 at 10:46pm

Rad.in.UbuntuVM wrote on Jul 19th, 2009 at 9:00pm:
can you tell me why after the terminal says 'command not found' it does not retutn me to a prompt?

Do you get a prompt if you press enter?  What command did you run that it didn't find?  Did the command you tried have an "&" at the end?


Rad.in.UbuntuVM wrote on Jul 19th, 2009 at 9:00pm:
think the previous vmware tools mighta been broken when i updated ubuntu

Entirely possible, depending on how the vmware tools package was installed.

Title: Re: Continued: Linux and Shell Scripting
Post by Rad.in.UbuntuVM on Jul 19th, 2009 at 11:32pm
yeah, had a & at the end.

tried enter, nada. seemed unresponsive to enter, iirc.

Title: Re: Continued: Linux and Shell Scripting
Post by Rad.in.UbuntuVM on Jul 20th, 2009 at 12:23am
speaking of copy-n-paste ...


Quote:
Interesting trivia: the shell wildcards you asked about do have a special name, and they aren't regular expressions (as it happens the pattern characters it uses are chosen to be the same as those  used in regular expressions, but they aren't the same thing). Specifically, the UNIX shell wildcard expansion process has always been called globbing and the pattern language thus got called glob patterns or more informally just globs.

The WP entry on it at http://en.wikipedia.org/wiki/Glob_(programming) discusses this but doesn't quite get the etymology right. The name does derive from the name of a function, but that function was in the original Bourne Shell source code, which was written in a very early dialect of C during the mid-70's (it did eventually, much later, migrate to be available more generally but the name had already stuck by then). One of the aspects of the system at the time (the legendary PDP-11's) is that it was only a 16-bit machine, and so not only was C itself quite primitive at the time, to fit within the 64Kb memory constraints it was the habit of programmers to use short names for functions which generally were abbreviations or acronyms.

Although I don't recall Stephen Bourne saying this explicitly, it's reasonably clear what the source for the name is; mostly, the Bourne shell just processes individual strings, but the pattern-matching facility is unusual within the shell in that it generates multiple things as output. The name of the function reflected that this was what it did - it Generated a List of OBjects, and thus "glob" was a pretty natural choice of name for the pattern-expander function within the context of the Bourne Shell source.

[ It's also worth bearing in mind that at the time, the C compiler really did virtually *no* type-checking, so a function that output a list was quite a special thing. Naming it by what kind of data it returned was important because it was actually up to the programmer handling the return result to know that what came out of it needed to be treated quite carefully. This aspect of C got cleaned up eventually, and by about 1985 almost all C compilers were using decently strong type checking (and the ANSI standardization process had started to improve the language even further) but if you read the original 1970's source code it's more clear just how primitive the compiler was then and thus why most library functions were named the way they were). ]

So, the "glob" name really is more about the process of pattern expansion (turning one thing, the pattern, into multiple things) rather than denoting a particular pattern language or specific syntax, but the nature of language is such that "globbing" pretty much always refers to the particular style of wild-card pattern used by the Bourne Shell, which is much simpler and more direct than the regular expression system.

- Nigel

Title: Re: Continued: Linux and Shell Scripting
Post by MrMagoo on Jul 20th, 2009 at 2:38am

Rad.in.UbuntuVM wrote on Jul 19th, 2009 at 11:32pm:
yeah, had a & at the end.

The "&" at the end causes the command to be run in the background.  The thing is, it will still interact with your shell.  Error messages and output will still show up, for example.  It is common to not get a prompt after getting output for a command running in the background.  Usually, you can just hit enter and you'll get a new prompt.  Not sure what is going on in your case.  Probably an artifact of your VM.

Radified Community Forums » Powered by YaBB 2.4!
YaBB © 2000-2009. All Rights Reserved.