Posts Tagged ‘Linux’

Debian Etch Python 2.5 installation

Saturday, August 22nd, 2009

                              
Debian Etch comes with Python version 2.4. You can easily install Python 2.5 with the command

sudo aptitude install python2.5

But even after installation, when you type python at the command prompt or run CGI scripts, you will be faced with Python 2.4.

That’s because python is just a symbolic link to /usr/bin/python2.4. To make Python 2.5 the default, you need to change the symbolic link to point to your newer version of Python. Try this:

ln -sf /usr/bin/python2.5 /usr/bin/python

Here, ln is the linking command, s makes the link symbolic, f forces the link to be overwritten, /usr/bin/python2.5 is the target and /usr/bin/python is the link name.

Voila!

Linux “ll” command / alias

Saturday, August 22nd, 2009

                              
I’ve recently found using ll a real finger saver when you’re hunting around on the command line. ll is not a command on its own, but mearly an alias setup on most distros for the (very slightly longer) ls -l.

That’s great, but when I say most distros, that means somtimes you need to set it up yourself, as I did on my newly purchased Debian VPS. It’s real easy to do.

On the command line just type:


alias ll="ls -l"

You can now save yourself 3 whole keystrokes per dir listing!

The same principle applies to any other command too e.g.
If you’re constantly checking your Apache error logs whilst programming a web app, try something like


alias logtail="tail /var/log/apache2/error.log"

Now you can just type logtail and save your fingers some more work!

Bear in mind, this will only last for as long as the terminal is open. To make this a permanent alias you will need to do something like adding that line to the bottom of your .bashrc file.