[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 5354 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 365 days
Recommended Popular Threads Controvertial Threads
शीर्षक जे पनि हुन सक्छ।
डीभी परेन भने खुसि हुनु होस् ! अमेरिकामाधेरै का श्रीमती अर्कैसँग पोइला गएका छन् !
What are your first memories of when Nepal Television Began?
Sajha Poll: नेपालका सबैभन्दा आकर्षक महिला को हुन्?
ChatSansar.com Naya Nepal Chat
NRN card pros and cons?
TPS Re-registration case still pending ..
Basnet or Basnyat ??
TPS Re-registration
निगुरो थाहा छ ??
Nas and The Bokas: Coming to a Night Club near you
Toilet paper or water?
Anybody gotten the TPS EAD extension alert notice (i797) thing? online or via post?
अमेरिकामा छोरा हराएको सूचना
ढ्याउ गर्दा दसैँको खसी गनाउच
Sajha Poll: Who is your favorite Nepali actress?
Problems of Nepalese students in US
nrn citizenship
TPS EAD auto extended to June 2025 or just TPS?
अमेरिकामा बस्ने प्राय जस्तो नेपालीहरु सबै मध्यम बर्गीय अथवा माथि (higher than middle class)
Nas and The Bokas: Coming to a Night Club near you
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