SlackwareThis Forum is for the discussion of Slackware Linux.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
I found that some terminal emulators fail to deal with bash startup files properly, specifically the older versions of xfterm (xfce). I built a work around by jiggering the order in which they sourced each other, which also fixed the problem of su'ing (su, not su - ) and loosing that users environment variables set in /etc/bashrc. Off the top of my head, however, I cannot recall the order and don't want to complicate the issue by getting it wrong =)
PS: Oooh, in order to find out what's going on when you a) login and b) open up a new terminal - you can always add a line similar to (unchecked for errors): `ps --$$`
That should print out the currently running file. If you add it to all the bash startup files, you can check the order of them =)
sorry but what do you mean by telling you can create it? By just creating a .bashrc and make it executable, placed it in ~/home/ and write in the source code is gona work?
You don't need to make the file executable.
From the 'man bash';
excerpt 'man bash'
When bash is invoked as an interactive login shell, or as a
on-inter-active shell with the --login option, it first reads
and executes commands from the file /etc/profile, if that file
exists. After reading that file, it looks for ~/.bash_profile,
~/.bash_login, and ~/.profile, in that order, and reads and
executes commands from the first one that exists and is
readable. The --noprofile option may be used when the shell is
started to inhibit this behavior.
Very simply create a '.bashrc' and '.bash_profile' in your home directory using your favorite editor. An example for a 'bashrc';
#08-30-06 12:20 gws copied loki:/root
#06-27-07 13:06 gws added from odin for willi
# Add bin to path
# Dynamic resizing
shopt -s checkwinsize
# Custom prompt
#08-29-06 11:40 gws
if [ `id -un` = root ]; then
# Add color
eval `dircolors -b`
# User defined aliases
alias clls='clear; ls'
alias ll='ls -l'
alias lsa='ls -A'
alias lsg='ls | grep'
alias lsp='ls -1 /var/log/packages/ > package-list'
alias web='links -g -download-dir ~/ www.google.com'
#08-29-06 11:50 gws
#To clean up and cover your tracks once you log off
#Depending on your version of BASH, you might have to use
# the other form of this command
trap "rm -f ~$LOGNAME/.bash_history" 0
#The older KSH-style form
# trap 0 rm -f ~$LOGNAME/.bash_history
An example of '.bash_profile';
#08-30-06 12:21 gws copied loki:/root
#06-27-07 13:10 gws copied from odin for willi
# Source .bashrc
if [ -f ~/.bashrc ]; then
Last edited by onebuck; 10-05-2007 at 09:07 AM.
Reason: format code window
.bash_profile is read and executed only by the login shell. Subshells use .bashrc .
Yes, but environmental variables are already set using .bash_profile when you login. .bashrc is used only for colouring and bash specific settings. Using .bashrc for login scripts and setting system wide variables is wrong.
Last edited by Alien_Hominid; 10-06-2007 at 03:58 AM.