Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
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 always give the -ls option to get a color shell if i can. i.e. "bash -ls", "xterm -ls". i'd like to setup my .profile or .bashrc stuff so that this option is passed by default, so i can just execute "bash" or "/bin/bash" and still have a colorful shell. i've looked around for info on these to files, but it seems like they are mostly for running scripts and commands when bash starts. is there anyway to specify default options for bash?
yeah, .bashrc seems to be able to configure colors and stuff for bash. but what "bash -ls" does(i think) is automatically guess the colors for a terminal. so really, i just want all of my bash sessions to run with a particular option.
You should setup a .bashrc & .bash_profile for your user;
:~$ cat .bashrc
# 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
~$ cat .bash_profile
# Source .bashrc
if [ -f ~/.bashrc ]; then
When bash is invoked as an interactive login shell, or as a non-interactive 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
When a login shell exits, bash reads and executes commands from the file ~/.bash_logout, if
When an interactive shell that is not a login shell is started, bash reads and executes com-
mands from ~/.bashrc, if that file exists. This may be inhibited by using the --norc
option. The --rcfile file option will force bash to read and execute commands from file
instead of ~/.bashrc.