alias help needed

Dear All,

I need help in seeting alias

i use follwing command to set an alias

alias hitme='cd /tmp; ls-ltr'

alias is set, but when I disconnect from the session and relogin, and try to use the same alias it doesnt work. I think i have to save my alias into enviornmental variables, but i dont know how to do this

can anyone help me out.

put the alias in .profile

thnkz rakeshawasthi,

but it would be muchj better if u help in locating the file path.

i mean where this (.profile) file resides and can i (vi) this file to add my alias

it will be in your home directory and you can see it using
ls -a
and
ofcourse vi it.

thnks a lot again,

after adding in .profile do i need to restart anything or it will take immediate effect.

secondly if i want to remove it can i delete it from .profile file or do i need to use unalias command,

run below command after adding the alias in .profile

. .profile

to remove if you want to remove from teh session only then unalias is fine, but for permanently removing delete the line from .profile and run the above code or unalias.

i knw it getting bit annoyed, but i really appreciate ur help

so one more question,

by running this command, what basically wil happen, i mean is this file only used for setting alias, as i cant take risk by executing such command on my running server as a lot of services running.

please claer a bit regaridg this .profile.

services will not normally read the .profile for commands. This file is read only for interactive , login shells. So there should be no risk to a running server.

However, if for some reason a service is started under a user via remote login shell (such as rsh, ssh), the .profile might be read.