Files

Saturday, February 5, 2011

/etc/yum.repos.d/

Any file created in /etc/yum.repos.d/ with .repo extension is a repository file for Yellowdog Updater Modified. The contents of the file should have a general format.

[test]               
name=Test
baseurl=file:///var/ftp/pub/Server
        ftp://192.168.1.254/pub/Server
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

You can add any number of repository on the same file with unique name field. 


Friday, February 4, 2011

/etc/resolve.conf

The DNS name server is defined on this file. Optionally you can define it to search the domain.
search localdomain
nameserver 192.168.2.2

/etc/sysconfig/network

This file defines the hostname of your computer.
NETWORKING=yes
NETWORKING_IPV6=no
HOSTNAME=localhost.localdomain

Saturday, January 29, 2011

/etc/sysconfig/network-scripts/ifcfg-eth0

This file contains the configuration of your network card. The settings are different for dhcp connection and for a static connection.

For a dhcp connection the file looks like
# Advanced Micro Devices [AMD] 79c970 [PCnet32 LANCE]
DEVICE=eth0
BOOTPROTO=dhcp
HWADDR=00:0c:29:d6:04:92
ONBOOT=yes
TYPE=Ethernet
For static connection it looks like
# Advanced Micro Devices [AMD] 79c970 [PCnet32 LANCE]
DEVICE=eth0
BOOTPROTO=none
HWADDR=00:0c:29:d6:04:92
ONBOOT=yes
TYPE=Ethernet
NETMASK=255.255.255.0
IPADDR=192.168.1.3
GATEWAY=192.168.1.1

Friday, January 28, 2011

/etc/issue

This file contains the display message to be written in various virtual consoles. Kernel \r represents kernel version and \m represents machine architecture. Other option like \l (tty) and \s (kernel name) can be also used

Redhat Enterprise Linux release 5.4
Kernel \r on an \m

/etc/redhat-release

This file contains the release of the redhat version

.bash_profile, .bashrc, .bash_logout

.bash_profile is a bash script file which is run when the system starts up. Each user has their own .bash_profile, .bashrc and .bash_logout file. For the root user it is in /root/ and for other users it is in /home/username/ directory.
User specific environment and startup programs are written in .bash_profile file.

# .bash_profile

# Get the aliases and functions
# If file ~/.bashrc exists then run the file

if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi

# User specific environment and startup programs
# Additional path can be added seperated by colon eg. PATH=$PATH:$HOME/bin:/usr/sbin:/sbin

PATH=$PATH:$HOME/bin

export PATH
unset USERNAME

User specific aliases and functions are declared in .bashrc



# .bashrc

# User specific aliases and functions

alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'

# Source global definitions
# If file /etc/bashrc exists then run it
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi



The scripts which needs to be run when the user logs out can be written in .bash_logout.


# ~/.bash_logout

clear