A few Bash tweaks for Slackware

This is just a personal configuration, but it has proved useful.

dircolors >> ~/.bashrc

Now let's make the colors permanent, edit ~/.bashrc with your favourite editor, and add the following lines:

alias ls="ls -F --color=always"

If, like me, you found out that you can't live without some additional ll alias, add the following to your ~/.bashrc:

alias ll="ls -lF --color=always"
alias lt="ls -lrtF --color=always"

Now, when you type ll the format will be long by default.

The alias lt displays file sorted by modification time, oldest first, newest last.

Both these aliases use the long format by default, with colors, and adding slashes at the end for directories (and other characters for other type of files, see man ls for a complete explanation).

PLEASE NOTE While this is nice to have these options applied automatically while typing commands on a command line, the color=always can be a pain in the neck when running shell scripts (or one-liner) use with caution, and, in case of trouble, make sure you type: ls --color=never, for instance.

Same thing, but only for the grep command:

alias grep="grep --color=always"

This makes the grep output nicely colored and very useful (this comes straight from Suse Linux, by the way)

The following export command makes sure all the man pages of the software you compile on your Slackware machine can be taken into account by the man command:

export MANPATH=/usr/local/share/man:$MANPATH

Finally, to rebuild the entire whatis database, make sure you have the same values in the MANPATH of root profile, and issue the following command as root:

# makewhatis -w

Now, the man command will properly display man pages for software compiled on your machine and both apropos and whatis will display information about software compiled in /usr/local/.

Nothing really earth-shattering here, but it's nice to have on a Slackware machine!

Hope this helps...