ArchThis Forum is for the discussion of Arch Linux.
Notices
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.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I get really frustrated that in Arch my directories are not blue / purple and my tarball files are not red. How can I colorized my ls output to be more convenient?
My users all have .bashrc file however my root user doesn't. This is why I can't see colored 'ls' output. If my root use is missing his .bashrc, how can I have my root account be able to see colored 'ls' output?
You could setup a .bashrc & .bash_profile for your user(s) & root;
Code:
sample .bash_profile;
~$ cat .bash_profile
#-------
# .bash_profile
#08-30-06 12:21
#
# Source .bashrc
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
#---------
Code:
sample .bashrc;
:~$ cat .bashrc
#----------
#.bashrc
#08-30-06 12:20
# Add bin to path
export PATH="$PATH:/sbin:/usr/sbin:$HOME/bin"
#export PATH="$PATH:$HOME/bin"
# Dynamic resizing
shopt -s checkwinsize
# Custom prompt
#PS1='\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
#08-29-06 11:40
if [ `id -un` = root ]; then
PS1='\[\033[1;31m\]\h:\w\$\[\033[0m\] '
else
PS1='\[\033[1;32m\]\h:\w\$\[\033[0m\] '
fi
#
# Add color
eval `dircolors -b`
# User defined aliases
alias cls='clear'
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 na='nano'
alias web='links -g -download-dir ~/ www.google.com'
#08-29-06 11:50
#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
#--------
Make sure your /etc/skel items you copied don't contain items like "PATH=$PATH:~/bin" running as root items like that are fairly dangerous, so be sure you read the files you copied in well and ensure they're doing what they should be done exactly.
You should use a method to differentiate root & user so the PATH is correctly set.
Look at the way the root is tested in the sample to set for color and the way the PATH is set early at the top of the script. You can modify to suit.
In '~' I setup for each user and modify to suit. If you have a lot of users then setup the defaults for system wide. This way you can setup a user to have specific needs with a '~/.bashrc' & '~/.bash_profile'.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.