Personalizing Linux


    Linux, like any other computer Operating System can be generalized, categorized and/or personalized. What we have here ... is a programmable device, the computer, with some code, the programmable part, and everyone's idea of what should be what and how. Back in 1981, IBM released some machines that they called Personal Computers (PCs). Now note the first word of the description ... 'Personal'. Many conotations can arise from that word but the main ones would be, mine and my way. There have been attempts, some successful to a certain extent, to standardize these beasts. But alas, they were not taken seriously enough in the beginning and convience, ease of use and friendly were most important. So we got some hodge podge and strange machines when we go from one person's desk to another. The colors, background pics and modes of operation were/are simply quite a collage. We make them ... Personal.

    Now then, during the initial install and setup, of the Linux system some people will make changes to the way it will be setup and not just use the defaults. Then there are those who take the defaults and just let the system set itself. Of course, this, like everything else in the computer world, is someone else's idea on how things should look and work. If you are happy with that then you need to read no farther. However, if you would like to make some subtle changes that will make your life a little easier then please read on. You will either find a neat way of using your system(s), or get some ideas of ways to do some things on your own or be totally bored.

    One little word of caution. Don't live in root on your Linux system. Create a user for yourself and only go into root when neccessary. You can make yourself a member of root's group and get some special priviledges but it is safer and more profitable to stay out of root. You can still be powerful and great outside of root but not have to worry about accidents that can destroy the system. This should be a learning experience and you need to learn that in most places of work you won't have root privileges so get used to working without them. But on the other hand you may be the SysAdmin so learn how to and what not to do in root.

alias & function

    Two items in Linux (actually 3 if you count scripts) will allow you to personalize some of the commands to your own way of thinking and liking. The first one, alias, is just what its name implies... an alias name for another command, or group of commands. Aliases should be used as a shortcut for longer commands. Functions, the other item, should be used as helper scripts. Now then, these, the aliases or functions, can be placed in the .bashrc file or in files of their own, .alias and .function. They are environment specific. So your set of aliases and functions will not interfere with someone else's and visa-versa.

    Some examples of aliases are:
alias ldm='ls -ltF'
alias goroot='xhost + local:root; xterm -geometry 100x35+130+90 -bg Red3 -fg White   \
  -font 8x13 -rightbar -T InRoot -e su &'

The first one will list in long listing format (-l) sorted by date/time (-t) and append an indicator (*/=@|) to the items displayed. The second alias will use the 'X' server access control to allow access to your display by root. Then it will open a red xterm window and wait for you to enter the root password. You will then have a window open to root for any neccessary actions that need root's authority. These would be typed at the command line as: ldm or goroot. Incidently, the goroot alias is supposed to all be on one line. The '\' is NOT part of the commands, it is an escape to ignore the carraige return at the end of the line. (It's all one line in my .alias file!)

    Some commands require arguments or it is desired to recieve a return value. These would require a function. Some examples are:

function _ldmm

    ls -ltFA $DIR_NAME | more
The above little jewel is an extention to ldm. This will allow you to specify a directory and it will page it thru some screens if there is a lot to be displayed.
function _mounted
  echo "   Device/FS                MountPnt          FStype          Options";
  echo "=========================================================================";
  mount | gawk '$1 {printf("%-25s %s %-15s %s %-10s %s\n",$1,$2,$3,$4,$5,$6); }';
This one will show you what is mounted on your system. Displaying it in a more user friendly way with headings.
View the files: alias or function

    I also put the following in a file called set_tr:

  . /home/ctaylor/.function
  . /home/ctaylor/.alias
The file set_tr is placed in the /bin dir and then when I go off to root I execute it with a '. set_tr' on the command line and this gives me my alias's and function's while I am in root. Just a little tidbit.

    The dot at the beginning of the line signifies to 'Read and execute commands from the filename argument in the current shell context'. This will cause the settings in these files to remain in force the rest of the session. In other words until we exit the term window that was created. When a script is executed using a precedding '.' (dot), it runs in the current shell (does not create a child shell), so it is setting the 'current shell' positional parameter values. OK?


    I set my SuSE Linux up with 2 main partions and 3 swap partitions. One of the main parts is root / and the other is /opt. I use /opt for Netscape, Mozilla and my databases, Oracle and MySQL. I also use it for my Linux Downloads. I do this ... because. The dir /opt has 755 permissions but the dir /opt/Downloads has 775 permissions. Then I made myself a member of the group root. This way I don't have the same perms as root but there are places that I want access to, and anyone else that I want to setup for those same places. opt gets mounted at boot time and is therefore owned by root. So, since I setup the group permissions, the way I have, I can symbolicly link to this Downloads dir from my home dir and then save my downloads in that one directory.

    The above is also why I don't mount the Windows drives D and E at boot time. If I did then I would have to setup the root group permissions for everything on those drives. If I don't mount them at boot time and mount them myself later, then everything is automatically setup for me. I will own it all!! Which in this case is really what I want. The Windows D and E drives are where I do a lot of swapping back and forth (between Windows and Linux) and various other things. The E drive mostly.






Valid HTML 4.01! Click here to validate current page. Best viewed with ANY browser! Valid CSS! Click here to validate current CSS.

Copyright © 2004-2004 Chuck Taylor. All rights reserved.