Tag Archives: tutorial

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.



Further reading:

Unix Commands @ Wikipedia



Paul Sheer’s Rute Users Tutorial and Exposition

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

Variety On the Desktop

Are you like me? Do you like to change your desktop backgrounds and themes pretty often?

Do you get kinda’ tired of the same ol’ offerings for your windows managers; be they KDE, Gnome, Xfce? I trolled Xfce-Look and snarfed up most of the good stuff there over the past couple years. Sometimes though, you just gotta’ do it yourself. Here’s how to customize already existing Xfce themes the easy way.

Pick a simple based theme like Clearlooks-gray. If you don’t already have it installed, go to Xfce-Look and pick it up real quick. Once you have it installed in your /home/<user>/.themes directory, you’re ready to start. The first thing you want to do is make a copy of the Clearlooks-gray directory. Call it Clearlooks-build or something like that.

Now, go into the new Clearlooks-build directory and you’ll find gtk-2.0 directory. Inside that one, you’ll find the gtkrc file and the menu.png file. That’s what we’re going to work with here. Open the gtkrc file using your favorite text editor. It looks similar to Figure 1.

Figure 1

The color codes that I’ve circled are the ones you’ll be dealing with. They determine the colors for the background, foreground, text, selected times, etc. Use your favorite color picker app (I use Gcolor) to pick and choose your custom colors. just copy/paste them over the existing ones in the gtkrc file. Save the file and reload your theme using the Xfce Settings –> Appearance tool. You can also use The GIMP to re-colorize the menu.png image so that it matches the rest of your theme colors.

Once you have everything the way you like it, save the files and rename your top level directory from Clearlooks-build to whatever you want to call your new theme. It’s easy-peasy, folks. Since you’re working on a copy of the Clearlooks-gray theme, you’re not going to break anything by tweaking this stuff.

Here are a couple shots of my Clearlooks-dkblue theme:



Until next time, folks…

Have some fun!


Poor Misunderstood fstab

One of the most misunderstood configuration files in Linux is the fstab.

The fstab configuration file allows you to customize and manipulate how your Linux system auto-mounts drive partitions and other devices. It’s not rocket science, folks, but its nomenclature and textual entry protocols can sometimes be a wee bit confusing, especially to novice Linux users.

Nowadays, modern kernels utilize applications such as udev and hal to perform a lot of these fstab tricks in the background right out of the box. For the Linux user with a custom hardware set up or the need to tweak, the fstab is the way to go. In my Slackware installation, there are some hardware configurations and customizations that I prefer to manually set up. I use my fstab for this purpose (see Fig 1).

Figure 1 – Eric’s Slackware /etc/fstab Configuration File

You’ll notice that I mount three different partitions (Archives, Common, and Backups) in my /home/vtel57 directory at boot up. I also have a Zip drive on this system. HA! Remember those? I still use mine… and a floppy drive, too. I told you I was an old fashioned geek. These mounts are the reason that I prefer to manually configure my auto-mounting, rather than depend on udev or hal.

Akkana Peck over at Linux Planet has created an outstanding tutorial for folks interested in manipulating and understanding fstab.

Here’s a snip:

/etc/fstab — it’s there on every Linux computer, controlling which filesystems get mounted where.

Its manual page, man fstab, begins with this snippet:

fstab is only read by programs, and not written; it is the duty of the system administrator to properly create and maintain this file.

Fortunately, they’re fibbing. These days fstab is usually created for you by an installer or other program. So don’t get too worried about your “duty”.

However, if you want to delve into fstab, it’s easy to understand and modify.

Check out the entire tutorial here –> Controlling Your Linux System With fstab by Akkana Peck.

Learn something, folks… and have FUN while you’re at it.

Until next time…