Some more Bash customisations

Following on from yesterday’s post I have spent a bit of time playing around with the various Bash configuration options. The ArchWiki has proved invaluable in this (especially the Bash and Color Bash Prompt pages). Also worth a mention is nixCraft’s How to: Change / Setup bash custom prompt (PS1) and Bash Shell PS1: 10 Examples from The Geek Stuff.

The upshot of all this is that I have removed my mods out of /etc/profile and into ~/.bashrc. This means that I have a persistent script1 and one that I can easily share by pointing you towards my Configurate repository on GitHub.

1 When I say persistent in this context, I am referring to the fact that I have a seperate /home partition so that anything in /home (like, my data) will remain untouched by any future upgrades or re-installs.

Frugalware 1.7: First impressions and some notes on configuration

Last night, I finally found the time to upgrade my Frugalware install from 1.6 to 1.7. Truth be told, I gave up on upgrading and simply installed 1.7, but the effect is the same.

My first impressions are good – it looks lovely and a lot of the minor glitches I was struggling with appear to have been ironed out. So I shall stick with it for a bit and see how I get on.

This means, it’s time to start removing some of Bash aliases and this post is largely so that I can look up what I did just in case I find myself needing to do it again.

First off, the ls command. By default, this command is aliased to a collection of options, one of which (-F) causes a trailing slash to be appended to directory names. This annoys me and it has to go.

The alias command reveals that ls is aliased to ls='/usr/bin/ls $LS_OPTIONS'
So all I need to do is amend $LS_OPTIONS so that the -F switch is removed:

LS_OPTIONS='--color=auto -b -T 0'

Next to go is the manual confirm. The cp, mv and rm commands all have the -i flag switched on. This causes a stream of prompts when I am dealing with multiple files and it has to go:

unalias mv
unalias rm
unalias cp

And that’s it.

As for Frugalware itself, there is a lot to like about the distro and I can see myself sticking with it for a while. But for now, here’s a screenshot.

And now for the inevitable update.

Obviously, the changes described above only affect the current terminal session. As soon as you start a new session, everything is reset. So you need to edit your /etc/profile file to make the changes permanent.

The interactive mode for mv, cp and rm is easy enough. The aliases are defined at the bottom of the file and simply need to be suppressed:

# Aliases for newbies:
# alias rm='rm -i'
# alias cp='cp -i'
# alias mv='mv -i'

And then I added a line to make the ls command look the way I wanted:

# A nicer way to ls
export LS_OPTIONS='--color=auto -b -T 0'

And I really am done this time.