Re: turn off bash colored prompts for all users

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Am 02.08.2013 23:56, schrieb Joe Zeff:
> On 08/02/2013 02:30 PM, Tom Horsley wrote:
>> In fact, I have thwarted that on my system by running a
>> yum "hook" function that re-applies all my hacks every time
>> there is an update, but it is silly that I have to resort
>> to that.
> 
> This is why I referred to my method as elegant: I don't need to know where the colors are set up and I don't need
> to worry about updates stepping on my changes.  I've applied it to my own .bashrc and root's. There are two friends
> who have accounts for ssh reasons, and if they don't like color ls, they can either change it, or ask me about it
> because I'm not imposing my preferences on them

a more elegant method would be to "source" a central file

/root/.bashrc:
if [ -f /usr/local/etc/bash_profile ]; then
 . /usr/local/etc/bash_profile
fi

/home/harry/.bashrc:
if [ -f /usr/local/etc/bash_profile ]; then
 . /usr/local/etc/bash_profile
fi
_______________________________________

[root@srv-rhsoft:~]$ cat /usr/local/etc/bash_profile
alias dir='/usr/bin/ls -a -l -h --color=tty -X --group-directories-first --time-style=long-iso'
alias rm='/usr/bin/rm -I --one-file-system'
alias cp='/usr/bin/cp -i'
alias mv='/usr/bin/mv -i'
alias ls='/usr/bin/ls -l -h --color=tty -X --group-directories-first --time-style=long-iso'
alias df='/usr/bin/df -hT --exclude-type=tmpfs --exclude-type=devtmpfs'
alias ..='cd ..'
alias ...='cd ../..'
alias grep='/usr/bin/grep --color'
alias chown='/usr/bin/chown --preserve-root --changes --no-dereference'
alias chmod='/usr/bin/chmod --preserve-root --changes'
alias repair_mysql='/usr/bin/mysqlcheck -h localhost --check-upgrade --all-databases --auto-repair --user=root -p'
alias free="/usr/bin/free -m"
alias rkhunter='/usr/bin/rkhunter --skip-keypress  --report-warnings-only'
alias nmap_scan='/usr/bin/nmap -O -sV -T4 -d'

alias firewall_status='/usr/sbin/iptables --list --numeric --verbose | grep -v LOG'

alias nat_status='/usr/sbin/iptables -t nat --list --numeric --verbose; echo ""; echo
"----------------------------------------------------"; /usr/bin/netstat-nat -x | sort -n; echo ""; echo "Tracked
Connections:"; /usr/bin/netstat-nat -n | wc -l'
alias mysql='/usr/bin/mysql -u root -p'
alias mysql_upgrade='/usr/bin/mysql_upgrade -u root -p'
alias repair_mysql='/usr/bin/mysqlcheck -h localhost --check-upgrade --all-databases --auto-repair --user=root -p'
alias analyze_mysql='/usr/bin/mysqlcheck -h localhost --analyze --all-databases --user=root -p'
alias ntp_status='watch "/usr/sbin/ntpq -p"'
alias bond_status='cat /proc/net/bonding/bond0'
alias netstat='/usr/bin/netstat --numeric-hosts --numeric-ports --programs -u -t'
alias fsck.ext4='/usr/sbin/fsck.ext4 -C 0 -f'
alias systemctl='/usr/bin/systemctl --no-pager --full'
alias clamscan='/usr/bin/clamscan --log=/var/log/clamscan.log --infected --recursive=yes --cross-fs=yes
--scan-pe=yes --scan-elf=yes --scan-ole2=yes --scan-pdf=yes --scan-html=yes --scan-archive=yes'
alias uname='/usr/bin/uname -rv'
alias route='/usr/sbin/route -n'
alias bash_history='/usr/bin/cat ~/.bash_history'
alias rate_control='/usr/bin/watch "/usr/sbin/iptables --list --numeric --verbose | grep -v LOG | grep hit_count;
/usr/sbin/iptables --list --numeric --verbose | grep -v LOG | grep conn; echo \"\"; echo \"Tracked IPs\"; cat
/proc/net/xt_recent/DEFAULT | wc -l"'
alias kate='/usr/bin/kate --graphicssystem native'
alias ssl_bench='openssl speed -evp aes-256-cbc aes-128-cbc rc4 bf-cbc'
alias readahead_analyze='/usr/lib/systemd/systemd-readahead analyze'
alias bind_version='dig version.bind chaos txt'

export HISTCONTROL=erasedups:ignorespace
export HISTTIMEFORMAT='%F %T '

export GREP_COLOR="00;41"

if ([ "$TERM" != "screen" ] && [ "`pgrep screen`" != "" ] && [ "$SSH_TTY" != "" ]); then
 screen -r 2> /dev/null
fi

Attachment: signature.asc
Description: OpenPGP digital signature

-- 
users mailing list
users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Fedora Code of Conduct: http://fedoraproject.org/code-of-conduct
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Have a question? Ask away: http://ask.fedoraproject.org
[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux