Posts Tagged ‘Commands’

Chown time saver

Sunday, August 23rd, 2009

                              
Here’s another little time saver that I use quite a lot with the chown command.

If you want to change the ownership of a file in linux to a user and group that have the same name, you could use the command :


chown mike:mike filename


A nifty little short cut here is to write it as :


chown mike. filename



Here, the . (full-stop / period) after the username mike, also sets the group to mike!

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!