October 13, 2009, 3:43 pm

If you want an easy way to keep commands out of your ~/.bash_history, do the following:
put this in your .bashrc:
export HISTCONTROL=ignorespace
then in a new bash session when you type in a command, if you put a space before it, it doesn’t appear in your history.
$echo hello #in history
$ echo hello #not in history
September 30, 2009, 1:14 pm

Log into a linux box often and find that Home, End, Delete or Ctrl+Arrow keys don’t work? Well here’s the fix. Place the following in your ~/.inputrc file
“\e[7~”: beginning-of-line #home
“\e[8~”: end-of-line #end
“\e[3~”: delete-char #delete
“\eOd”: backward-word #ctl-leftarrow
“\eOc”: forward-word #ctl-rightarrow
And then exit bash and reopen a new bash session.
Secondly, if you’re on a machine with multiple (command-line) users, then it makes little sense for everyone to have to create the same “~/.inputrc” file. You need only create one file with those readline settings in it, I suggest “/usr/local/etc/inputrc“, and then point everyone to it by putting this line into “/etc/profile“:
export INPUTRC=’/usr/local/etc/inputrc’
August 30, 2009, 2:37 pm

Below is a quick rundown on how to color output of echo in bash.
Continue reading ‘Bash Color Escape Codes’ »
July 28, 2009, 6:40 pm

I’ve done a lot over the past few months to make my time spent on the command line a bit more enjoyable and easier to use. Hopefully you’ll find these steps useful as well.
Continue reading ‘How to have a lightweight, beautiful, functional terminal’ »
Tags:
.Xdefaults,
.Xresources,
256 colors,
bash,
gnu screen,
irssi,
rxvt-unicode,
screen,
urxvt,
vim,
xterm Category:
Commandline Tools,
Gnu screen |
1 Comment
April 22, 2009, 10:57 am

Here’s how to get a personalized and satisfactory completion on Gentoo installations..
First of all you need an use flag set widely in your system so that every software you are going to emerge (or re-emerge) if is capable will be added to your competition choices. To do so just open our magic make.conf with your favourite editor (I use vim, you can use emacs, nano, pico…i don’t really care about wars)
# vim /etc/make.conf
Continue reading ‘Bash Completition on Gentoo’ »
April 10, 2009, 8:12 am

Looking to reject the GUI life altogether and restrict yourself to the command line like a real Unix geek? Great! But as soon as you miss the OOo spellchecker, don’t fret: most Linux systems come with the look command built-in, which is a command-line spellchecker. To get started, type look followed by part of a word:
look separ
should show you matches like “separate”, “separately”, and so on, whereas entering:
look seper
will show nothing, because “seperate” is a mis-spelling. Also, instead of simply entering the command you can use tab completion for look to display a list of possible options.
April 10, 2009, 8:12 am

If you have a directory that contains ten subdirectories and you want to delete three of them, the slow way to do it would be like this:
rm -rf /home/tuxtraining/work
rm -rf /home/tuxtraining/projects
rm -rf /home/tuxtraining/sandbox
But that’s pretty darn slow and open to making mistakes – a much smarter way to is to let Bash perform multiple filename expansion by placing the options inside braces. For example, this would achieve the same as the three lines from above:
rm -rf /home/tuxtraining/{work,projects,sandbox}
April 10, 2009, 8:01 am

Typing on the command line isn’t easy. First, it takes a lot of time to learn how all the commands work, but then even after that you need to be very precise with your file and directory names, otherwise you’ll need to try and try again.
But there’s a way out: Bash has a built-in command called “shopt” that lets you set various command-line options. For example, running shopt -s cdspell enables automatic typo correction for directory names, so that typing cd /hom/hudzila will get you to the nearest match – /home/hudzilla.
You can also use shopt -s nocaseglob so that when you type part of a filename and press Tab to autocomplete, Bash does a case-insensitive search.
November 13, 2008, 2:24 pm
October 27, 2008, 6:04 pm

Bash, which is the default shell in Linux contains a whole lot of key bindings which makes it really easy to use . The most commonly used shortcuts are listed below :
Continue reading ‘Tip: Bash Shortcuts’ »