[Show all top banners]

Comp
Replies to this thread:

More by Comp
What people are reading
Subscribers
:: Subscribe
Back to: Kurakani General Refresh page to view new replies
 UNIX help
[VIEWED 5373 TIMES]
SAVE! for ease of future access.
Posted on 02-18-12 8:29 PM     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

 
Hello everyone,

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

Thank you.

 
Posted on 02-18-12 11:09 PM     [Snapshot: 40]     Reply [Subscribe]
Login in to Rate this Post:     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

 
Posted on 02-18-12 11:37 PM     [Snapshot: 56]     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 
 
Posted on 02-19-12 8:27 AM     [Snapshot: 109]     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

save the alias in .cshrc file

it will create a permanet alias

 
Posted on 02-19-12 1:39 PM     [Snapshot: 205]     Reply [Subscribe]
Login in to Rate this Post:     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).






 
Posted on 02-19-12 3:02 PM     [Snapshot: 239]     Reply [Subscribe]
Login in to Rate this Post:     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 be able to reply! If you don't have a login, please register here.

YOU CAN ALSO



IN ORDER TO POST!




Within last 90 days
Recommended Popular Threads Controvertial Threads
TPS Re-registration case still pending ..
Toilet paper or water?
and it begins - on Day 1 Trump will begin operations to deport millions of undocumented immigrants
Tourist Visa - Seeking Suggestions and Guidance
From Trump “I will revoke TPS, and deport them back to their country.”
I hope all the fake Nepali refugee get deported
Those who are in TPS, what’s your backup plan?
advanced parole
Sajha Poll: Who is your favorite Nepali actress?
ढ्याउ गर्दा दसैँको खसी गनाउच
To Sajha admin
Problems of Nepalese students in US
Mamta kafle bhatt is still missing
अरुणिमाले दोस्रो पोई भेट्टाइछिन्
Are Nepalese cheapstakes?
Nepali Psycho
MAGA denaturalization proposal!!
How to Retrieve a Copy of Domestic Violence Complaint???
wanna be ruled by stupid or an Idiot ?
All the Qatar ailines from Nepal canceled to USA
NOTE: The opinions here represent the opinions of the individual posters, and not of Sajha.com. It is not possible for sajha.com to monitor all the postings, since sajha.com merely seeks to provide a cyber location for discussing ideas and concerns related to Nepal and the Nepalis. Please send an email to admin@sajha.com using a valid email address if you want any posting to be considered for deletion. Your request will be handled on a one to one basis. Sajha.com is a service please don't abuse it. - Thanks.

Sajha.com Privacy Policy

Like us in Facebook!

↑ Back to Top
free counters