alias help needed


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting alias help needed
# 1  
Old 06-24-2009
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.
# 2  
Old 06-24-2009
put the alias in .profile
# 3  
Old 06-24-2009
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
# 4  
Old 06-24-2009
it will be in your home directory and you can see it using
ls -a
and
ofcourse vi it.
# 5  
Old 06-24-2009
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,
# 6  
Old 06-24-2009
run below command after adding the alias in .profile
Code:
. .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.
# 7  
Old 06-24-2009
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.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Alias help

I am creating subversion pre commit hook on linux to run on client side but its not working and throwing an error - alias svnbi="plutil *.plist|grep -v OK; if ; then svn ci -m $1 ; fi" but when I run - (test is $1 here) svnbi test bash: syntax error near unexpected token `test' ... (1 Reply)
Discussion started by: jacki
1 Replies

2. UNIX for Dummies Questions & Answers

IP Alias

Quick question Have a AIX system that has been up for years with a 192.9.x.x IP scheme and we want to add a second IP to the system. I setup the second IP 10.1.x.x as an alias via smit. Since these two IP's are on different VLANs will this be an issue? Reason I ask is that I cannot ping... (3 Replies)
Discussion started by: Chrisp
3 Replies

3. UNIX for Dummies Questions & Answers

Create alias files (not alias commands)

If one: $ find -name 'some expression' -type f > newfile and then subsequently wants to create an alias file from each pathname the find command retrieved and the > placed within 'newfile', how would one do this? Ideally, the newly created alias files would all be in one directory. I am... (3 Replies)
Discussion started by: Alexander4444
3 Replies

4. UNIX for Dummies Questions & Answers

using alias

I need to login to one server and then switch the user and set a number alias. But i cant modify the .profile file. I have one script avi1.sh $ more avi.sh sudo su - bil sh avi1.sh and in home directory of bil i have avi1.sh that says $ more avi1.sh alias l='ls -ltr' alias b='cd... (7 Replies)
Discussion started by: blackeyed
7 Replies

5. UNIX for Dummies Questions & Answers

alias help

Hello again, what does \!* do int his line alias lookup 'grep -i \!* who.is.who' Thanks! (1 Reply)
Discussion started by: kris888
1 Replies

6. UNIX for Dummies Questions & Answers

alias

i used 'alias' command for a set of daily used long commands. But i noticed they are gone once i log out of the ssh session. Can any one plz let me know if there is a way to set it permanently for my user. (1 Reply)
Discussion started by: pharos467
1 Replies

7. Shell Programming and Scripting

please help me regarding alias

Dear All, I have given alias to run a script which will calculate memory and cpu utilization as "utils" in my bash shell. Even i have given this entry in .profile and .bashrc in my home directory. It is working fine. Now my question is that I want to use this alias in... (17 Replies)
Discussion started by: naree
17 Replies

8. Filesystems, Disks and Memory

alias

Hello, I'm trying to create an alias that will show the path name of a current directory when a user cd's into any directory. I have tried the following: alias cd ' cd | pwd ' This just lists the current directory, even when I cd to another directory the alias just lists my home... (6 Replies)
Discussion started by: klannon
6 Replies

9. Shell Programming and Scripting

Alias

how implement functionality alias in the same way as in csh? (use Bourne type sh or bash) (3 Replies)
Discussion started by: sunhata
3 Replies

10. UNIX for Dummies Questions & Answers

Alias

I'm trying to do the following: Create an alias called whopw that will change directory to the /etc directory and grep the password file for my username to return my password file entry. One assumption: Once the alias works, I will be letting all of my friends copy and use it. In other... (2 Replies)
Discussion started by: klannon
2 Replies
Login or Register to Ask a Question