# colors and tab completion



## wonslung (May 19, 2009)

i know i'm missing something very basic...but i can't seem to get this working...

i've been able to get it working on the root account but i really would rather not stayed logged in as root to work....

i've tried all the different shells i have including

tcsh csh bash sh

and i can't seem to get this working OUTSIDE of root...i've looked in /root at the files like .cshrc and .profile and they are exactly the same as the ones i have in my home directory...what am i missing here?


----------



## gnemmi (May 19, 2009)

Hi !

Could you please log on as your user, issue the command `% echo $SHELL` and paste it's output in here?


----------



## vivek (May 19, 2009)

For csh / tcsh use ~/.cshrc file. Here is my modified file. It displays colors with ls, set prompts, auto file completion and few more options as per my needs.

```
# get colors 
alias ls 	ls -G
alias h		history 25
alias j		jobs -l
alias la	ls -a
alias lf	ls -FA
alias ll	ls -lA

# A righteous umask
umask 22

set path = (/sbin /bin /usr/sbin /usr/bin /usr/games /usr/local/sbin /usr/local/bin $HOME/bin)

setenv	EDITOR	vi
setenv	PAGER	more
setenv	BLOCKSIZE	K

if ($?prompt) then
	# An interactive shell -- set some stuff up
	set prompt = "`/bin/hostname -s`# "
	set filec
	set history = 100
	set savehist = 100
	set mail = (/var/mail/$USER)
	if ( $?tcsh ) then
		bindkey "^W" backward-delete-word
		bindkey -k up history-search-backward
		bindkey -k down history-search-forward
	endif
endif
# size of history buffer
set history = 100

# enable auto-complete
set filec

# stop it beeping
set nobeep

# ignore *.o files for file completion
set fignore = '.o'

# '%' prompt for normal user; '#' for root/su
set promptchars="%#"

# /path/to/cwd{cmd number}%
set prompt="[%n@%m %/]%# "

# List matches when autocompleting
set autolist=true

# enable spelling correction
set correct=all

# Useful key bindins
bindkey "^W" backward-delete-word
bindkey -k up history-search-backward
bindkey -k down history-search-forward
bindkey "^?" backward-delete-char
bindkey "\e[3~" delete-char
bindkey "\e[1~" beginning-of-line
bindkey "\e[4~" end-of-line
```
Once done, login and logout again or simply load ~/.cshrc file again.


----------



## wonslung (May 19, 2009)

ok...the problem seems to be i'm stuck in /bin/sh even though i've changed it in /etc/passwd....what's the dealio


----------



## wonslung (May 19, 2009)

used pw usermod -s and changed it, thanks for the echo command


----------



## gnemmi (May 19, 2009)

You are probably going to find a lot of helpfull information in here.

In case you still need help, feel free to post asking for it in here


----------



## SirDice (May 19, 2009)

If you use tcsh and want color ls add to .cshrc:

```
setenv CLICOLOR
```


----------



## gnemmi (May 19, 2009)

Nice one !

You got me digging on the man pages !

I didn't know about that one, although I was aware of "LS_COLORS" (termcap like coloring, and even went as far as using coloring from Linux files =P), I didn't know that ls(1) had it's own coloring env...

Thanks for sharing SirDice


----------

