UNIX help - Sajha Mobile
SAJHA MOBILE
UNIX help
Posts 6 · Viewed 6817 · Go to Last Post
Comp
· Snapshot 0
Like · Likedby · 0
 
Hello everyone,

Can anyone help me to create premanent alias in UNIX? It will be a great help.

Thank you.
jhapaliketo
· Snapshot 40
Like · Liked by · 0
Do the following steps:
1. cd
2. vi .bashrc
3. alias command='aliasofcommand'
4. save and quit (:wq!)
5. exit and login again.

If this doesnot work for you then apply the same steps for .bash_profile
2. vi .bash_profile

This will create permanent alias for you.
Last edited: 18-Feb-12 11:27 PM
monkyyou
· Snapshot 56
Like · Liked by · 0
www.computerhope.com/unix/ualias.htm
may this will help you.
khoikkhoik
· Snapshot 109
Like · Liked by · 0
save the alias in .cshrc file

it will create a permanet alias
Cacophonix
· Snapshot 205
Like · Liked by · 0
 Comp,

depends on what shell you're running.

Bash is most common (comes default with ubuntu, archlinux) and for that you need to add the alias to ~/.bashrc OR a better way would be to add it to ~/.bash_aliases given that you have sourced ~/.bash_aliases from your bashrc. 

Everytime you invoke the shell, bash checks the bashrc file to see what configuration defaults to start with and if you have your alias set there, then it uses that too. 

So in your .bashrc or your .bash_aliases (i keep mine in aliases cuz i have a tonne of them and so makes it easier to manage) you set your alias like you would normally with

alias [your-alias-name] = "[whatever]"

Once you've saved your file, you can use the 'source' command to reload your configs like so:

source ~/.bash_aliases (or whatever file u wrote into).





Comp
· Snapshot 239
Like · Liked by · 0
Thank you Everyone for quick reponses.
 
I was also wondering if we can make alias without using assign operator.
I know we can make it on C shell but what about bash.
Please log in to reply to this post

You can also log in using your Facebook
View in Desktop
What people are reading
You might like these other discussions...
· Posts 16 · Viewed 3367 · Likes 3
· Posts 8 · Viewed 1447 · Likes 3
· Posts 1 · Viewed 506 · Likes 3
· Posts 1 · Viewed 690 · Likes 3
· Posts 1 · Viewed 427
· Posts 18 · Viewed 457
· Posts 8 · Viewed 544
· Posts 1 · Viewed 93
· Posts 1 · Viewed 97
· Posts 5 · Viewed 329



Travel Partners
Travel House Nepal