Book Image

Linux Utilities Cookbook

By : James Kent Lewis
Book Image

Linux Utilities Cookbook

By: James Kent Lewis

Overview of this book

<p>Linux is a stable, reliable and extremely powerful operating system. It has been around for many years, however, most people still don't know what it can do and the ways it is superior to other operating systems. Many people want to get started with Linux for greater control and security, but getting started can be time consuming and complicated. <br /><br />A practical, hands-on guide that provides you with a number of clear step-by-step examples to help you solve many of the questions that crop up when using an operating system you may not be familiar with.</p> <p>Presenting solutions to the most common Linux problems in a clear and concise way, this helpful guide starts with spicing up the terminal sessions by command retrieval and line editing, and shell prompt variables. We will then get to know the different desktops (GUIs) available for Linux systems and which is the best fit for you. We will then explore the world of managing files and directories, connectivity, and what to do when it goes wrong. We will also learn a range of skills, from creating and managing user accounts to securing your system, managing and limiting processes, and letting information flow from one process to another using pipes. Later, we will master disk management, working with scripts and automating tasks quickly, and finally, understand the need for a custom kernel and tips on how to build one.</p> <p><br />Based on the author's extensive experience, there is a section on best practices that every Linux user should be familiar with.</p>
Table of Contents (19 chapters)
Linux Utilities Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Running the GUI


While I am somewhat quick to trust my users with root access, and use it myself most of the time, I absolutely do not recommend running the GUI this way. Some distributions won't even allow it. By running the GUI as root, you are in effect running a lot of other things as root, such as your browser and mail programs. Not a good idea at all.

Here is my preferred environment on a Linux or UNIX system. I use Fedora, but these ideas should work on most other distributions. After installing a system, one of the first things I do is change it so that the machine comes up in command line mode and not in a GUI. This way if a graphics problem has occurred, it is much easier to diagnose and correct. I also have a choice in which GUI to bring up by running the appropriate startx type command. At the command prompt, I log in as a normal or guest user. On my Fedora 14 system I then run startx, which brings up Gnome 2.

After the GUI has come all the way up, I open a terminal session and run su to root. I check to make sure the machine can ping, and usually do a few more sanity checks. If all is well, I then run my jset script. It performs some desktop customization such as opening terminal windows into their proper directories, and reminding me of what command to run (I have written a lot of programs and so really need this). It also mounts my USB devices, or warns me if there is a problem. I then position the terminal sessions right where I want them to be. I am now set to get some work done.

The following is a script similar to the one that I use to set up my desktop after booting up:

#!/bin/sh
# last update 6/9/2013 (rebooted)

echo percentused - run go
cd /lewis/java/percentused
xterm +sb -title Xterm    -geom 80x20 &

echo apcupsd - run go
cd /lewis/java/apc
xterm +sb -title Xterm    -geom 80x20 &

echo jtail - run jtail
cd /lewis/jtail-f/jtail
xterm +sb -title jtail -geom 137x30   &

echo jsecure - run jsecure
cd /lewis/jtail-f/jsecure
xterm +sb -title jtail -geom 125x33   &

echo ping - run loop1
cd /lewis/ping
xterm +sb -title ping  -geom 86x8 &

echo runbackup1 - run runbackup1
cd /lewis/backup
xterm +sb -title runbackup1 -geom 65x21 &

echo jwho - run jwho
cd /lewis/jwho
xterm +sb -title jwho  -geom 65x8  &

# mount usb stick
mount /dev/sdg1 /usb
# mount Iomega external drive
mount /dev/sdf1 /megadrive