Tag Archives: linux

An Introduction to the Linux Shell

She sells seashells by the seashore. Well, yes… that may be true, but that’s not the type of shell we’re going to talk about here today.

I’m going to talk a bit about the Linux shell. What is the Linux shell? What does it do? How can I interact with it on my GNU/Linux operating system? Those are all good questions. While today’s most popular distributions of GNU/Linux are morphing into operating systems that are more and more graphic user interface oriented, the real power of Linux still resides in the command line.

When you boot up your Ubuntu or Mandriva GNU/Linux operating systems, most of you see a graphical login screen. Others, like myself, might see a non-graphic command line login. Both do basically the same thing. They log the user into the Linux shell so that he may begin to utilize his system’s potential to perform tasks. That’s what we do with our computers, regardless of what the tasks happen to be… emailing pics to auntie Myrtle or hacking cloud and cluster security systems.

The Linux shell is the interface between you in that seat in front of your monitor and the operating system that controls the hardware in that box under the desk that does the actual stuff you want done. There are numerous shells in Linux; the most commonly used one is called BASH – Bourne Again Shell. You’re in the shell anytime you’re logged into your GNU/Linux operating system; whether you’re interacting with it graphically or from the command line.

Graphic User Interfaces or GUIs are just “front ends” to applications that are running in the shell. I’ll be talking mostly about the non-graphical command line interface here today, though. You can access your command line interface from within your GUI by using the graphic front end application for the command line provided by your desktop environment. For example, in Gnome, you could use Gnome Terminal; or in KDE, you could use Konsole. Either way, these are both just graphical front ends for the BASH shell command line.

When you first login, you’ll get what’s known as a prompt. It is just a blank line waiting for your input (commands). It’ll look something like this:

joe@mysystem:~$

The first part, “joe”, is just the user’s login name. “@mysystem” is the name of the computer the user is logged into. The “~” character tells us that user Joe is working from his home directory. The “$” character is the standard character denoting a non-root, regular user.

Let’s say Joe wants to list all the files in his home directory. All he has to do is type:

joe@mysystem:~$ ls

This command, known as “list”, tells the shell that user Joe wants to see a list of all the contents of his home directory. The shell immediately responds after Joe hits the Return (Enter) key on his keyboard with this output:

Desktop  joe_archives  joe_common     joe_private
Dropbox  joe_backups   joe_downloads

It looks like Joe has five regular directories, a Dropbox directory, and the directory that contains his desktop icons. In reality, there are more directories and files in Joe’s home directory, but they’re what are known as “hidden” files. Their names are usually preceded by a .(period) to make them hidden. If joe wants to see all his directories and files he can list them this way:

joe@mysystem:~$ ls -a

The “-a” option means all. The list command will list all items in a directory when using the -a option. Joe’s list now looks something like this:

.dropbox        .macromedia      .thunderbird
.ICEauthority           .esd_auth    .moz_icons      .viminfo
.PySolFC           .fontconfig    .mozilla      .wicd
.Xauthority           .gconf        .mozilla_3.x      .xchat2

The above directories are hidden by the preceding .(period), as mentioned above.

Let’s say Joe want’s to create a grocery list for his afternoon shopping chores. He can do this via the shell and command line also by using a command line editor such as vim. He would first do this by bring up the vim application in the command line interface:

joe@mysystem:~$ vim groceries

This command would initiate the vim application using a new file called “groceries”. Vim or Vi-Improved, as it’s known, is a non-graphical text editing application. It would look something like this to Joe:

lettuce

tomatoes

catfood

peanut butter

eggs

milk

bread

~

~

~

–INSERT–                                                 10,1          All

Once Joe had finished typing out his grocery list, he would save it using the vim command :wq, which would also close the vim application and bring Joe back to the command line prompt. He could also print his list from the command line like this:

joe@mysystem:~$ lpr groceries

The lpr command would tell the shell that Joe wants to output the contents of the groceries file to the printer. The printer would receive the data and the command to print from the computer’s hardware and begin printing Joe’s grocery list.

All of this we’ve talked about today doesn’t even scratch the surface of the power at your finger tips when using the Linux shell. Your first step should be to read the Linux manual page for the BASH shell. There is some very useful information in that document. Stay tuned here… I’ll come up with some other lessons in the future. Remember what I always say…

Learn something. It won’t hurt you none. I promise.

Later…

~Eric

Slackware 13.37… I Couldn’t Wait

I spent the last day or so wiping/reformatting/reinstalling… SLACKWARE!

I’ve done this so many times since v9.x, that I’ve got it down to the proverbial art form. I initially tried for a tandem upgrade –> 13.0 to 13.1 and then on to 13.37. It sorta’ almost worked. I was having Nouveau/Nvidia issues with 13.1 and again with 13.37; I could boot both to the command line, though. I really borked up 13.37 when I made a error somewhere compiling my kernel. Oh well…

I wiped it all away with a few commands and installed nice and fresh… the way it’s meant to be done. It took me the better part of yesterday and today to get it all up and running the way I like it. All’s well, though. I’m in 13.37. Weeeeee!

Photobucket

Now, I just have to sit and wait for it to go final. That ought to just take a few more days. Once that happens, a little modification of my mirrors file and I should be good to go.

Thank YOU, Pat V… and ALL the acolytes!

Have fun!

~Eric

I’m Part of That 3%, I Must Confess

I ran across an entertaining little bit while surfing around the Tech News Daily site this morning. It reminded me of a humorous computer story of my own.

Most of my online tech pals know what I’m talking about when I mention the night the Slacker danced the Irish jig. I’m not much of a dancer, but this one night I danced up a storm on my kitchen floor… on top of my computer tower. Heh! Yeah… it was a sight to see; a 265 lbs, 6’2″ man stomping maniacally on his computer tower that he had just recently scooped off the desk and slammed to the ground… along with all the hardwired peripherals and knick-knacks.

So yeah… I’m in that 3% group who have totally lost their cool and let an inanimate bunch of plastic, silicon, and metal get the best of me.

About nine percent of people have taken their frustrations out on the computer by hitting it with an object, such as a baseball bat or a fist. Only three percent have actually thrown a computer to the ground or against a piece of furniture, such as a desk.*

“What ever could have brought this about?” you might ask. If you can seriously ask that question, you’ve never used a computer before in your entire life. Here’s what happened, though… I had been having some buggy issues with an installation of Linux. I kept losing my configuration preferences and such.

It was really beginning to torque me up. It had been going on for about two weeks. It came to a head one evening shortly after another crash of a fresh installation. That’s when the dance party started. WOO-HOO! Everybody dance now! THUMP! THUMP! THUMP!

After a reassembly into another tower box and some more calm-minded troubleshooting, I tracked the issue to an intermittently failing Seagate hard drive that I had just recently bought and installed on this system. That was the very first… and the VERY LAST Seagate drive I even owned/used. I’ve mellowed over the years, though. I don’t blame Seagate anymore for my near-stroke. I’d buy one nowadays… if the price was right.

But not everyone reacts this way when faced with a computer issue. On the other end of the spectrum, about 38 percent of people said they would never yell at their computer because it’s “too sensitive.” Instead, they encourage it to keep working with positive words.*

*From the above mentioned article.

If you’re one of the above mentioned 38%, you really should seek some professional help. :crazy

Later…

~Eric

The Slacker Dreads MS Windows Service Packs

Back in the dark ages of my computering life. I used an operating system known as Microsoft Windows®. I still occasionally play around in Windows these days.

I have (had, the drive failed on me recently) an XP Pro installation on my desktop system for playing games only. It’s crippled… no networking installed at all. I also have an installation of Win 7 on my laptop. It’s just for fun and education. I’m the family computer nerd, so everyone comes to me for help. They don’t run Linux… yet. MUAHAHAHA! Anyway, I have to stay comfortable with how MS products work so I can still be helpful to the unfortunate souls still using that OS.

As some of you who know me may remember, the camel that broke the straw’s back for me with MS Windows was the fact that I had numerous catastrophic system failures due to corrupted installations of various Service Packs on XP back in ’06. The last one may have actually been a faulty Seagate hard drive, to be fair to MS. However, the last one was the last one for me. I went to Linux full time within a few days of that event.

Now, here comes a new Service Pack (#1) for my Win 7 installation. UH-OH! I’m very gun shy about Service Packs, folks. This time, though, the OS is not my primary computer tool, so what’s the worry. If it boogers up, I can just reinstall. No great loss… just more minutes of my life sucked out of existence by Microsoft. Anyway, I decided to go for it yesterday. The install was fast and painless. And best of all… the system rebooted into a working Win 7 OS. Cool, huh?

Kudos to MS. They may have finally gotten something right with this new Win 7. So, just what was Vista? XP’s Millennium Edition? Oh, wait… Vista was the beta, of course. I wonder how many folks actually paid $300 to beta test for MS on that one. All that testing paid off. Thanks beta folks! 🙂

OK, I’m outta’ here…

~Eric

NOTE: All derogatory comments regarding Microsoft and the Windows® operating system are absolutely true… er, I mean are absolutely in jest. jk, as Generation Text likes to say. Can you imagine what Evolution is going to make their childrens’ childrens’ childrens’ thumbs look like? Heh!

Arch Steps Up – Debian Takes a Backseat

I recently did some soul searching regarding my GNU/Linux philosophy. I found that I wasn’t being true to myself.

For years now, I’ve run Slackware Linux as my primary operating system and a second, fully updated version of Debian as my  secondary OS. I’m a firm believer in simplicity and stability. I enjoyed both of those qualities in Slack and Deb, of course. They are both rocks when it comes to stability. I’ve never had a crash in either operating system that was due to the OS itself. Any crashes were usually caused by something stupid that I had done.

All that being said, while contemplating upgrading from Debian Lenny to Squeeze, I had an epiphany. Slackware and Debian are not very much alike, other than their common quality of stability. Where Slack has a relatively small application set; Debian’s repos are huge. Where Slack uses close to the newest versions of its software; Debian uses versions that are typically three to four releases old (VERY stable and proven stuff).

It was always difficult for me to sync Slack’s apps with Debian’s in my primary and secondary operating systems because of the discrepancy in releases; especially so with Mozilla apps like FF and TB. This got me thinking… maybe Debian, even though it had always been my fall-back operating system, might not be serving my purposes that well after all. Is there something better out there for what I want to do?

As most of you know, I have five tester slots on a dedicated drive just for trying out and learning other distributions of GNU/Linux. No, I don’t do virtual. I like to REALLY install and set up operating systems. Virtual computing is like virtual sex. It works, but it’s not nearly as much fun (or as messy). In one of my tester slots there is almost always an installation of Arch Linux. Why Arch? Well, it’s a cool distribution. That’s why.

Seriously, Arch is a very stable, very robust distribution of GNU/Linux. It’s been around about ten years now. It’s a fork of the old Crux branch of the Linux Tree. I started playing around with Arch about three years ago, I think. I was impressed right off the bat. One of the greatest things about Arch is its outstanding support community, particularly the wiki. There is an abundance of information for Arch users of all sizes and shapes. Support is a good thing!

As a result of all this deep thinking and philosophizing, I decided to install Arch as my official secondary operating system. I spent the past three days installing and setting it up. I’m using it now to post this article. I have everything set up to closely match my Slackware installation. I keep both sync’d (manually) and updated. If my Slack craps out, I can always boot Arch and seamlessly carry on until I fix my Slack. Odds of Slack crapping out? Null. You never know, though.

Give Arch a try. You might be impressed. For a very good tutorial on installing Arch, see securitybreach’s tutorial at Scot’s Newsletter Forums – Bruno’s All Things Linux.

My Arch w/ Xfce Desktop Environment

Later…

~Eric

5 Things I Love Most About MS Windows

My first experience with Microsoft Windows was version 3.1. It was installed on a PC in my brother’s construction company office back in ’93. It was COOL! I’ve loved MS Windows ever since. Here are my top 5 reasons why:

  • numero cinco – I love MS Windows because it has more users than Charlie Sheen has drunken girlfriends; which serves to paint a LARGE target on it rather than on my actual operating system (Linux). Hackers and spammers are wise. They use Linux on their own systems and target the operating system that gives them the biggest bang for the byte. Thanks to Microsoft for being my shield.
  • numero cuatro – I love MS Windows because of all the times, while trying to learn the secrets of that OS, I visited boards and forums where helpful members there would use the code word RTFM to teach me how to do something. Many times, they would suggest that you RTFM even when there wasn’t an FM to R. Thanks to those MS Windows gurus, I learned what real community is NOT supposed to be like.
  • numero tres – I love MS Windows for making me dread Tuesdays even more than Mondays. The creation of the “patch Tuesday” updating methods for MS Windows operating systems was a stroke of genius that greatly changed folks’ attitudes about that previously most hated day of the week… Monday. I’m sure Monday is appreciative of this. The only good thing about Tuesdays these days is happy hour.
  • numero dos – the penultimate reason that I love MS Windows is because it is the Terminator of operating systems. It searches out other operating systems on its own and peripheral hard drives and terminates them. It won’t even brook the presence of another MS Windows OS on same drive. It is a very anti-social operating system. It does NOT play well with other operating systems. You have to trick it for it to behave.
  • numero uno – the very tippy-top mostest for sure reason that I love MS Windows is that it replenished my faith in the fact that even chubby computer nerds like Steve Ballmer can make a bazillion bucks by doing practically nothing of note; except for being in the right place and being friends with the right guy (Bill Gates) at the right time.

=====

The Disclaimer: In the last article here (5 Things I Hate Most About Linux), and in this article, I tend to tease a bit about Microsoft and their Windows operating system. Yes, I have had my bad experiences with that OS. Yes, I like to tease about MS Windows. And yes, it’s just for laughs. I actually feel that Microsoft changed the world with its innovations and ideas regarding operating systems and software. Oh, and I really don’t know Steve Ballmer well enough to be accusing him of being a chubby computer nerd.

Bing THIS!

Later…

~Eric

5 Things I Hate Most About Linux

The GNU/Linux computer operating system created through the sewing of miscellaneous Richard Stallman body parts around Linus Torvalds‘ heart is not perfect. Here’s a list of my 5 top pet peeves:

  • coming in at #5 is the fact that using the GNU/Linux operating system causes me great distress due to the guilt of not having paid $300+ to purchase this operating system in a very earth-unfriendly, made-in-China package from my local Bloat Buy retail software outlet.
  • #4 would, of course, be the pain caused by my empathetic tendencies toward those poor souls out there using other operating systems, and my terrible evangelistic need to convert them all. I’m becoming a damned Jehovah’s Witness of GNU/Linux… *Knock-Knock* “Hello, ma’am. I’d like to talk with you a bit today about the everlasting joy of Linux. Come to the light with me, won’t you? Yes, you can bring your cat, too.”
  • 3rd on the list is the fact that GNU/Linux does not follow the engineered obsolescence business plan that has kept free markets and manufacturing buzzing for the past 50 years. It is instead a steady, long-life item that will eventually put many folks out of work. Besides, the best distributions are given away for no cost at all. What’s up with this? This is NOT your granddad’s Capitalism, comrades.
  • my 2nd most peeving peeve is the gnawing certainty that the GNU/Linux was actually a technology that the C.I.A. leaked after discovering its usage in the computers on that crashed alien craft that’s kept in storage in Area 51. No current human intellect could have come up with something so efficient and useful. I think the aliens may have assimilated us without our knowledge or consent. Maybe that’s a good thing, upon further reflection.
  • and first/foremost on my list is the fact that GNU/Linux has increased my boredom exponentially over the last 5 years. I no longer have to run crap cleaners, antivirus apps, defraggers, malware hunters, cookie cullers, bloated/inefficient backup apps, etc. Sheeesh! I have all this time on my hands to do really useful computer stuff nowadays. So, what do I do? I choose to sit here and tap out masterpieces such as this one for your entertainment and enlightenment.

I HATE Linux! I love that little penguin, though.

Later…

~Eric

The PATH to /home/timmy/grannys_house

Back in the old days, when Timmy wanted to visit granny’s house, all he had to do was have Lassie lead him there. In today’s more complicated computer world, it takes a bit more understanding.

We’re going to learn a bit about a very important subject in Linux. It’s called PATH. The path to a file or whatever on your Linux operating system is something that you need to understand when manipulating files from the command line. Another term we’ll look at briefly is the working directory.

When Timmy, as a regular user, opens his terminal from his GUI or from the post login command line (Run Level 3 – multi-user, no X running), his working directory is in /home/timmy. Whichever directory you are in at the time is known as the working directory. Timmy may navigate to another directory using the cd command. Let’s say he navigates to /usr/bin. At that time, his working directory becomes /usr/bin. See how this works?

Think of the Linux file system as a multi-room house. If you’re in bedroom4 right now, your working directory would be /house/bedroom4. If you walked out of that room and down the hall to bathroom02, then your working directory becomes /house/bathroom02. At that time, you may then use the command micturate. Heh! A little bathroom humor there.

OK, so now we know all about the working directory, right? Moving on…

Let’s say that Timmy wants to copy a .jpg that is in /usr/share/wallpaper over to the /home/timmy/grannys_house directory. He would open his terminal, which would then be sitting there with that blinking cursor waiting for Timmy’s next command:

timmy@lassies_machine~:$ |

Timmy’s working directory at this point is /home/timmy, as designated by the command line shorthand character ~ . If Timmy wants to copy the .jpg without actually going to the directory that it’s in to copy it, he must provide the proper path in his command.

timmy@lassies_machine~:$ cp /usr/share/wallpaper/cabin.jpg /home/timmy/grannys_house

The above command, using absolute path names, directs the shell (command line interpreter) to copy the cabin.jpg image from the /usr/share/wallpaper directory to the /home/timmy/grannys_house directory. If Timmy wanted to just make a duplicate of a file in his /home/timmy directory, then he could leave off the / character when showing the command line the proper path. This can be done because he’s already in the /home/timmy directory. It is his working directory. He can now use a relative path to direct the shell to make the copy.

timmy@lassies_machine~:$ cp cabin.jpg cabin.jpg_backup

In the above example, notice that there is no / being used. Timmy is simply making a backup copy of cabin.jpg. Both files are relative to his working directory, so the shell understands that Timmy just wants to make this duplicate right there in that same directory.

It’s really not rocket science, to use that worn out old cliché. The command line can be pretty simple once you get the hang of it folks. You know what I always say… Don’t fear the command line. I hope you’ve learned something here today. Remember to click the links within the article. You’ll find some more useful information and a few definitions for you there.

Later…

~Eric

Further reading:

Unix Commands @ Wikipedia

LinuxTutorial.info

Linfo.org

Paul Sheer’s Rute Users Tutorial and Exposition

Image credits: Timmy (Jon Provost) and Lassie image owned and copyright by Classic Media

Xfce 4.8 – The Little Mouse That Roared

It’s here, folks. We’ve been patiently waiting for this one… version 4.8 of everyone’s (mine, anyway) favorite desktop environment –> Xfce!

There have been many improvements, judging by the release notes. Read more about it here –> http://www.xfce.org/about/news/?post=1295136000 It may be a bit before you start seeing this in your distribution’s repositories, but you can always attempt an install from source, if you know what you’re doing.

For you Slackers (users of Slackware Linux) out there, Robby Workman has a Slackware Package of 4.8 on his server. Don’t forget to read his NOTES and install the dependencies (which he also provides for you) in the order he suggests. Of course, install at your own risk. If you have an experimental installation of Slack, as I do, it might be better to play with it in that installation rather than your primary OS… just in case, you know.

Ever since KDE4 became a fat, over-bloated MS Windows-like clone, Xfce has been my primary desktop environment. Aww, shucks! I’m just kidding about KDE. It’s fine too, as long as you have 12Gig of RAM and a water-cooled, over-clocked quad-core processor… and don’t mind the occasional system crashes.

Anyway, watch a repository near you or take the bold approach and install from source. Either way, you’ll come to love that little mouse.

Later…

~Eric

Image credits: Xfce logo Copyright 2003-2011 Xfce Development Team

GIMP Inadequate? Say It Ain’t So…

I was reading here and there online today and ran across this interesting viewpoint on The GIMP from blogger Troy Sobotka.

It was an good read. I’m a big fan of The GIMP. I don’t use nor have I ever even seen Photoshop in action. And another disclaimer: I’m no artist. I’m a very left-brained person. I often wish I had some creative talents, but that ain’t the case. I’m hardwired, technical, and literal. Enough about me, though…

The GIMP has been my image tool of choice ever since coming to The Light (Linux) back in ’06. Previous to that, I used MS Paint, PaintDOTNet, and other amateur tools such as those. I’d be lost in Photoshop. Reiterating… I’m no artist. I use these graphics tools to manipulate existing images or create relatively simplistic images of my own. You can see an example of my talent in Figure 1 below.

Figure 1

While the points that Mr. Sobotka makes regarding The GIMP are probably quite accurate (much too art-technical for me to be concerned with, though), the application works well for me. I only hope that it continues to be a viable application and is updated and improved as time goes by. I’d hate to see the end of The GIMP. What would we amateur image manglers use as an alternative?

Well, anyway…

Later…

~Eric