Xfce terminal: colors

I have Xfce terminal emulator installed on most machines. The Xubuntu version has color coding that distinguishes directories (purple) from files (white or green) for instance. The terminals on non-Linux machines do not have this color coding. Where can this color option be set? Is there a configuration file that has this color coding defined?

printf "alias ls='ls --color=auto'\n" >> $HOME/.bashrc
. !$

Thanks. Can you explain what the last line should do? I get the following:

# . !$
. ~$
Unknown user: $.

You were talking about Xubuntu, so I expected you to be using some similar system or bash. I have never seen this output so...

 printf "alias ls='ls --color=auto'\n" >> $HOME/.bashrc

means writing "alias ls='ls --color=auto'" at the bottom of the file .bashrc, which will work only with bash. You can try to find out which shell you're using by running

echo $0

If it is bash, try editing .bashrc in a text editor, then.

. !$

The dot means sourcing a file, in bash it is the same as the command "source".

"!$" is a history expansion, and it means $HOME/.bashrc, which was the last argument from the previous command.

In other words

source $HOME/.bashrc

You don't need the last command if you just open a new terminal window.

---------- Post updated at 01:32 AM ---------- Previous update was at 01:28 AM ----------

BTW, "# . !$" means you're running the command as root, doesn't it? .bashrc is in your user's $HOME.

Thanks for the answer, it was csh that I was using. In bash however, there is the following error message after entering the printf command:

# ls
ls: illegal option -- -

And yes, I am logged on as root.

Again, because you've mentioned Xubuntu, I expected you to be using the "GNU coreutils" besides bash. The option --color=auto will output this error in MAC OS X, or BSD, for example, unless you download coreutils from gnu.org.

So, two things you might want to consider: reading the man page or help page for the ls command, if it supports colors.

Searching how you could use an alias in csh.

If you just want to get rid of "alias ls='ls --color=auto'" for bash, it is safer to edit the file .bashrc manually, it is a hidden file if you're using a graphical file manager. Remove the line containing "alias ls='ls --color=auto'". The command 'printf' is basically the same as 'echo'

For Mac, they explain how to install ls from GNU here: A better ls for Mac OS X | hocuspokus

For your own safety, you should beware whether you need to be logged in as root or not, I think you can install sudo too: Sudo Main Page

1 Like

In FreeBSD this solved the problem:

alias ll ls -lAG