[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 4528 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 200 days
Recommended Popular Threads Controvertial Threads
TPS Re-registration
What are your first memories of when Nepal Television Began?
निगुरो थाहा छ ??
ChatSansar.com Naya Nepal Chat
TPS Re-registration case still pending ..
Basnet or Basnyat ??
Sajha has turned into MAGATs nest
NRN card pros and cons?
Do nepalese really need TPS?
कता जादै छ नेपाली समाज ??
Nas and The Bokas: Coming to a Night Club near you
Will MAGA really start shooting people?
Democrats are so sure Trump will win
मन भित्र को पत्रै पत्र!
Top 10 Anti-vaxxers Who Got Owned by COVID
I regret not marrying a girl at least for green card. do you think TPS will remain for a long time?
काेराेना सङ्क्रमणबाट बच्न Immunity बढाउन के के खाने ?How to increase immunity against COVID - 19?
TPS Work Permit/How long your took?
Breathe in. Breathe out.
3 most corrupt politicians in the world
Nas and The Bokas: Coming to a Night Club near you
Mr. Dipak Gyawali-ji Talk is Cheap. US sends $ 200 million to Nepal every year.
Harvard Nepali Students Association Blame Israel for hamas terrorist attacks
TPS Update : Jajarkot earthquake
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