Genel

Aliases

Aliases

11 am happy running Mandrake 7.2, and have managed to get to grips with KDE2 and the terminal too, to some extent (l’m nevv to Linux, but some experience vvith Unix in the past). I understand that I can use the alias command to create nevv commands I can run in the shell, but once

I close the shell, I have to type them ali in again. Is there any vvay to create the aliases and have the computer remember them? Callurfl, via email

The ansvver is that question is yes, you can. But rather than set up a process to run on startup, you should edit the bashrc file, vvhich is run every time a bash shell

is created.

You’ll find the .bashrc file in your $HOME directory, that is, the home directory for the account you are logged in under Edit the file (it has a full-stop at the start of it, vvhich means that it is normally hidden by file requesters and the list command) in your favourite editör and add the alias commands on separate lines. You’ll probably find, running Mandrake, that some useful aliases have already been set up like:

alias rm-rm -i’

Which basically means that vvhen you type: rm fred* the shell vvill interpret it as: itti -i fred*

This is a very useful feature (in this case, it means that you are alvvays queried vvhen removing fileş), but othervvise you have to be careful that you don’t assign an alias to a name that already exists -bash vvon’t check this, and, if it happens, you’ll be unable to use that command from the shell.

Bir yanıt yazın

E-posta adresiniz yayınlanmayacak. Gerekli alanlar * ile işaretlenmişlerdir