Balthasar
Balthasar

Reputation: 1237

Aliases in bashrc are not working - everything else is

given this ~/.test file on Ubuntu 12.04:

alias ll='ls -la'
echo "TEST"

when I source ~/.test I get TEST printed to the terminal but the alias is not working.

Further information in response to questions:

This is a terminal copy/paste for illustration:

kontrol@smartxffts:~$ cat .test
alias ll='ls -la'
echo "TEST"

kontrol@smartxffts:~$ source .test
TEST
kontrol@smartxffts:~$ ll
ll: command not found
kontrol@smartxffts:~$ alias ll='ls -la'
kontrol@smartxffts:~$ ll
ll: command not found

The alias command works as expected with other accounts on the same system. This user where it doesn't work was created as follows:

sudo mkdir /home/kontrol
sudo useradd -u 1001 -b /home -s /bin/bash -G adm,cdrom,sudo,dip,plugdev,lpadmin,sambashare kontrol
sudo chown kontrol:kontrol kontrol/

Still stumped...!

Upvotes: 3

Views: 1015

Answers (1)

Balthasar
Balthasar

Reputation: 1237

There was a ll alias in the .bashrc with the option --color=auto. Removing that solved this. That still doesn't explain why a) the new alias of ll didn't overwrite the old one, and b) why the option --color=auto made it not work. Other ls aliases use that option and they work.

Upvotes: 1

Related Questions